Friday, November 13, 2020

upcoming textproc/groff-1.23.0

Hi,

Bertrand Garrigues put up a release candidate for the upcoming groff-1.23.0
release. Here is an update of our textproc/groff port NOT INTENDED FOR
COMMIT. Before commit, i will wait for the official release. But i'm
sending this out early such that people who like to can test for
regressions, hoping to still get them fixed before release if we
find any.

Testing is very welcome, and so are opinions on the paradigmatic change
discussed below.

Our groff port has long been focussed on formatting manual pages.
About a decade ago, more than 3000 ports used it for that purpose.
Of these, less than 30 remain because mandoc can now cope with 99%
of ports manual pages.

For that reason, time might be ripe to switch focus of the port:
away from being predominantly a manual page formatter and adapting
it better to general purpose typesetting.

There is another reason why now is a good time to switch priorities.
Upstream has been doing lots of work on documentation, and in that
context, they decided to use newer makeinfo(1) features that our
ancient /usr/bin/makeinfo does not support. The natural consequence
is to make groff depend on the print/texinfo port and use the newer
gmakeinfo(1) version contained in that port to format the groff
documentation. (Yes, the irony that groff does *not* use roff for
its own documentation but instead uses TeX is not lost on me.)

Now, print/texinfo isn't exactly a lean port. Here is its
list of dependencies according to "make full-all-depends":

docbook-dsssl-1.79 metaauto-1.0p4 xz-5.2.5 help2man-1.47.16
autoconf-2.69p3 libb2-0.98.1v0 automake-1.14.1p1 automake-1.15.1
automake-1.16.2 autoconf-2.67p1 libltdl-2.4.2p1 libtool-2.4.2p0
autoconf-2.63p1 gpatch-2.7.6p0 re2c-2.0.3 dvi2tty-5.3.1p0
p5-IPC-Run3-0.048p0 ffcall-1.10p5 libiconv-1.16p0 libunistring-0.9.7
libidn2-2.3.0p0 lzo2-2.10p2 unzip-6.0p13 iso8879-1986p1 yasm-1.3.0p1
ghostscript-fonts-8.11p3 tcl-8.5.19p4 tk-8.5.19p1 t1utils-1.41p0
sqlite2mdoc-0.1.4 sqlite3-3.31.1p0 p5-XML-Parser-2.44p0 xmltoman-0.4
zip-3.0p1 pcre-8.41p2 lunzip-1.11 ijs-0.35p3 libsigsegv-2.12
m4-1.4.18p1 db-4.6.21p7v0 dwz-0.13p0 gettext-runtime-0.21p0
gmake-4.3 lz4-1.9.2p0 libpaper-1.1.28 icu4c-67.1 gdbm-1.18.1p0
ggrep-3.4 zstd-1.4.5p0 bash-5.0.18 gmp-6.2.0 libnettle-3.6 gmp-6.2.0
mpfr-4.0.2.1 gawk-5.1.0 bzip2-1.0.8p0 clisp-2.49p5 libarchive-3.4.3
gtar-1.32p1 libgpg-error-1.39 libgcrypt-1.8.6 lynx-2.8.9rel1p0
zziplib-0.13.62p1 libusb1-1.0.23p2 detex-2.8.1 libtextstyle-0.21p0
gettext-tools-0.21p0 intltool-0.51.0p2 gnugetopt-1.1.6p2 bison-3.3.2p2
png-1.6.37 libffi-3.3 python-3.8.6 py3-setuptools-41.6.0p0v0
py3-tz-2020.1p0 py3-babel-2.8.0p0 py3-six-1.13.0p1 py3-imagesize-1.1.0p2
py3-alabaster-0.7.10p2 py3-pygments-2.5.2p0 py3-docutils-0.12p3
py3-sphinx_rtd_theme-0.2.4p2 py3-setuptools-git-1.2p1 py3-cython-0.29.21
py3-stemmer-1.3.0p5 py3-snowballstemmer-1.2.1p3 py3-MarkupSafe-1.1.1p0
py3-jinja2-2.11.2p1 py3-sphinx-1.4.8p4 py3-markdown-2.6.11p3
py3-cryptodome-3.9.8 py3-beaker-1.10.0p1 py3-mako-1.1.1p0
libxml-2.9.10p2 docbook-4.5p3 libxslt-1.1.34p0 docbook-xsl-1.68.1p7
xmlto-0.0.28p0 giflib-5.1.6 dbus-1.12.20v0 dbus-1.12.20v0
dbus-daemon-launch-helper-1.12.20 python-2.7.18p0
py-setuptools-41.6.0p0v0 py-tz-2020.1p0 py-babel-2.8.0p0
py-six-1.13.0p1 py-imagesize-1.1.0p2 py-alabaster-0.7.10p2
py-pygments-2.5.2p0 py-docutils-0.12p3 py-sphinx_rtd_theme-0.2.4p2
py-setuptools-git-1.2p1 py-cython-0.29.21 py-stemmer-1.3.0p5
py-snowballstemmer-1.2.1p3 py-MarkupSafe-1.1.1p0 py-jinja2-2.11.2p1
py-sphinx-1.4.8p4 libuv-1.30.1 ninja-1.10.1 meson-0.55.3v0
jsoncpp-1.8.4p2 glib2-2.64.6 cairo-1.16.0 gobject-introspection-1.64.1p0
desktop-file-utils-0.26 jbig2dec-0.11 nghttp2-1.41.0p1 curl-7.72.0
rhash-1.4.0 cmake-3.17.2p1v0 jpeg-2.0.5v0 tiff-4.1.0 libwebp-1.1.0
gd-2.3.0p0 lcms2-2.9p0 graphite2-1.3.14 harfbuzz-2.7.2 cmocka-1.1.3
libevent-2.1.11 libunbound-1.12.0 libtasn1-4.16.0 p11-kit-0.23.21
gnutls-3.6.15 libdaemon-0.14p1 avahi-0.8p0 cups-libs-2.3.3
ghostscript-9.07p7 texlive_mktexlsr-2020p0 lcdf-typetools-2.108
texlive_texmf-buildset-2020p0 ps2eps-1.68p0 psutils-2.03p1
texlive_synctex-2020p0 texlive_base-2020p0

