@@ -1,5 +1,5 @@
1−{ lib, stdenv, fetchurl, perl
2−, version, sha256, patches ? []
1+{ lib, stdenv, fetchurl, perl, makeWrapper
2+, version, sha256, patches ? [], extraBuildInputs ? []
33, ...
44}:
55stdenv.mkDerivation rec {
@@ -11,18 +11,32 @@ stdenv.mkDerivation rec {
1111 inherit sha256;
1212 };
1313
14− buildInputs = [ perl ];
14+ nativeBuildInputs = [ makeWrapper ];
15+ buildInputs = [ perl ] ++ extraBuildInputs;
1516 hardeningDisable = [ "format" ];
1617
17− doCheck = false; # fails
18+ postInstall = ''
19+ for bin in $out/bin/{splitdiff,rediff,editdiff,dehtmldiff}; do
20+ wrapProgram "$bin" \
21+ --prefix PATH : "$out/bin"
22+ done
23+ '';
24+
25+ doCheck = lib.versionAtLeast version "0.3.4";
26+
27+ preCheck = ''
28+ patchShebangs tests
29+ chmod +x scripts/*
30+ '' + lib.optionalString (lib.versionOlder version "0.4.2") ''
31+ find tests -type f -name 'run-test' \
32+ -exec sed -i '{}' -e 's|/bin/echo|echo|g' \;
33+ '';
1834
1935 meta = with lib; {
2036 description = "Tools to manipulate patch files";
2137 homepage = "http://cyberelk.net/tim/software/patchutils";
2238 license = licenses.gpl2Plus;
2339 platforms = platforms.all;
24− executables = [ "combinediff" "dehtmldiff" "editdiff" "espdiff"
25− "filterdiff" "fixcvsdiff" "flipdiff" "grepdiff" "interdiff" "lsdiff"
26− "recountdiff" "rediff" "splitdiff" "unwrapdiff" ];
40+ maintainers = with maintainers; [ artturin ];
2741 };
2842}