2016-09-12 16:26:28 +01:00
|
|
|
{ stdenv, fetchurl, perl, groff
|
|
|
|
, ghostscript #for postscript and html output
|
|
|
|
, psutils, netpbm #for html output
|
|
|
|
}:
|
2009-01-10 23:35:15 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2014-11-19 07:46:19 +00:00
|
|
|
name = "groff-1.22.3";
|
2005-08-21 14:59:04 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2009-01-10 23:35:15 +00:00
|
|
|
url = "mirror://gnu/groff/${name}.tar.gz";
|
2014-11-19 07:46:19 +00:00
|
|
|
sha256 = "1998v2kcs288d3y7kfxpvl369nqi06zbbvjzafyvyl3pr7bajj1s";
|
2009-01-10 23:35:15 +00:00
|
|
|
};
|
|
|
|
|
2015-07-26 12:58:19 +01:00
|
|
|
outputs = [ "out" "doc" ];
|
|
|
|
|
2015-05-13 12:47:41 +01:00
|
|
|
enableParallelBuilding = false;
|
|
|
|
|
2016-09-12 16:26:28 +01: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 \
|
|
|
|
--replace "pnmcut" "${netpbm}/bin/pnmcut" \
|
|
|
|
--replace "pnmcrop" "${netpbm}/bin/pnmcrop" \
|
|
|
|
--replace "pnmtopng" "${netpbm}/bin/pnmtopng"
|
|
|
|
substituteInPlace tmac/www.tmac \
|
|
|
|
--replace "pnmcrop" "${netpbm}/bin/pnmcrop" \
|
|
|
|
--replace "pngtopnm" "${netpbm}/bin/pngtopnm" \
|
|
|
|
--replace "@PNMTOPS_NOSETPAGE@" "${netpbm}/bin/pnmtops -nosetpage"
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [ ghostscript psutils netpbm ];
|
2012-12-28 18:20:09 +00:00
|
|
|
nativeBuildInputs = [ perl ];
|
2009-01-10 23:35:15 +00:00
|
|
|
|
2013-06-11 10:55:52 +01: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 16:26:28 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--without-x"
|
|
|
|
] ++ stdenv.lib.optionals (ghostscript != null) [
|
|
|
|
"--with-gs=${ghostscript}/bin/gs"
|
|
|
|
];
|
2013-06-11 10:55:52 +01:00
|
|
|
|
2009-01-10 23:35:15 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2010-08-21 17:54:24 +01:00
|
|
|
crossAttrs = {
|
|
|
|
# Trick to get the build system find the proper 'native' groff
|
|
|
|
# http://www.mail-archive.com/bug-groff@gnu.org/msg01335.html
|
|
|
|
preBuild = ''
|
|
|
|
makeFlags="GROFF_BIN_PATH=${groff}/bin GROFFBIN=${groff}/bin/groff"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2016-04-20 19:36:26 +01:00
|
|
|
# Remove example output with (random?) colors and creation date
|
|
|
|
# to avoid non-determinism in the output.
|
2014-04-09 14:09:06 +01:00
|
|
|
postInstall = ''
|
2016-04-20 19:36:26 +01:00
|
|
|
rm $doc/share/doc/groff/examples/hdtbl/*color*ps
|
|
|
|
find $doc/share/doc/groff/ -type f -print0 | xargs -0 sed -i -e 's/%%CreationDate: .*//'
|
|
|
|
'';
|
2014-04-09 14:09:06 +01:00
|
|
|
|
2014-11-19 07:46:19 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = http://www.gnu.org/software/groff/;
|
2009-01-10 23:35:15 +00:00
|
|
|
description = "GNU Troff, a typesetting package that reads plain text and produces formatted output";
|
2014-11-19 07:46:19 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ pSub ];
|
2009-01-10 23:35:15 +00: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.
|
|
|
|
'';
|
2005-08-21 14:59:04 +01:00
|
|
|
};
|
|
|
|
}
|