2020-08-30 09:03:01 +00:00
|
|
|
{ lib, fetchFromGitHub, stdenv, autoreconfHook
|
2021-08-18 00:50:44 +00:00
|
|
|
, ncurses
|
|
|
|
, IOKit
|
|
|
|
, sensorsSupport ? stdenv.isLinux, lm_sensors
|
|
|
|
, systemdSupport ? stdenv.isLinux, systemd
|
2020-08-30 09:03:01 +00:00
|
|
|
}:
|
2007-09-02 16:54:08 +00:00
|
|
|
|
2021-08-18 00:50:44 +00:00
|
|
|
with lib;
|
|
|
|
|
|
|
|
assert systemdSupport -> stdenv.isLinux;
|
|
|
|
|
2012-04-04 14:46:17 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "htop";
|
2021-01-19 00:16:59 +00:00
|
|
|
version = "3.0.5";
|
2011-07-08 22:45:28 +00:00
|
|
|
|
2020-08-29 12:34:46 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "htop-dev";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-01-19 00:16:59 +00:00
|
|
|
sha256 = "sha256-9zecDd3oZ24RyOLnKdJmR29Chx6S24Kvuf/F7RYzl4I=";
|
2008-12-11 23:18:46 +00:00
|
|
|
};
|
2011-07-08 22:45:28 +00:00
|
|
|
|
2020-10-01 10:26:56 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
2020-08-30 09:03:01 +00:00
|
|
|
|
2021-08-18 00:50:44 +00:00
|
|
|
buildInputs = [ ncurses ]
|
|
|
|
++ optional stdenv.isDarwin IOKit
|
|
|
|
++ optional sensorsSupport lm_sensors
|
|
|
|
++ optional systemdSupport systemd
|
|
|
|
;
|
|
|
|
|
|
|
|
configureFlags = [ "--enable-unicode" ]
|
|
|
|
++ 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"}
|
|
|
|
'';
|
2015-09-07 00:08:23 +00:00
|
|
|
|
2021-08-18 00:50:44 +00:00
|
|
|
meta = {
|
2008-12-11 23:18:46 +00:00
|
|
|
description = "An interactive process viewer for Linux";
|
2020-10-01 10:26:56 +00:00
|
|
|
homepage = "https://htop.dev";
|
|
|
|
license = licenses.gpl2Only;
|
2021-03-31 22:09:50 +00:00
|
|
|
platforms = platforms.all;
|
2018-01-16 21:59:13 +00:00
|
|
|
maintainers = with maintainers; [ rob relrod ];
|
2021-02-03 13:50:16 +00:00
|
|
|
changelog = "https://github.com/htop-dev/${pname}/blob/${version}/ChangeLog";
|
2008-12-11 23:18:46 +00:00
|
|
|
};
|
2007-09-02 16:54:08 +00:00
|
|
|
}
|