So, given that groff needs to depend on all that crap anyway, adding
a few lighter dependencies in addition that are actually useful for
real-world typesetting tasks sounds like a no-brainer. And bingo,
with that, we have a completely new role for the port: No longer a
small thing to be built at the beginning of a bulk and to be used
by most of the rest of the world for USE_GROFF, but a medium-sized
pig now to be built somewhere in the middle, among all those other
fat ports pigs...

Changes in detail, ordered as in the Makefile:

* The X11 libraries are only used by gxditview(1) and xtotroff(1).
Those programs have long been part of the groff package upstream,
but we used to exclude them to keep the port lean.
* Upstream uses the iconv and uchardet libraries in preconv(1),
but we used to exclude them to keep the port lean. They are
less useful on OpenBSD than elsewhere because we do not support
non-UTF-8 character encodings in the first place, but they are
not quite as heavy as gmakeinfo(1) and may come in handy
occasionally when dealing with foreign files.
* The change to MASTER_SITES is temporary and will of course
never get committed.
* I adjusted the order of variables to match the template.
* Adding ghostscript makes a lot of sense because it contains fonts
that people expect when doing real PostScript/PDF typesetting.
Those issues keep causing frequently asked questions on the
groff lists, so i really think we should provide them out of
the box.
* The other three RUN_DEPENDS are less important but may occasionally
come in handy when creating HTML output (netpbm), PDF output
(poppler-utils), or PostScript output (psutils), and the groff
build systems wants them. So why not.
* Texinfo is needed to build the documentation. The alternative
would be to ship groff without documentation and point people to
https://www.gnu.org/software/groff/manual/html_node/ .
But frankly, we don't generally like telling people "get the
manual from the web" in OpenBSD.
* ac_cv_path_mkdir=/bin/mkdir now appears to be the default,
and so does --with-awk=awk .
* ac_cv_prog_MAKEINFO and ac_cv_prog_INSTALL_INFO are needed
because upstream only looks for makeinfo and install-info,
finds our old versions, and those kill the build.
* PAGE=letter avoids random behaviour, which would othervise
depend on whatever the default is for the user doing the build.
* Several patches have been included upstream or are no longer
needed for other reasons.
* The groffer(1) script had such an abysmal code quality and was
so useless in the first place that upstream decided to delete
it without any replacement. Just use groff(1) itself, it isn't
that hard.
* By virtue of the new dependencies, lots of additional documentation
in HTML and PDF format can now be installed.
* The classical -ms tutorial by Larry Kollar was rediscovered
and is now installed to /usr/local/share/doc/groff/ms.ps .
* There are large numbers of additional fonts that weren't available
before because we avoided the ghostscript dependency.

So, here we go:


Index: Makefile
===================================================================
RCS file: /cvs/ports/textproc/groff/Makefile,v
retrieving revision 1.50
diff -u -p -r1.50 Makefile
--- Makefile 21 Oct 2020 21:21:59 -0000 1.50
+++ Makefile 13 Nov 2020 18:31:51 -0000
@@ -1,10 +1,10 @@
# $OpenBSD: Makefile,v 1.50 2020/10/21 21:21:59 jca Exp $

COMMENT = GNU troff typesetter
-VERSION = 1.22.4
+VERSION = 1.23.0
SUBST_VARS = VERSION
-DISTNAME = groff-${VERSION}
-REVISION = 4
+DISTNAME = groff-${VERSION}.rc1
+PKGNAME = groff-${VERSION}

