2023-01-22 16:38:06 +00:00
|
|
|
{ lib, fetchFromGitHub, stdenv, autoreconfHook, pkg-config
|
2021-08-18 01:50:44 +01:00
|
|
|
, ncurses
|
|
|
|
, IOKit
|
2023-01-22 16:38:06 +00:00
|
|
|
, libcap
|
|
|
|
, libnl
|
2021-08-18 01:50:44 +01:00
|
|
|
, sensorsSupport ? stdenv.isLinux, lm_sensors
|
2022-09-21 08:04:52 +01:00
|
|
|
, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd
|
2020-08-30 10:03:01 +01:00
|
|
|
}:
|
2007-09-02 17:54:08 +01:00
|
|
|
|
2021-08-18 01:50:44 +01:00
|
|
|
assert systemdSupport -> stdenv.isLinux;
|
|
|
|
|
2012-04-04 15:46:17 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "htop";
|
2024-01-10 10:58:47 +00:00
|
|
|
version = "3.3.0";
|
2011-07-08 23:45:28 +01:00
|
|
|
|
2020-08-29 13:34:46 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "htop-dev";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2024-01-10 10:58:47 +00:00
|
|
|
hash = "sha256-qDhQkzY2zj2yxbgFUXwE0MGEgAFOsAhnapUuetO9WTw=";
|
2008-12-11 23:18:46 +00:00
|
|
|
};
|
2011-07-08 23:45:28 +01:00
|
|
|
|
2023-01-22 16:38:06 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook ]
|
|
|
|
++ lib.optional stdenv.isLinux pkg-config
|
|
|
|
;
|
2020-08-30 10:03:01 +01:00
|
|
|
|
2021-08-18 01:50:44 +01:00
|
|
|
buildInputs = [ ncurses ]
|
2022-05-02 11:01:30 +01:00
|
|
|
++ lib.optional stdenv.isDarwin IOKit
|
2023-01-22 16:38:06 +00:00
|
|
|
++ lib.optionals stdenv.isLinux [ libcap libnl ]
|
2022-05-02 11:01:30 +01:00
|
|
|
++ lib.optional sensorsSupport lm_sensors
|
|
|
|
++ lib.optional systemdSupport systemd
|
2021-08-18 01:50:44 +01:00
|
|
|
;
|
|
|
|
|
2021-10-05 05:02:57 +01:00
|
|
|
configureFlags = [ "--enable-unicode" "--sysconfdir=/etc" ]
|
2023-01-22 16:38:06 +00:00
|
|
|
++ lib.optionals stdenv.isLinux [
|
|
|
|
"--enable-affinity"
|
|
|
|
"--enable-capabilities"
|
|
|
|
"--enable-delayacct"
|
|
|
|
]
|
2023-08-31 21:40:13 +01:00
|
|
|
++ lib.optional sensorsSupport "--enable-sensors"
|
2021-08-18 01:50:44 +01:00
|
|
|
;
|
|
|
|
|
|
|
|
postFixup =
|
|
|
|
let
|
2022-05-02 11:01:30 +01: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 01:50:44 +01:00
|
|
|
${optionalPatch sensorsSupport "${lm_sensors}/lib/libsensors.so"}
|
|
|
|
${optionalPatch systemdSupport "${systemd}/lib/libsystemd.so"}
|
|
|
|
'';
|
2015-09-07 01:08:23 +01:00
|
|
|
|
2022-05-02 11:01:30 +01:00
|
|
|
meta = with lib; {
|
2022-05-02 21:43:07 +01:00
|
|
|
description = "An interactive process viewer";
|
2020-10-01 11:26:56 +01:00
|
|
|
homepage = "https://htop.dev";
|
|
|
|
license = licenses.gpl2Only;
|
2021-03-31 23:09:50 +01:00
|
|
|
platforms = platforms.all;
|
2022-05-02 11:02:09 +01:00
|
|
|
maintainers = with maintainers; [ rob relrod SuperSandro2000 ];
|
2022-05-02 11:01:54 +01:00
|
|
|
changelog = "https://github.com/htop-dev/htop/blob/${version}/ChangeLog";
|
2023-07-31 20:49:41 +01:00
|
|
|
mainProgram = "htop";
|
2008-12-11 23:18:46 +00:00
|
|
|
};
|
2007-09-02 17:54:08 +01:00
|
|
|
}
|