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
|
2022-09-21 07:04:52 +00:00
|
|
|
, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd, 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
|
|
|
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";
|
2022-06-06 14:05:50 +00:00
|
|
|
version = "3.2.1";
|
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;
|
2022-06-06 14:05:50 +00:00
|
|
|
sha256 = "sha256-MwtsvdPHcUdegsYj9NGyded5XJQxXri1IM1j4gef1Xk=";
|
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 ]
|
2022-05-02 10:01:30 +00:00
|
|
|
++ lib.optional stdenv.isDarwin IOKit
|
|
|
|
++ lib.optional sensorsSupport lm_sensors
|
|
|
|
++ lib.optional systemdSupport systemd
|
2021-08-18 00:50:44 +00:00
|
|
|
;
|
|
|
|
|
2021-10-05 04:02:57 +00:00
|
|
|
configureFlags = [ "--enable-unicode" "--sysconfdir=/etc" ]
|
2022-05-02 10:01:30 +00:00
|
|
|
++ lib.optional sensorsSupport "--with-sensors"
|
2021-08-18 00:50:44 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
postFixup =
|
|
|
|
let
|
2022-05-02 10:01:30 +00:00
|
|
|
optionalPatch = pred: so: lib.optionalString pred "patchelf --add-needed ${so} $out/bin/htop";
|
2022-11-20 21:57:09 +00:00
|
|
|
in lib.optionalString (!stdenv.hostPlatform.isStatic) ''
|
2021-08-18 00:50:44 +00:00
|
|
|
${optionalPatch sensorsSupport "${lm_sensors}/lib/libsensors.so"}
|
|
|
|
${optionalPatch systemdSupport "${systemd}/lib/libsystemd.so"}
|
|
|
|
'';
|
2015-09-07 00:08:23 +00:00
|
|
|
|
2022-05-02 10:01:30 +00:00
|
|
|
meta = with lib; {
|
2022-05-02 20:43:07 +00:00
|
|
|
description = "An interactive process viewer";
|
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;
|
2022-05-02 10:02:09 +00:00
|
|
|
maintainers = with maintainers; [ rob relrod SuperSandro2000 ];
|
2022-05-02 10:01:54 +00:00
|
|
|
changelog = "https://github.com/htop-dev/htop/blob/${version}/ChangeLog";
|
2008-12-11 23:18:46 +00:00
|
|
|
};
|
2007-09-02 16:54:08 +00:00
|
|
|
}
|