CATEGORIES = textproc
DPB_PROPERTIES = parallel
@@ -15,28 +15,31 @@ MAINTAINER = Ingo Schwarze <schwarze@op
# GPLv3+
PERMIT_PACKAGE = Yes

-WANTLIB = c m ${COMPILER_LIBCXX}
+WANTLIB += ICE SM X11 Xaw Xmu Xt c iconv m uchardet
+WANTLIB += ${COMPILER_LIBCXX}
+
+MASTER_SITES = https://alpha.gnu.org/gnu/groff/

# Groff does not use C++, but merely pre-1995 C with classes.
COMPILER = base-clang base-gcc

-MASTER_SITES = ${MASTER_SITE_GNU:=groff/}
+MODULES = perl
+LIB_DEPENDS = converters/libiconv \
+ textproc/uchardet
+RUN_DEPENDS = graphics/netpbm \
+ print/ghostscript/gnu \
+ print/poppler,-utils \
+ print/psutils
+BUILD_DEPENDS = ${RUN_DEPENDS} \
+ print/texinfo

MAKE_FLAGS += docdir=${PREFIX}/share/doc/groff \
- exampledir=${PREFIX}/share/examples/groff \
- ac_cv_path_mkdir=/bin/mkdir
+ exampledir=${PREFIX}/share/examples/groff

-MODULES = perl
CONFIGURE_STYLE = gnu
-CONFIGURE_ARGS += --with-awk=awk --without-gs \
- --without-libiconv-prefix --without-uchardet \
- --without-urw-fonts-dir --without-x \
- pnmcrop=missing pnmcut=missing pnmtopng=missing \
- pnmtops=missing psselect=missing
-CONFIGURE_ENV += ac_cv_prog_PDFFONTS= \
- ac_cv_prog_PDFIMAGES= \
- ac_cv_prog_PDFINFO= \
- ac_cv_prog_XPMTOPPM=
+CONFIGURE_ENV += ac_cv_prog_MAKEINFO=gmakeinfo \
+ ac_cv_prog_INSTALL_INFO=ginstall-info \
+ PAGE=letter
TEST_TARGET = check

pre-configure:
Index: distinfo
===================================================================
RCS file: /cvs/ports/textproc/groff/distinfo,v
retrieving revision 1.5
diff -u -p -r1.5 distinfo
--- distinfo 24 Dec 2018 10:42:00 -0000 1.5
+++ distinfo 13 Nov 2020 18:31:51 -0000
@@ -1,2 +1,2 @@
-SHA256 (groff-1.22.4.tar.gz) = 5457TLfewxCEkAT6iIR8RHAejRM7XUwTBX2HbButApM=
-SIZE (groff-1.22.4.tar.gz) = 4137480
+SHA256 (groff-1.23.0.rc1.tar.gz) = NGAd/XXSPR6bg7/qDAlJFQKvvelqW3JKE+x3CYrcIFE=
+SIZE (groff-1.23.0.rc1.tar.gz) = 4204813
Index: patches/patch-Makefile_in
===================================================================
RCS file: patches/patch-Makefile_in
diff -N patches/patch-Makefile_in
--- patches/patch-Makefile_in 26 Dec 2018 00:49:22 -0000 1.10
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-$OpenBSD: patch-Makefile_in,v 1.10 2018/12/26 00:49:22 schwarze Exp $
-
-To process the hdtbl example files, eqn(1) is used, so build it first.
-
-Index: Makefile.in
---- Makefile.in.orig
-+++ Makefile.in
-@@ -11545,7 +11545,7 @@ $(hdtblexample_DATA): $(HDTBLSTRIPFILES)
- && sed -e "s|[@]fontdir[@]|$(fontdir)|" \
- -e "s|[@]EGREP[@]|$(EGREP)|" $< >$@
-
--$(HDTBLPROCESSEDEXAMPLEFILES): gnu.eps groff troff pic tbl \
-+$(HDTBLPROCESSEDEXAMPLEFILES): gnu.eps groff troff eqn pic tbl \
- contrib/hdtbl/examples/common.roff
-
- $(HDTBLSTRIPFILES): $(top_srcdir)/tmac/strip.sed
Index: patches/patch-lib_vasnprintf_c
===================================================================
RCS file: patches/patch-lib_vasnprintf_c
diff -N patches/patch-lib_vasnprintf_c
--- patches/patch-lib_vasnprintf_c 21 Oct 2020 21:21:59 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,19 +0,0 @@
-$OpenBSD: patch-lib_vasnprintf_c,v 1.1 2020/10/21 21:21:59 jca Exp $
-
-Don't use printf %n.
-
-Index: lib/vasnprintf.c
---- lib/vasnprintf.c.orig
-+++ lib/vasnprintf.c
-@@ -4871,10 +4871,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
-

No comments:

Post a Comment