btop: add v1.3.0, added GPU variant (#42139)

This commit is contained in:
Massimiliano Culpo 2024-01-19 10:11:56 +01:00 committed by GitHub
parent 549ab690a8
commit 75e96b856e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 30 additions and 2 deletions

View 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)

View file

@ -2,10 +2,11 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.build_systems import cmake, makefile
from spack.package import *
class Btop(MakefilePackage):
class Btop(MakefilePackage, CMakePackage):
"""Resource monitor that shows usage and stats for processor,
memory, disks, network and processes.
"""
@ -17,12 +18,27 @@ class Btop(MakefilePackage):
license("Apache-2.0")
version("1.3.0", sha256="375e078ce2091969f0cd14030620bd1a94987451cf7a73859127a786006a32cf")
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"]
@property
def install_targets(self):
return [f"PREFIX={self.prefix}", "install"]
class CMakeBuilder(cmake.CMakeBuilder):
def cmake_args(self):
return [self.define_from_variant("BTOP_GPU", "gpu")]