1{ lib, stdenv, fetchurl }:
2
3stdenv.mkDerivation rec {
4 pname = "pstree";
5 version = "2.39";
6
7 src = fetchurl {
8 urls = [
9 "https://distfiles.macports.org/${pname}/${pname}-${version}.tar.gz"
10 "https://fossies.org/linux/misc/${pname}-${version}.tar.gz"
11 "ftp://ftp.thp.uni-duisburg.de/pub/source/${pname}-${version}.tar.gz"
12 ];
13 sha256 = "17s7v15c4gryjpi11y1xq75022nkg4ggzvjlq2dkmyg67ssc76vw";
14 };
15
16 sourceRoot = ".";
17 buildPhase = ''
18 runHook preBuild
19 $CC $NIX_CFLAGS -o pstree pstree.c
20 runHook postBuild
21 '';
22
23 installPhase = ''
24 runHook preInstall
25 install -Dm0555 ${pname} -t $out/bin
26 install -Dm0444 ${pname}.1 -t $out/share/man/man1
27 runHook postInstall
28 '';
29
30 meta = with lib; {
31 description = "Show the set of running processes as a tree";
32 homepage = "http://www.thp.uni-duisburg.de/pstree/";
33 license = licenses.gpl2;
34 maintainers = [ maintainers.c0bw3b ];
35 platforms = platforms.unix;
36 priority = 5; # Lower than psmisc also providing pstree on Linux platforms
37 };
38}