diff --git a/pkgs/tools/misc/txt2man/default.nix b/pkgs/tools/misc/txt2man/default.nix index 3c894611f692..29bd3235dfb9 100644 --- a/pkgs/tools/misc/txt2man/default.nix +++ b/pkgs/tools/misc/txt2man/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl }: +{ stdenv, fetchurl, coreutils, gawk }: stdenv.mkDerivation rec { name = "txt2man-1.5.6"; @@ -12,7 +12,27 @@ stdenv.mkDerivation rec { makeFlags=prefix="$out" ''; - meta = { + 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 = { description = "Convert flat ASCII text to man page format"; homepage = http://mvertes.free.fr/; license = stdenv.lib.licenses.gpl2;