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
|
|
|
with lib;
|
|
|
|
|
|
|
|
assert systemdSupport -> stdenv.isLinux;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "htop";
|
2021-12-19 01:06:50 +00:00
|
|
|
version = "3.1.2";
|
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;
|
2021-12-19 01:06:50 +00:00
|
|
|
sha256 = "sha256-RKYS8UYZTVKMR/3DG31eqkG4knPRl8WXsZU/XGmGmAg=";
|
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 ]
|
|
|
|
++ optional stdenv.isDarwin IOKit
|
|
|
|
++ optional sensorsSupport lm_sensors
|
|
|
|
++ optional systemdSupport systemd
|
|
|
|
;
|
|
|
|
|
2021-10-06 13:57:05 +00:00
|
|
|
configureFlags = [ "--enable-unicode" "--sysconfdir=/etc" ]
|
2021-08-22 07:53:02 +00:00
|
|
|
++ optional sensorsSupport "--with-sensors"
|
|
|
|
;
|
|
|
|
|
|
|
|
postFixup =
|
|
|
|
let
|
|
|
|
optionalPatch = pred: so: optionalString pred "patchelf --add-needed ${so} $out/bin/htop";
|
|
|
|
in
|
|
|
|
''
|
|
|
|
${optionalPatch sensorsSupport "${lm_sensors}/lib/libsensors.so"}
|
|
|
|
${optionalPatch systemdSupport "${systemd}/lib/libsystemd.so"}
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
meta = {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "An interactive process viewer for Linux";
|
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;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ rob relrod ];
|
2021-04-05 15:23:46 +00:00
|
|
|
changelog = "https://github.com/htop-dev/${pname}/blob/${version}/ChangeLog";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|