2021-09-19 16:57:42 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, coreutils, gawk }:
|
2013-06-06 17:00:04 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "txt2man";
|
2020-07-02 21:05:21 +00:00
|
|
|
version = "1.7.1";
|
2013-06-06 17:00:04 +00:00
|
|
|
|
2021-09-19 16:57:42 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mvertes";
|
|
|
|
repo = "txt2man";
|
2024-08-21 00:23:37 +00:00
|
|
|
rev = "txt2man-${version}";
|
2021-09-19 16:57:42 +00:00
|
|
|
hash = "sha256-Aqi5PNNaaM/tr9A/7vKeafYKYIs/kHbwHzE7+R/9r9s=";
|
2013-06-06 17:00:04 +00:00
|
|
|
};
|
|
|
|
|
2021-10-12 18:00:46 +00:00
|
|
|
makeFlags = [
|
|
|
|
"prefix=${placeholder "out"}"
|
|
|
|
];
|
2013-06-06 17:00:04 +00:00
|
|
|
|
2021-10-12 18:00:46 +00:00
|
|
|
postPatch = ''
|
2016-09-08 09:55:00 +00:00
|
|
|
for f in bookman src2man txt2man; do
|
2021-10-12 18:00:46 +00:00
|
|
|
substituteInPlace $f \
|
|
|
|
--replace "gawk" "${gawk}/bin/gawk" \
|
|
|
|
--replace "(date" "(${coreutils}/bin/date" \
|
|
|
|
--replace "=cat" "=${coreutils}/bin/cat" \
|
|
|
|
--replace "cat <<" "${coreutils}/bin/cat <<" \
|
|
|
|
--replace "expand" "${coreutils}/bin/expand" \
|
|
|
|
--replace "(uname" "(${coreutils}/bin/uname"
|
2016-09-08 09:55:00 +00:00
|
|
|
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'
|
|
|
|
'';
|
|
|
|
|
2021-10-12 18:00:46 +00:00
|
|
|
meta = with lib; {
|
2013-06-06 17:00:04 +00:00
|
|
|
description = "Convert flat ASCII text to man page format";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://mvertes.free.fr/";
|
2024-04-26 11:35:31 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2021-10-12 18:00:46 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ bjornfor ];
|
2013-06-06 17:00:04 +00:00
|
|
|
};
|
|
|
|
}
|