Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 stdenv, 4 fetchurl, 5}: 6 7stdenv.mkDerivation rec { 8 pname = "replace"; 9 version = "2.24"; 10 11 src = fetchurl { 12 url = "http://hpux.connect.org.uk/ftp/hpux/Users/replace-${version}/replace-${version}-src-11.31.tar.gz"; 13 sha256 = "18hkwhaz25s6209n5mpx9hmkyznlzygqj488p2l7nvp9zrlxb9sf"; 14 }; 15 16 outputs = [ 17 "out" 18 "man" 19 ]; 20 21 makeFlags = [ 22 "TREE=\$(out)" 23 "MANTREE=\$(TREE)/share/man" 24 "CC=${stdenv.cc.targetPrefix}cc" 25 ]; 26 27 preBuild = '' 28 sed -e "s@/bin/mv@$(type -P mv)@" -i replace.h 29 ''; 30 31 preInstall = "mkdir -p \$out/share/man"; 32 postInstall = "mv \$out/bin/replace \$out/bin/replace-literal"; 33 34 patches = [ ./malloc.patch ]; 35 36 meta = { 37 description = "Tool to replace verbatim strings"; 38 homepage = "https://replace.richardlloyd.org.uk/"; 39 mainProgram = "replace-literal"; 40 platforms = lib.platforms.unix; 41 }; 42}