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

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

50 lines
1.4 KiB
Nix
Raw Normal View History

{ lib, fetchFromGitHub, stdenv, autoreconfHook
, ncurses
, IOKit
, sensorsSupport ? stdenv.isLinux, lm_sensors
, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd
}:
assert systemdSupport -> stdenv.isLinux;
stdenv.mkDerivation rec {
pname = "htop";
2022-06-06 14:05:50 +00:00
version = "3.2.1";
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=";
};
2020-10-01 10:26:56 +00:00
nativeBuildInputs = [ autoreconfHook ];
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-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"
;
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";
};
}