about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/system/btop/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/system/btop/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/system/btop/default.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/nixpkgs/pkgs/tools/system/btop/default.nix b/nixpkgs/pkgs/tools/system/btop/default.nix
index 9b6956fb5780..ba5f01b843bb 100644
--- a/nixpkgs/pkgs/tools/system/btop/default.nix
+++ b/nixpkgs/pkgs/tools/system/btop/default.nix
@@ -9,6 +9,8 @@
 , testers
 , cudaSupport ? config.cudaSupport
 , cudaPackages
+, rocmSupport ? config.rocmSupport
+, rocmPackages
 }:
 
 stdenv.mkDerivation rec {
@@ -23,7 +25,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ cmake ] ++ lib.optionals cudaSupport [
-    cudaPackages.autoAddOpenGLRunpathHook
+    cudaPackages.autoAddDriverRunpath
   ];
 
   buildInputs = lib.optionals stdenv.isDarwin [
@@ -37,6 +39,11 @@ stdenv.mkDerivation rec {
     ${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc.cc} $(readlink -f $out/bin/btop)
   '';
 
+  postPhases = lib.optionals rocmSupport [ "postPatchelf" ];
+  postPatchelf = lib.optionalString rocmSupport ''
+    patchelf --add-rpath ${lib.getLib rocmPackages.rocm-smi}/lib $out/bin/btop
+  '';
+
   passthru.tests.version = testers.testVersion {
     package = btop;
   };