2021-09-23 15:35:13 +00:00
|
|
|
{ lib
|
2024-01-25 14:12:00 +00:00
|
|
|
, config
|
2021-09-23 15:35:13 +00:00
|
|
|
, stdenv
|
2021-10-17 09:34:42 +00:00
|
|
|
, fetchFromGitHub
|
2024-01-25 14:12:00 +00:00
|
|
|
, cmake
|
2022-01-03 16:56:52 +00:00
|
|
|
, darwin
|
|
|
|
, removeReferencesTo
|
2023-10-09 19:29:22 +00:00
|
|
|
, btop
|
|
|
|
, testers
|
2024-01-25 14:12:00 +00:00
|
|
|
, cudaSupport ? config.cudaSupport
|
|
|
|
, cudaPackages
|
2021-09-23 15:35:13 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "btop";
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "1.3.0";
|
2021-09-23 15:35:13 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "aristocratos";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-01-25 14:12:00 +00:00
|
|
|
hash = "sha256-QQM2/LO/EHovhj+S+4x3ro/aOVrtuxteVVvYAd6feTk=";
|
2021-09-23 15:35:13 +00:00
|
|
|
};
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
nativeBuildInputs = [ cmake ] ++ lib.optionals cudaSupport [
|
|
|
|
cudaPackages.autoAddOpenGLRunpathHook
|
|
|
|
];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
|
|
|
darwin.apple_sdk_11_0.frameworks.CoreFoundation
|
|
|
|
darwin.apple_sdk_11_0.frameworks.IOKit
|
|
|
|
];
|
2022-01-03 16:56:52 +00:00
|
|
|
|
2021-09-23 15:35:13 +00:00
|
|
|
installFlags = [ "PREFIX=$(out)" ];
|
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
postInstall = ''
|
|
|
|
${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc.cc} $(readlink -f $out/bin/btop)
|
|
|
|
'';
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = btop;
|
|
|
|
};
|
|
|
|
|
2021-09-23 15:35:13 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A monitor of resources";
|
|
|
|
homepage = "https://github.com/aristocratos/btop";
|
2021-10-17 09:34:42 +00:00
|
|
|
changelog = "https://github.com/aristocratos/btop/blob/v${version}/CHANGELOG.md";
|
2021-09-23 15:35:13 +00:00
|
|
|
license = licenses.asl20;
|
2022-01-03 16:56:52 +00:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2021-09-23 15:35:13 +00:00
|
|
|
maintainers = with maintainers; [ rmcgibbo ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "btop";
|
2021-09-23 15:35:13 +00:00
|
|
|
};
|
|
|
|
}
|