1{stdenv, fetchurl}:
2
3stdenv.mkDerivation {
4 name = "replace-2.24";
5
6 src = fetchurl {
7 url = ftp://hpux.connect.org.uk/hpux/Users/replace-2.24/replace-2.24-src-11.11.tar.gz;
8 sha256 = "1c2nkxx83vmlh1v3ib6r2xqh121gdb1rharwsimcb2h0xwc558dm";
9 };
10
11 makeFlags = "TREE=\$(out) MANTREE=\$(TREE)/share/man";
12
13 crossAttrs = {
14 makeFlags = "TREE=\$(out) MANTREE=\$(TREE)/share/man CC=${stdenv.cross.config}-gcc";
15 };
16
17 preBuild = ''
18 sed -e "s@/bin/mv@$(type -P mv)@" -i replace.h
19 '';
20
21 preInstall = "mkdir -p \$out/share/man";
22 postInstall = "mv \$out/bin/replace \$out/bin/replace-literal";
23
24 patches = [./malloc.patch];
25
26 meta = {
27 homepage = http://replace.richardlloyd.org.uk/;
28 description = "A tool to replace verbatim strings";
29 };
30}