nixpkgs/pkgs/tools/system/btop/default.nix
Alexis Hildebrandt 755b915a15 treewide: Remove indefinite article from meta.description
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"[Aa]n?' pkgs \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Aa]n? (.)/\1\U\2/'
2024-06-09 23:07:45 +02:00

63 lines
1.5 KiB
Nix

{ lib
, config
, stdenv
, fetchFromGitHub
, cmake
, darwin
, removeReferencesTo
, btop
, testers
, autoAddDriverRunpath
, cudaSupport ? config.cudaSupport
, rocmSupport ? config.rocmSupport
, rocmPackages
}:
stdenv.mkDerivation rec {
pname = "btop";
version = "1.3.2";
src = fetchFromGitHub {
owner = "aristocratos";
repo = pname;
rev = "v${version}";
hash = "sha256-kjSyIgLTObTOKMG5dk49XmWPXZpCWbLdpkmAsJcFliA=";
};
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
];
installFlags = [ "PREFIX=$(out)" ];
postInstall = ''
${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;
};
meta = with lib; {
description = "Monitor of resources";
homepage = "https://github.com/aristocratos/btop";
changelog = "https://github.com/aristocratos/btop/blob/v${version}/CHANGELOG.md";
license = licenses.asl20;
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ rmcgibbo ];
mainProgram = "btop";
};
}