nixpkgs/pkgs/tools/system/btop/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

63 lines
1.5 KiB
Nix
Raw Normal View History

2021-09-22 22:24:12 +01:00
{ lib
2024-01-24 13:12:20 +00:00
, config
2021-09-22 22:24:12 +01:00
, stdenv
2021-10-19 21:09:17 +01:00
, fetchFromGitHub
, cmake
2021-12-24 07:04:49 +00:00
, darwin
2021-12-31 17:09:07 +00:00
, removeReferencesTo
2023-09-18 20:58:14 +01:00
, btop
, testers
2024-03-30 18:13:23 +00:00
, autoAddDriverRunpath
2024-01-24 13:12:20 +00:00
, cudaSupport ? config.cudaSupport
2024-03-16 17:37:21 +00:00
, rocmSupport ? config.rocmSupport
, rocmPackages
2021-09-22 22:24:12 +01:00
}:
stdenv.mkDerivation rec {
pname = "btop";
version = "1.3.2";
2021-09-22 22:24:12 +01:00
src = fetchFromGitHub {
owner = "aristocratos";
repo = pname;
rev = "v${version}";
hash = "sha256-kjSyIgLTObTOKMG5dk49XmWPXZpCWbLdpkmAsJcFliA=";
2021-09-22 22:24:12 +01:00
};
2024-03-30 18:13:23 +00:00
nativeBuildInputs = [
cmake
] ++ lib.optionals cudaSupport [
autoAddDriverRunpath
2024-01-24 13:12:20 +00:00
];
2023-07-10 12:50:26 +01:00
buildInputs = lib.optionals stdenv.isDarwin [
darwin.apple_sdk_11_0.frameworks.CoreFoundation
darwin.apple_sdk_11_0.frameworks.IOKit
];
2021-12-24 07:04:49 +00:00
2021-09-22 22:24:12 +01:00
installFlags = [ "PREFIX=$(out)" ];
2021-12-31 17:09:07 +00:00
postInstall = ''
${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc.cc} $(readlink -f $out/bin/btop)
'';
2024-03-16 17:37:21 +00:00
postPhases = lib.optionals rocmSupport [ "postPatchelf" ];
postPatchelf = lib.optionalString rocmSupport ''
patchelf --add-rpath ${lib.getLib rocmPackages.rocm-smi}/lib $out/bin/btop
'';
2023-09-18 20:58:14 +01:00
passthru.tests.version = testers.testVersion {
package = btop;
};
2021-09-22 22:24:12 +01:00
meta = with lib; {
description = "A monitor of resources";
homepage = "https://github.com/aristocratos/btop";
2021-10-19 21:09:17 +01:00
changelog = "https://github.com/aristocratos/btop/blob/v${version}/CHANGELOG.md";
2021-09-22 22:24:12 +01:00
license = licenses.asl20;
2021-12-24 07:04:49 +00:00
platforms = platforms.linux ++ platforms.darwin;
2021-09-22 22:24:12 +01:00
maintainers = with maintainers; [ rmcgibbo ];
2023-11-27 01:17:53 +00:00
mainProgram = "btop";
2021-09-22 22:24:12 +01:00
};
}