1{ lib
2, stdenv
3, fetchFromGitLab
4, autoconf
5, automake
6, gettext
7, ncurses
8}:
9
10stdenv.mkDerivation rec {
11 pname = "psmisc";
12 version = "23.6";
13
14 src = fetchFromGitLab {
15 owner = pname;
16 repo = pname;
17 rev = "v${version}";
18 hash = "sha256-TjnOn8a7HAgt11zcM0i5DM5ERmsvLJHvo1e5FOsl6IA=";
19 };
20
21 nativeBuildInputs = [ autoconf automake gettext ];
22 buildInputs = [ ncurses ];
23
24 preConfigure = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
25 # Goes past the rpl_malloc linking failure
26 export ac_cv_func_malloc_0_nonnull=yes
27 export ac_cv_func_realloc_0_nonnull=yes
28 '' + ''
29 echo $version > .tarball-version
30 ./autogen.sh
31 '';
32
33 meta = with lib; {
34 homepage = "https://gitlab.com/psmisc/psmisc";
35 description = "A set of small useful utilities that use the proc filesystem (such as fuser, killall and pstree)";
36 platforms = platforms.linux;
37 license = licenses.gpl2Plus;
38 maintainers = with maintainers; [ ryantm ];
39 };
40}