btop: add v1.3.0, added GPU variant (#42139)
This commit is contained in:
parent
549ab690a8
commit
75e96b856e
12
var/spack/repos/builtin/packages/btop/link-dl.patch
Normal file
12
var/spack/repos/builtin/packages/btop/link-dl.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
--- a/CMakeLists.txt 2024-01-07 15:23:01.000000000 +0100
|
||||||
|
+++ b/CMakeLists.txt 2024-01-18 10:55:06.245357111 +0100
|
||||||
|
@@ -150,6 +150,9 @@
|
||||||
|
|
||||||
|
target_link_libraries(btop ROCm)
|
||||||
|
endif()
|
||||||
|
+ if(NOT BTOP_STATIC)
|
||||||
|
+ target_link_libraries(btop ${CMAKE_DL_LIBS})
|
||||||
|
+ endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(BTOP_USE_MOLD)
|
@ -2,10 +2,11 @@
|
|||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
from spack.build_systems import cmake, makefile
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
class Btop(MakefilePackage):
|
class Btop(MakefilePackage, CMakePackage):
|
||||||
"""Resource monitor that shows usage and stats for processor,
|
"""Resource monitor that shows usage and stats for processor,
|
||||||
memory, disks, network and processes.
|
memory, disks, network and processes.
|
||||||
"""
|
"""
|
||||||
@ -17,12 +18,27 @@ class Btop(MakefilePackage):
|
|||||||
|
|
||||||
license("Apache-2.0")
|
license("Apache-2.0")
|
||||||
|
|
||||||
|
version("1.3.0", sha256="375e078ce2091969f0cd14030620bd1a94987451cf7a73859127a786006a32cf")
|
||||||
version("1.2.13", sha256="668dc4782432564c35ad0d32748f972248cc5c5448c9009faeb3445282920e02")
|
version("1.2.13", sha256="668dc4782432564c35ad0d32748f972248cc5c5448c9009faeb3445282920e02")
|
||||||
|
|
||||||
conflicts("%gcc@:9", msg="C++ 20 is required")
|
build_system("makefile", conditional("cmake", when="@1.3.0:"), default="cmake")
|
||||||
|
|
||||||
|
variant("gpu", default=False, description="Enable GPU support", when="build_system=cmake")
|
||||||
|
|
||||||
|
# Fix linking GPU support, by adding an explicit "target_link_libraries" to ${CMAKE_DL_LIBS}
|
||||||
|
patch("link-dl.patch", when="+gpu")
|
||||||
|
|
||||||
|
requires("%gcc@10:", "%clang@16:", policy="one_of", msg="C++ 20 is required")
|
||||||
|
|
||||||
|
|
||||||
|
class MakefileBuilder(makefile.MakefileBuilder):
|
||||||
build_targets = ["STATIC=true", "VERBOSE=true"]
|
build_targets = ["STATIC=true", "VERBOSE=true"]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def install_targets(self):
|
def install_targets(self):
|
||||||
return [f"PREFIX={self.prefix}", "install"]
|
return [f"PREFIX={self.prefix}", "install"]
|
||||||
|
|
||||||
|
|
||||||
|
class CMakeBuilder(cmake.CMakeBuilder):
|
||||||
|
def cmake_args(self):
|
||||||
|
return [self.define_from_variant("BTOP_GPU", "gpu")]
|
||||||
|
Loading…
Reference in New Issue
Block a user