2021-09-23 15:35:13 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2021-10-17 09:34:42 +00:00
|
|
|
, fetchFromGitHub
|
2022-01-03 16:56:52 +00:00
|
|
|
, darwin
|
|
|
|
, removeReferencesTo
|
2023-10-09 19:29:22 +00:00
|
|
|
, btop
|
|
|
|
, testers
|
2021-09-23 15:35:13 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "btop";
|
2022-11-21 17:40:18 +00:00
|
|
|
version = "1.2.13";
|
2021-09-23 15:35:13 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "aristocratos";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-11-21 17:40:18 +00:00
|
|
|
hash = "sha256-F/muCjhcnM+VqAn6FlD4lv23OLITrmtnHkFc5zv97yk=";
|
2021-09-23 15:35:13 +00:00
|
|
|
};
|
|
|
|
|
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
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
env.ADDFLAGS = lib.optionalString stdenv.isDarwin
|
|
|
|
"-F${darwin.apple_sdk_11_0.frameworks.IOKit}/Library/Frameworks/";
|
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 ];
|
|
|
|
};
|
|
|
|
}
|