depot/third_party/nixpkgs/pkgs/tools/text/replace/default.nix
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

29 lines
739 B
Nix

{ stdenv, fetchurl }:
stdenv.mkDerivation {
name = "replace-2.24";
src = fetchurl {
url = "ftp://hpux.connect.org.uk/hpux/Users/replace-2.24/replace-2.24-src-11.11.tar.gz";
sha256 = "1c2nkxx83vmlh1v3ib6r2xqh121gdb1rharwsimcb2h0xwc558dm";
};
outputs = [ "out" "man" ];
makeFlags = [ "TREE=\$(out)" "MANTREE=\$(TREE)/share/man" ];
preBuild = ''
sed -e "s@/bin/mv@$(type -P mv)@" -i replace.h
'';
preInstall = "mkdir -p \$out/share/man";
postInstall = "mv \$out/bin/replace \$out/bin/replace-literal";
patches = [./malloc.patch];
meta = {
homepage = "https://replace.richardlloyd.org.uk/";
description = "A tool to replace verbatim strings";
platforms = stdenv.lib.platforms.unix;
};
}