nixpkgs/pkgs/tools/system/htop/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

60 lines
1.7 KiB
Nix
Raw Normal View History

2023-01-22 16:38:06 +00:00
{ lib, fetchFromGitHub, stdenv, autoreconfHook, pkg-config
, ncurses
, IOKit
2023-01-22 16:38:06 +00:00
, libcap
, libnl
, sensorsSupport ? stdenv.isLinux, lm_sensors
, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd
}:
assert systemdSupport -> stdenv.isLinux;
stdenv.mkDerivation rec {
pname = "htop";
2023-02-09 06:33:52 +00:00
version = "3.2.2";
2020-08-29 12:34:46 +00:00
src = fetchFromGitHub {
owner = "htop-dev";
repo = pname;
rev = version;
2023-02-09 06:33:52 +00:00
sha256 = "sha256-OrlNE1A71q4XAauYNfumV1Ev1wBpFIBxPiw7aF++yjM=";
};
2023-01-22 16:38:06 +00:00
nativeBuildInputs = [ autoreconfHook ]
++ lib.optional stdenv.isLinux pkg-config
;
buildInputs = [ ncurses ]
2022-05-02 10:01:30 +00:00
++ lib.optional stdenv.isDarwin IOKit
2023-01-22 16:38:06 +00:00
++ lib.optionals stdenv.isLinux [ libcap libnl ]
2022-05-02 10:01:30 +00:00
++ lib.optional sensorsSupport lm_sensors
++ lib.optional systemdSupport systemd
;
2021-10-05 04:02:57 +00:00
configureFlags = [ "--enable-unicode" "--sysconfdir=/etc" ]
2023-01-22 16:38:06 +00:00
++ lib.optionals stdenv.isLinux [
"--enable-affinity"
"--enable-capabilities"
"--enable-delayacct"
]
2022-05-02 10:01:30 +00:00
++ lib.optional sensorsSupport "--with-sensors"
;
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) ''
${optionalPatch sensorsSupport "${lm_sensors}/lib/libsensors.so"}
${optionalPatch systemdSupport "${systemd}/lib/libsystemd.so"}
'';
2022-05-02 10:01:30 +00:00
meta = with lib; {
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;
maintainers = with maintainers; [ rob relrod SuperSandro2000 ];
changelog = "https://github.com/htop-dev/htop/blob/${version}/ChangeLog";
};
}