about summary refs log tree commit diff
path: root/pkgs/applications/misc/pstree
diff options
context:
space:
mode:
authorc0bw3b <c0bw3b@users.noreply.github.com>2019-05-20 21:54:22 +0200
committerc0bw3b <c0bw3b@users.noreply.github.com>2019-05-20 22:01:03 +0200
commit6c82bfb725d2d2c6e5137829cf33c2d79e360ff5 (patch)
treec65a8ecd99e6b1e066a3e449df26758f07c67d87 /pkgs/applications/misc/pstree
parent3a2ccb570dedd7eb17226c01078b981a5129c7ea (diff)
pstree: refresh sources
Previous first URL was gone ;
+ refactor
+ enhance meta (homepage, license, maintainer)
+ define priority wrt psmisc
Diffstat (limited to 'pkgs/applications/misc/pstree')
-rw-r--r--pkgs/applications/misc/pstree/default.nix33
1 files changed, 23 insertions, 10 deletions
diff --git a/pkgs/applications/misc/pstree/default.nix b/pkgs/applications/misc/pstree/default.nix
index 3cd52af6d3218..7aaa8a8c38d20 100644
--- a/pkgs/applications/misc/pstree/default.nix
+++ b/pkgs/applications/misc/pstree/default.nix
@@ -1,25 +1,38 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "pstree-2.39";
+  pname = "pstree";
+  version = "2.39";
 
   src = fetchurl {
     urls = [
-      "http://www.sfr-fresh.com/unix/misc/${name}.tar.gz"
-      "https://distfiles.macports.org/pstree/${name}.tar.gz"
+      "https://distfiles.macports.org/${pname}/${pname}-${version}.tar.gz"
+      "https://fossies.org/linux/misc/${pname}-${version}.tar.gz"
+      "ftp://ftp.thp.uni-duisburg.de/pub/source/${pname}-${version}.tar.gz"
     ];
     sha256 = "17s7v15c4gryjpi11y1xq75022nkg4ggzvjlq2dkmyg67ssc76vw";
   };
 
-  unpackPhase = "unpackFile \$src; sourceRoot=.";
+  sourceRoot = ".";
+  buildPhase = ''
+    runHook preBuild
+    $CC $NIX_CFLAGS -o pstree pstree.c
+    runHook postBuild
+  '';
 
-  buildPhase = "pwd; $CC -o pstree pstree.c";
-  installPhase = "mkdir -p \$out/bin; cp pstree \$out/bin";
+  installPhase = ''
+    runHook preInstall
+    install -Dm0555 ${pname} -t $out/bin
+    install -Dm0444 ${pname}.1 -t $out/share/man/man1
+    runHook postInstall
+  '';
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "Show the set of running processes as a tree";
-    license = "GPL";
-    maintainers = [ ];
-    platforms = stdenv.lib.platforms.unix;
+    homepage = "http://www.thp.uni-duisburg.de/pstree/";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.c0bw3b ];
+    platforms = platforms.unix;
+    priority = 5; # Lower than psmisc also providing pstree on Linux platforms
   };
 }