about summary refs log tree commit diff
path: root/pkgs/tools/misc/crudini
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2017-07-26 13:00:18 +0800
committerPeter Hoeg <peter@hoeg.com>2017-07-26 13:00:29 +0800
commit998a0e818e6279f9e3916097c633fad8eb946465 (patch)
tree6d9392f966aff8bf772a413ffaff0f9ccf5cadb7 /pkgs/tools/misc/crudini
parentcadb42fafb40175896279122e80d4196a06f6601 (diff)
downloadnixlib-998a0e818e6279f9e3916097c633fad8eb946465.tar
nixlib-998a0e818e6279f9e3916097c633fad8eb946465.tar.gz
nixlib-998a0e818e6279f9e3916097c633fad8eb946465.tar.bz2
nixlib-998a0e818e6279f9e3916097c633fad8eb946465.tar.lz
nixlib-998a0e818e6279f9e3916097c633fad8eb946465.tar.xz
nixlib-998a0e818e6279f9e3916097c633fad8eb946465.tar.zst
nixlib-998a0e818e6279f9e3916097c633fad8eb946465.zip
crudini: actually run tests and install docs/man
Diffstat (limited to 'pkgs/tools/misc/crudini')
-rw-r--r--pkgs/tools/misc/crudini/default.nix24
1 files changed, 22 insertions, 2 deletions
diff --git a/pkgs/tools/misc/crudini/default.nix b/pkgs/tools/misc/crudini/default.nix
index 856138f046ae..7ca103062c11 100644
--- a/pkgs/tools/misc/crudini/default.nix
+++ b/pkgs/tools/misc/crudini/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, python2Packages }:
+{ stdenv, fetchFromGitHub, python2Packages, help2man }:
 
 python2Packages.buildPythonApplication rec {
   name = "crudini-${version}";
@@ -11,10 +11,30 @@ python2Packages.buildPythonApplication rec {
     sha256 = "0x9z9lsygripj88gadag398pc9zky23m16wmh8vbgw7ld1nhkiav";
   };
 
+  nativeBuildInputs = [ help2man ];
   propagatedBuildInputs = with python2Packages; [ iniparse ];
 
-  checkPhase = ''
+  doCheck = true;
+
+  prePatch = ''
+    # make runs the unpatched version in src so we need to patch them in addition to tests
     patchShebangs .
+  '';
+
+  postBuild = ''
+    make all
+  '';
+
+  postInstall = ''
+    mkdir -p $out/share/{man/man1,doc/crudini}
+
+    cp README EXAMPLES $out/share/doc/crudini/
+    for f in *.1 ; do
+      gzip -c $f > $out/share/man/man1/$(basename $f).gz
+    done
+  '';
+
+  checkPhase = ''
     pushd tests >/dev/null
     ./test.sh
   '';