2018-07-21 02:44:44 +02:00
|
|
|
{ stdenv, fetchurl, perl
|
2016-09-12 17:26:28 +02:00
|
|
|
, ghostscript #for postscript and html output
|
|
|
|
, psutils, netpbm #for html output
|
2017-04-24 02:01:56 +02:00
|
|
|
, buildPackages
|
2017-12-10 06:17:26 +01:00
|
|
|
, autoreconfHook
|
2019-10-06 07:01:29 +02:00
|
|
|
, pkgconfig
|
|
|
|
, texinfo
|
2016-09-12 17:26:28 +02:00
|
|
|
}:
|
2009-01-11 00:35:15 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "groff";
|
2019-10-06 07:01:29 +02:00
|
|
|
version = "1.22.4";
|
2005-08-21 15:59:04 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 14:41:18 +02:00
|
|
|
url = "mirror://gnu/groff/${pname}-${version}.tar.gz";
|
2019-10-06 07:01:29 +02:00
|
|
|
sha256 = "14q2mldnr1vx0l9lqp9v2f6iww24gj28iyh4j2211hyynx67p3p7";
|
2009-01-11 00:35:15 +01:00
|
|
|
};
|
|
|
|
|
2017-07-11 16:54:40 +02:00
|
|
|
outputs = [ "out" "man" "doc" "info" "perl" ];
|
2015-07-26 13:58:19 +02:00
|
|
|
|
2015-05-13 13:47:41 +02:00
|
|
|
enableParallelBuilding = false;
|
|
|
|
|
2019-11-09 04:00:35 +01:00
|
|
|
patches = [
|
|
|
|
./0001-Fix-cross-compilation-by-looking-for-ar.patch
|
|
|
|
];
|
|
|
|
|
2016-09-12 17:26:28 +02:00
|
|
|
postPatch = stdenv.lib.optionalString (psutils != null) ''
|
|
|
|
substituteInPlace src/preproc/html/pre-html.cpp \
|
|
|
|
--replace "psselect" "${psutils}/bin/psselect"
|
|
|
|
'' + stdenv.lib.optionalString (netpbm != null) ''
|
|
|
|
substituteInPlace src/preproc/html/pre-html.cpp \
|
2020-02-26 00:41:09 +01:00
|
|
|
--replace "pnmcut" "${stdenv.lib.getBin netpbm}/bin/pnmcut" \
|
|
|
|
--replace "pnmcrop" "${stdenv.lib.getBin netpbm}/bin/pnmcrop" \
|
|
|
|
--replace "pnmtopng" "${stdenv.lib.getBin netpbm}/bin/pnmtopng"
|
2016-09-12 17:26:28 +02:00
|
|
|
substituteInPlace tmac/www.tmac \
|
2020-02-26 00:41:09 +01:00
|
|
|
--replace "pnmcrop" "${stdenv.lib.getBin netpbm}/bin/pnmcrop" \
|
|
|
|
--replace "pngtopnm" "${stdenv.lib.getBin netpbm}/bin/pngtopnm" \
|
|
|
|
--replace "@PNMTOPS_NOSETPAGE@" "${stdenv.lib.getBin netpbm}/bin/pnmtops -nosetpage"
|
2016-09-12 17:26:28 +02:00
|
|
|
'';
|
|
|
|
|
2017-07-11 16:54:40 +02:00
|
|
|
buildInputs = [ ghostscript psutils netpbm perl ];
|
2019-10-06 07:01:29 +02:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkgconfig texinfo ];
|
2009-01-11 00:35:15 +01:00
|
|
|
|
2013-06-11 11:55:52 +02:00
|
|
|
# Builds running without a chroot environment may detect the presence
|
|
|
|
# of /usr/X11 in the host system, leading to an impure build of the
|
|
|
|
# package. To avoid this issue, X11 support is explicitly disabled.
|
|
|
|
# Note: If we ever want to *enable* X11 support, then we'll probably
|
|
|
|
# have to pass "--with-appresdir", too.
|
2016-09-12 17:26:28 +02:00
|
|
|
configureFlags = [
|
|
|
|
"--without-x"
|
|
|
|
] ++ stdenv.lib.optionals (ghostscript != null) [
|
|
|
|
"--with-gs=${ghostscript}/bin/gs"
|
2017-12-10 06:17:26 +01:00
|
|
|
] ++ stdenv.lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
|
2018-03-01 15:11:07 +01:00
|
|
|
"ac_cv_path_PERL=${buildPackages.perl}/bin/perl"
|
2016-09-12 17:26:28 +02:00
|
|
|
];
|
2013-06-11 11:55:52 +02:00
|
|
|
|
2018-05-10 19:46:38 +02:00
|
|
|
makeFlags = stdenv.lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
|
2010-08-21 18:54:24 +02:00
|
|
|
# Trick to get the build system find the proper 'native' groff
|
|
|
|
# http://www.mail-archive.com/bug-groff@gnu.org/msg01335.html
|
2018-05-10 19:46:38 +02:00
|
|
|
"GROFF_BIN_PATH=${buildPackages.groff}/bin"
|
|
|
|
"GROFFBIN=${buildPackages.groff}/bin/groff"
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = true;
|
2010-08-21 18:54:24 +02:00
|
|
|
|
2014-04-09 15:09:06 +02:00
|
|
|
postInstall = ''
|
2017-07-02 03:50:44 +02:00
|
|
|
for f in 'man.local' 'mdoc.local'; do
|
|
|
|
cat '${./site.tmac}' >>"$out/share/groff/site-tmac/$f"
|
|
|
|
done
|
2017-07-11 16:54:40 +02:00
|
|
|
|
|
|
|
moveToOutput bin/gropdf $perl
|
|
|
|
moveToOutput bin/pdfmom $perl
|
|
|
|
moveToOutput bin/roff2text $perl
|
|
|
|
moveToOutput bin/roff2pdf $perl
|
|
|
|
moveToOutput bin/roff2ps $perl
|
|
|
|
moveToOutput bin/roff2dvi $perl
|
|
|
|
moveToOutput bin/roff2ps $perl
|
|
|
|
moveToOutput bin/roff2html $perl
|
|
|
|
moveToOutput bin/glilypond $perl
|
|
|
|
moveToOutput bin/mmroff $perl
|
|
|
|
moveToOutput bin/roff2x $perl
|
|
|
|
moveToOutput bin/afmtodit $perl
|
|
|
|
moveToOutput bin/gperl $perl
|
|
|
|
moveToOutput bin/chem $perl
|
|
|
|
moveToOutput share/groff/${version}/font/devpdf $perl
|
|
|
|
|
|
|
|
# idk if this is needed, but Fedora does it
|
|
|
|
moveToOutput share/groff/${version}/tmac/pdf.tmac $perl
|
|
|
|
|
|
|
|
moveToOutput bin/gpinyin $perl
|
|
|
|
moveToOutput lib/groff/gpinyin $perl
|
|
|
|
substituteInPlace $perl/bin/gpinyin \
|
|
|
|
--replace $out/lib/groff/gpinyin $perl/lib/groff/gpinyin
|
|
|
|
|
|
|
|
moveToOutput bin/groffer $perl
|
|
|
|
moveToOutput lib/groff/groffer $perl
|
|
|
|
substituteInPlace $perl/bin/groffer \
|
|
|
|
--replace $out/lib/groff/groffer $perl/lib/groff/groffer
|
|
|
|
|
|
|
|
moveToOutput bin/grog $perl
|
|
|
|
moveToOutput lib/groff/grog $perl
|
|
|
|
substituteInPlace $perl/bin/grog \
|
|
|
|
--replace $out/lib/groff/grog $perl/lib/groff/grog
|
|
|
|
|
2018-03-01 15:11:07 +01:00
|
|
|
'' + stdenv.lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
|
|
|
|
find $perl/ -type f -print0 | xargs --null sed -i 's|${buildPackages.perl}|${perl}|'
|
2016-04-20 20:36:26 +02:00
|
|
|
'';
|
2014-04-09 15:09:06 +02:00
|
|
|
|
2014-11-19 08:46:19 +01:00
|
|
|
meta = with stdenv.lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://www.gnu.org/software/groff/";
|
2009-01-11 00:35:15 +01:00
|
|
|
description = "GNU Troff, a typesetting package that reads plain text and produces formatted output";
|
2014-11-19 08:46:19 +01:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ pSub ];
|
2009-01-11 00:35:15 +01:00
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
groff is the GNU implementation of troff, a document formatting
|
|
|
|
system. Included in this release are implementations of troff,
|
|
|
|
pic, eqn, tbl, grn, refer, -man, -mdoc, -mom, and -ms macros,
|
|
|
|
and drivers for PostScript, TeX dvi format, HP LaserJet 4
|
|
|
|
printers, Canon CAPSL printers, HTML and XHTML format (beta
|
|
|
|
status), and typewriter-like devices. Also included is a
|
|
|
|
modified version of the Berkeley -me macros, the enhanced
|
|
|
|
version gxditview of the X11 xditview previewer, and an
|
|
|
|
implementation of the -mm macros.
|
|
|
|
'';
|
2017-07-11 16:54:40 +02:00
|
|
|
|
|
|
|
outputsToInstall = [ "out" "perl" ];
|
2005-08-21 15:59:04 +02:00
|
|
|
};
|
|
|
|
}
|