2021-10-25 12:13:22 +02:00
|
|
|
{ lib, stdenv, fetchurl, perl, makeWrapper
|
|
|
|
, version, sha256, patches ? [], extraBuildInputs ? []
|
2019-04-13 23:09:44 +02:00
|
|
|
, ...
|
|
|
|
}:
|
2014-05-08 14:59:42 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2019-04-13 23:09:44 +02:00
|
|
|
pname = "patchutils";
|
|
|
|
inherit version patches;
|
2008-07-19 01:36:28 +02:00
|
|
|
|
2010-07-28 13:55:54 +02:00
|
|
|
src = fetchurl {
|
2019-04-13 23:09:44 +02:00
|
|
|
url = "http://cyberelk.net/tim/data/patchutils/stable/${pname}-${version}.tar.xz";
|
|
|
|
inherit sha256;
|
2008-07-19 01:36:28 +02:00
|
|
|
};
|
|
|
|
|
2021-10-25 12:13:22 +02:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ perl ] ++ extraBuildInputs;
|
2016-02-26 18:38:15 +01:00
|
|
|
hardeningDisable = [ "format" ];
|
2016-02-07 16:07:42 +01:00
|
|
|
|
2021-10-25 12:13:22 +02:00
|
|
|
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' \;
|
|
|
|
'';
|
2018-04-25 05:20:18 +02:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2010-07-28 13:55:54 +02:00
|
|
|
description = "Tools to manipulate patch files";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://cyberelk.net/tim/software/patchutils";
|
2014-05-17 07:27:29 +02:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.all;
|
2021-10-25 12:13:22 +02:00
|
|
|
maintainers = with maintainers; [ artturin ];
|
2008-07-19 01:36:28 +02:00
|
|
|
};
|
|
|
|
}
|