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 outputs = [ "out" "man" ];
12
13 makeFlags = "TREE=\$(out) MANTREE=\$(TREE)/share/man";
14
15 preBuild = ''
16 sed -e "s@/bin/mv@$(type -P mv)@" -i replace.h
17 '';
18
19 preInstall = "mkdir -p \$out/share/man";
20 postInstall = "mv \$out/bin/replace \$out/bin/replace-literal";
21
22 patches = [./malloc.patch];
23
24 meta = {
25 homepage = https://replace.richardlloyd.org.uk/;
26 description = "A tool to replace verbatim strings";
27 platforms = stdenv.lib.platforms.unix;
28 };
29}