2020-09-25 04:45:31 +00:00
|
|
|
{ lib, fetchFromGitHub, stdenv, autoreconfHook
|
2021-08-22 07:53:02 +00:00
|
|
|
, ncurses
|
|
|
|
, IOKit
|
|
|
|
, sensorsSupport ? stdenv.isLinux, lm_sensors
|
|
|
|
, systemdSupport ? stdenv.isLinux, systemd
|
2020-09-25 04:45:31 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
assert systemdSupport -> stdenv.isLinux;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "htop";
|
2022-06-16 17:23:12 +00:00
|
|
|
version = "3.2.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "htop-dev";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-06-16 17:23:12 +00:00
|
|
|
sha256 = "sha256-MwtsvdPHcUdegsYj9NGyded5XJQxXri1IM1j4gef1Xk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-10-07 09:15:18 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
buildInputs = [ ncurses ]
|
2022-04-27 09:35:20 +00:00
|
|
|
++ lib.optional stdenv.isDarwin IOKit
|
|
|
|
++ lib.optional sensorsSupport lm_sensors
|
|
|
|
++ lib.optional systemdSupport systemd
|
2021-08-22 07:53:02 +00:00
|
|
|
;
|
|
|
|
|
2021-10-06 13:57:05 +00:00
|
|
|
configureFlags = [ "--enable-unicode" "--sysconfdir=/etc" ]
|
2022-04-27 09:35:20 +00:00
|
|
|
++ lib.optional sensorsSupport "--with-sensors"
|
2021-08-22 07:53:02 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
postFixup =
|
|
|
|
let
|
2022-04-27 09:35:20 +00:00
|
|
|
optionalPatch = pred: so: lib.optionalString pred "patchelf --add-needed ${so} $out/bin/htop";
|
2021-08-22 07:53:02 +00:00
|
|
|
in
|
|
|
|
''
|
|
|
|
${optionalPatch sensorsSupport "${lm_sensors}/lib/libsensors.so"}
|
|
|
|
${optionalPatch systemdSupport "${systemd}/lib/libsystemd.so"}
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "An interactive process viewer";
|
2020-10-07 09:15:18 +00:00
|
|
|
homepage = "https://htop.dev";
|
|
|
|
license = licenses.gpl2Only;
|
2021-04-05 15:23:46 +00:00
|
|
|
platforms = platforms.all;
|
2022-04-27 09:35:20 +00:00
|
|
|
maintainers = with maintainers; [ rob relrod SuperSandro2000 ];
|
|
|
|
changelog = "https://github.com/htop-dev/htop/blob/${version}/ChangeLog";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|