nixpkgs/pkgs/tools/misc/autorevision/default.nix
Bjørn Forsman 8dd90abc17 autorevision: use sed word delimiters for better precision
Fixes wrongly replaced 'cat' in help text:

$ autorevision -h
usage: autorevision {-t output-type | -s symbol} [-o cache-file [-f] ] [-e name] [-U] [-V]
	Options include:
	-t output-type		= specify output type
	-s symbol		= specify symbol output
	-o cache-file		= specify cache file lo/nix/store/1rzzq2wdn5vfgbp5y9613jpdkf8i9ag6-coreutils-8.26/bin/cation
...

(Also replace all occurences per line, in case that should occur.)
2017-02-07 17:12:25 +01:00

37 lines
1.1 KiB
Nix

{ stdenv, fetchurl, asciidoc, libxml2, docbook_xml_dtd_45, libxslt
, docbook_xsl, diffutils, coreutils, gnugrep, gnused
}:
stdenv.mkDerivation rec {
name = "autorevision-${version}";
version = "1.20";
src = fetchurl {
url = "https://github.com/Autorevision/autorevision/releases/download/v%2F${version}/autorevision-${version}.tgz";
sha256 = "1xlp7wn2vv17rp848ai272sifi6fmwdr6dg4im53hrf32j3gzlhy";
};
buildInputs = [
asciidoc libxml2 docbook_xml_dtd_45 libxslt docbook_xsl
];
installFlags = [ "prefix=$(out)" ];
postInstall = ''
sed -e "s|\<cmp\>|${diffutils}/bin/cmp|g" \
-e "s|\<cat\>|${coreutils}/bin/cat|g" \
-e "s|\<grep\>|${gnugrep}/bin/grep|g" \
-e "s|\<sed\>|${gnused}/bin/sed|g" \
-e "s|\<tee\>|${coreutils}/bin/tee|g" \
-i "$out/bin/autorevision"
'';
meta = with stdenv.lib; {
description = "Extracts revision metadata from your VCS repository";
homepage = https://autorevision.github.io/;
license = licenses.mit;
platforms = platforms.all;
maintainers = [ maintainers.bjornfor ];
};
}