2016-09-08 10:55:00 +01:00
|
|
|
{ stdenv, fetchurl, coreutils, gawk }:
|
2013-06-06 18:00:04 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "txt2man";
|
2020-06-09 04:53:02 +01:00
|
|
|
version = "1.7.0";
|
2013-06-06 18:00:04 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 13:41:18 +01:00
|
|
|
url = "https://github.com/mvertes/txt2man/archive/${pname}-${version}.tar.gz";
|
2020-06-09 04:53:02 +01:00
|
|
|
sha256 = "06jf8hqav095db1v3njavx0rphmpmi3mgki4va6qkxjnvmdx4742";
|
2013-06-06 18:00:04 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
makeFlags=prefix="$out"
|
|
|
|
'';
|
|
|
|
|
2016-09-08 10:55:00 +01: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 18:00:04 +01:00
|
|
|
description = "Convert flat ASCII text to man page format";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://mvertes.free.fr/";
|
2013-06-06 18:00:04 +01:00
|
|
|
license = stdenv.lib.licenses.gpl2;
|
2016-09-08 08:21:05 +01:00
|
|
|
platforms = with stdenv.lib.platforms; linux ++ darwin;
|
2013-06-06 18:00:04 +01:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ bjornfor ];
|
|
|
|
};
|
|
|
|
}
|