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

53 lines
1.3 KiB
Nix
Raw Normal View History

{ lib, fetchFromGitHub, stdenv, autoreconfHook
, ncurses
, IOKit
, sensorsSupport ? stdenv.isLinux, lm_sensors
, systemdSupport ? stdenv.isLinux, systemd
}:
with lib;
assert systemdSupport -> stdenv.isLinux;
stdenv.mkDerivation rec {
pname = "htop";
2021-09-22 23:40:03 +00:00
version = "3.1.0";
2020-08-29 12:34:46 +00:00
src = fetchFromGitHub {
owner = "htop-dev";
repo = pname;
rev = version;
2021-09-22 23:40:03 +00:00
sha256 = "sha256-/48Ca7JPzhPS4eYsPbwbSVcx9aS1f0LHcqsbNVWL+9k=";
};
2020-10-01 10:26:56 +00:00
nativeBuildInputs = [ autoreconfHook ];
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"}
'';
meta = {
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;
maintainers = with maintainers; [ rob relrod ];
2021-02-03 13:50:16 +00:00
changelog = "https://github.com/htop-dev/${pname}/blob/${version}/ChangeLog";
};
}