summary refs log tree commit diff
path: root/pkgs/tools/text/patchutils/generic.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/text/patchutils/generic.nix')
-rw-r--r--pkgs/tools/text/patchutils/generic.nix28
1 files changed, 21 insertions, 7 deletions
diff --git a/pkgs/tools/text/patchutils/generic.nix b/pkgs/tools/text/patchutils/generic.nix
index d3e9da242e2..923dd06d182 100644
--- a/pkgs/tools/text/patchutils/generic.nix
+++ b/pkgs/tools/text/patchutils/generic.nix
@@ -1,5 +1,5 @@
-{ lib, stdenv, fetchurl, perl
-, version, sha256, patches ? []
+{ lib, stdenv, fetchurl, perl, makeWrapper
+, version, sha256, patches ? [], extraBuildInputs ? []
 , ...
 }:
 stdenv.mkDerivation rec {
@@ -11,18 +11,32 @@ stdenv.mkDerivation rec {
     inherit sha256;
   };
 
-  buildInputs = [ perl ];
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ perl ] ++ extraBuildInputs;
   hardeningDisable = [ "format" ];
 
-  doCheck = false; # fails
+  postInstall = ''
+    for bin in $out/bin/{splitdiff,rediff,editdiff,dehtmldiff}; do
+      wrapProgram "$bin" \
+        --prefix PATH : "$out/bin"
+    done
+  '';
+
+  doCheck = lib.versionAtLeast version "0.3.4";
+
+  preCheck = ''
+    patchShebangs tests
+    chmod +x scripts/*
+  '' + lib.optionalString (lib.versionOlder version "0.4.2") ''
+    find tests -type f -name 'run-test' \
+      -exec sed -i '{}' -e 's|/bin/echo|echo|g' \;
+  '';
 
   meta = with lib; {
     description = "Tools to manipulate patch files";
     homepage = "http://cyberelk.net/tim/software/patchutils";
     license = licenses.gpl2Plus;
     platforms = platforms.all;
-    executables = [ "combinediff" "dehtmldiff" "editdiff" "espdiff"
-      "filterdiff" "fixcvsdiff" "flipdiff" "grepdiff" "interdiff" "lsdiff"
-      "recountdiff" "rediff" "splitdiff" "unwrapdiff" ];
+    maintainers = with maintainers; [ artturin ];
   };
 }