blob: 0cbe1246481e5dcc2e4b6998ad282347f3aa1fca (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
{
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 ];
};
})
|