2021-10-28 06:52:43 +00:00
|
|
|
{ lib, stdenv, fetchurl, perl, makeWrapper
|
|
|
|
, version, sha256, patches ? [], extraBuildInputs ? []
|
2020-04-24 23:36:52 +00:00
|
|
|
, ...
|
|
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "patchutils";
|
|
|
|
inherit version patches;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://cyberelk.net/tim/data/patchutils/stable/${pname}-${version}.tar.xz";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ perl ] ++ extraBuildInputs;
|
2020-04-24 23:36:52 +00:00
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
# tests fail when building in parallel
|
|
|
|
enableParallelBuilding = false;
|
|
|
|
|
2021-10-28 06:52:43 +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' \;
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Tools to manipulate patch files";
|
|
|
|
homepage = "http://cyberelk.net/tim/software/patchutils";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.all;
|
2021-10-28 06:52:43 +00:00
|
|
|
maintainers = with maintainers; [ artturin ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|