diff --git a/pkgs/tools/system/btop/default.nix b/pkgs/tools/system/btop/default.nix index f49f77f6e22c..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.hostPlatform.isDarwin [ - darwin.apple_sdk_11_0.frameworks.CoreFoundation - darwin.apple_sdk_11_0.frameworks.IOKit + 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";