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