2016-09-08 09:55:00 +00:00
|
|
|
{ stdenv, fetchurl, coreutils, gawk }:
|
2013-06-06 17:00:04 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2018-03-29 14:49:10 +00:00
|
|
|
name = "txt2man-${version}";
|
|
|
|
version = "1.6.0";
|
2013-06-06 17:00:04 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-03-29 14:49:10 +00:00
|
|
|
url = "https://github.com/mvertes/txt2man/archive/${name}.tar.gz";
|
|
|
|
sha256 = "168cj96974n2z0igin6j1ic1m45zyic7nm5ark7frq8j78rrx4zn";
|
2013-06-06 17:00:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
makeFlags=prefix="$out"
|
|
|
|
'';
|
|
|
|
|
2016-09-08 09:55:00 +00:00
|
|
|
patchPhase = ''
|
|
|
|
for f in bookman src2man txt2man; do
|
|
|
|
substituteInPlace $f --replace "gawk" "${gawk}/bin/gawk"
|
|
|
|
|
|
|
|
substituteInPlace $f --replace "(date" "(${coreutils}/bin/date"
|
|
|
|
substituteInPlace $f --replace "=cat" "=${coreutils}/bin/cat"
|
|
|
|
substituteInPlace $f --replace "cat <<" "${coreutils}/bin/cat <<"
|
|
|
|
substituteInPlace $f --replace "expand" "${coreutils}/bin/expand"
|
|
|
|
substituteInPlace $f --replace "(uname" "(${coreutils}/bin/uname"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
# gawk and coreutils are part of stdenv but will not
|
|
|
|
# necessarily be in PATH at runtime.
|
|
|
|
sh -c 'unset PATH; printf hello | ./txt2man'
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2013-06-06 17:00:04 +00:00
|
|
|
description = "Convert flat ASCII text to man page format";
|
|
|
|
homepage = http://mvertes.free.fr/;
|
|
|
|
license = stdenv.lib.licenses.gpl2;
|
2016-09-08 07:21:05 +00:00
|
|
|
platforms = with stdenv.lib.platforms; linux ++ darwin;
|
2013-06-06 17:00:04 +00:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ bjornfor ];
|
|
|
|
};
|
|
|
|
}
|