mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-11-03 19:31:34 +00:00
67 lines
1.3 KiB
Nix
67 lines
1.3 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchurl,
|
|
perl,
|
|
bashNonInteractive,
|
|
makeWrapper,
|
|
version,
|
|
sha256,
|
|
patches ? [ ],
|
|
extraBuildInputs ? [ ],
|
|
...
|
|
}:
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "patchutils";
|
|
inherit version patches;
|
|
|
|
src = fetchurl {
|
|
url = "https://cyberelk.net/tim/data/patchutils/stable/patchutils-${finalAttrs.version}.tar.xz";
|
|
inherit sha256;
|
|
};
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
buildInputs = [
|
|
perl
|
|
bashNonInteractive
|
|
]
|
|
++ extraBuildInputs;
|
|
hardeningDisable = [ "format" ];
|
|
|
|
preConfigure = ''
|
|
export PERL=${perl.interpreter}
|
|
'';
|
|
|
|
postInstall = ''
|
|
for bin in $out/bin/*; do
|
|
if [[ ! -h "$bin" ]]; then
|
|
wrapProgram "$bin" \
|
|
--prefix PATH : "$out/bin"
|
|
fi
|
|
done
|
|
'';
|
|
|
|
doCheck = lib.versionAtLeast finalAttrs.version "0.3.4";
|
|
|
|
preCheck = ''
|
|
patchShebangs tests
|
|
chmod +x scripts/*
|
|
''
|
|
+ lib.optionalString (lib.versionOlder finalAttrs.version "0.4.2") ''
|
|
find tests -type f -name 'run-test' \
|
|
-exec sed -i '{}' -e 's|/bin/echo|echo|g' \;
|
|
'';
|
|
|
|
strictDeps = true;
|
|
|
|
__structuredAttrs = true;
|
|
|
|
meta = {
|
|
description = "Tools to manipulate patch files";
|
|
homepage = "http://cyberelk.net/tim/software/patchutils";
|
|
license = lib.licenses.gpl2Plus;
|
|
platforms = lib.platforms.all;
|
|
maintainers = with lib.maintainers; [ artturin ];
|
|
};
|
|
})
|