about summary refs log tree commit diff
path: root/pkgs/tools/system/btop/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/system/btop/default.nix')
-rw-r--r--pkgs/tools/system/btop/default.nix56
1 files changed, 31 insertions, 25 deletions
diff --git a/pkgs/tools/system/btop/default.nix b/pkgs/tools/system/btop/default.nix
index 66745ccf86a8..2a50e5933d3a 100644
--- a/pkgs/tools/system/btop/default.nix
+++ b/pkgs/tools/system/btop/default.nix
@@ -1,16 +1,17 @@
-{ lib
-, config
-, stdenv
-, fetchFromGitHub
-, cmake
-, darwin
-, removeReferencesTo
-, btop
-, testers
-, autoAddDriverRunpath
-, cudaSupport ? config.cudaSupport
-, rocmSupport ? config.rocmSupport
-, rocmPackages
+{
+  lib,
+  config,
+  stdenv,
+  fetchFromGitHub,
+  cmake,
+  removeReferencesTo,
+  autoAddDriverRunpath,
+  apple-sdk_15,
+  darwinMinVersionHook,
+  versionCheckHook,
+  rocmPackages,
+  cudaSupport ? config.cudaSupport,
+  rocmSupport ? config.rocmSupport,
 }:
 
 stdenv.mkDerivation rec {
@@ -24,15 +25,17 @@ stdenv.mkDerivation rec {
     hash = "sha256-A5hOBxj8tKlkHd8zDHfDoU6fIu8gDpt3/usbiDk0/G0=";
   };
 
-  nativeBuildInputs = [
-    cmake
-  ] ++ lib.optionals cudaSupport [
-    autoAddDriverRunpath
-  ];
+  nativeBuildInputs =
+    [
+      cmake
+    ]
+    ++ lib.optionals cudaSupport [
+      autoAddDriverRunpath
+    ];
 
-  buildInputs = lib.optionals stdenv.isDarwin [
-    darwin.apple_sdk_11_0.frameworks.CoreFoundation
-    darwin.apple_sdk_11_0.frameworks.IOKit
+  buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
+    apple-sdk_15
+    (darwinMinVersionHook "10.15")
   ];
 
   installFlags = [ "PREFIX=$(out)" ];
@@ -46,9 +49,9 @@ stdenv.mkDerivation rec {
     patchelf --add-rpath ${lib.getLib rocmPackages.rocm-smi}/lib $out/bin/btop
   '';
 
-  passthru.tests.version = testers.testVersion {
-    package = btop;
-  };
+  nativeInstallCheckInputs = [ versionCheckHook ];
+  versionCheckProgramArg = "--version";
+  doInstallCheck = true;
 
   meta = with lib; {
     description = "Monitor of resources";
@@ -56,7 +59,10 @@ stdenv.mkDerivation rec {
     changelog = "https://github.com/aristocratos/btop/blob/v${version}/CHANGELOG.md";
     license = licenses.asl20;
     platforms = platforms.linux ++ platforms.darwin;
-    maintainers = with maintainers; [ rmcgibbo ];
+    maintainers = with maintainers; [
+      khaneliman
+      rmcgibbo
+    ];
     mainProgram = "btop";
   };
 }