nixpkgs/pkgs/tools/text/patchutils/generic.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

46 lines
1.2 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, perl, makeWrapper
, version, sha256, patches ? [], extraBuildInputs ? []
2019-04-13 21:09:44 +00:00
, ...
}:
stdenv.mkDerivation rec {
2019-04-13 21:09:44 +00:00
pname = "patchutils";
inherit version patches;
src = fetchurl {
2019-04-13 21:09:44 +00:00
url = "http://cyberelk.net/tim/data/patchutils/stable/${pname}-${version}.tar.xz";
inherit sha256;
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ perl ] ++ extraBuildInputs;
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;
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;
maintainers = with maintainers; [ artturin ];
};
}