gbranden pushed a commit to branch master
in repository groff.
commit dc4e0f1803d00b4006350d28fe4b7ab991a5b743
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Jul 2 13:01:09 2026 -0500
[doc]: Add gnu printing press image to Texinfo.
* doc/groff.texi.in (Output Language Compatibility): On supported output
formats, inline the "gnu with printing press" image as an end mark for
this manual's main matter. Doing so demands much build system
foolery, in part because different output formats demand different
image formats.
* doc/doc.am: Define new macro `DOC_GNU_PNG` storing path to relevant
image in PNG format. Override definition of `TEXINPUTS` macro so that
etex can locate the EPS file when generating DVI. Ship `DOC_GNU_PNG`
in our distribution archive.
(install_doc_gnu_png): New target rule installs `DOC_GNU_PNG` file so
that installed example files can access it.
(install_doc_examples): Depend on `DOC_GNU_PNG`.
(uninstall_doc_examples): Remove "gnu.png" file from example
directory.
($(GROFF_DVI)): Add dependency on `DOC_GNU_EPS`, since we're now
embedding it in our Texinfo manual.
($(GROFF_PDF)): Add dependency on `DOC_GNU_PNG`, since we're now
embedding it in our Texinfo manual.
($(GROFF_HTML)): Override Automake's definition of target with one
that copies the "gnu.png" file where the HTML versions of our Texinfo
manual can find it.
(maintainer-clean-local): Remove "gnu.png" from the build directory.
(install-html-local): Install the "gnu.png" file.
($(DOC_GNU_PNG)): New target rule generates "gnu.png" from "gnu.xpm".
Tricky stuff when you're dealing with 6 possible configurations:
* maintainer-mode (repo) vs. distribution archive builds
* in- vs. out-of-source tree (VPATH) builds
* GNU vs. BSD make
---
ChangeLog | 29 +++++++++++++++++++++++++++
doc/doc.am | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++----
doc/groff.texi.in | 6 ++++++
3 files changed, 91 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 7cc2aba61..83f43888a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2026-07-02 G. Branden Robinson <[email protected]>
+
+ * doc/groff.texi.in (Output Language Compatibility): On
+ supported output formats, inline the "gnu with printing press"
+ image as an end mark for this manual's main matter. Doing so
+ demands much build system foolery, in part because different
+ output formats demand different image formats.
+ * doc/doc.am: Define new macro `DOC_GNU_PNG` storing path to
+ relevant image in PNG format. Override definition of
+ `TEXINPUTS` macro so that etex can locate the EPS file when
+ generating DVI. Ship `DOC_GNU_PNG` in our distribution archive.
+ (install_doc_gnu_png): New target rule installs `DOC_GNU_PNG`
+ file so that installed example files can access it.
+ (install_doc_examples): Depend on `DOC_GNU_PNG`.
+ (uninstall_doc_examples): Remove "gnu.png" file from example
+ directory.
+ ($(GROFF_DVI)): Add dependency on `DOC_GNU_EPS`, since we're now
+ embedding it in our Texinfo manual.
+ ($(GROFF_PDF)): Add dependency on `DOC_GNU_PNG`, since we're now
+ embedding it in our Texinfo manual.
+ ($(GROFF_HTML)): Override Automake's definition of target with
+ one that copies the "gnu.png" file where the HTML versions of
+ our Texinfo manual can find it.
+ (maintainer-clean-local): Remove "gnu.png" from the build
+ directory.
+ (install-html-local): Install the "gnu.png" file.
+ ($(DOC_GNU_PNG)): New target rule generates "gnu.png" from
+ "gnu.xpm".
+
2026-07-02 G. Branden Robinson <[email protected]>
* doc/doc.am: Use `GROFF_HTML` macro more aggressively.
diff --git a/doc/doc.am b/doc/doc.am
index a76d5c2a0..fc520ba9a 100644
--- a/doc/doc.am
+++ b/doc/doc.am
@@ -61,6 +61,7 @@ DOC_PDFMOM = \
# This image file is used by several documents in the groff source tree.
DOC_GNU_EPS = doc/gnu.eps
+DOC_GNU_PNG = doc/gnu.png
DOC_GMP_COVER_PAGE = doc/groff-man-pages-cover.groff
# Other doc, installed in $(docdir)
@@ -481,7 +482,8 @@ if USE_GROHTML
$(DESTDIR)$(htmldocdir)/$(imagedir)
endif # USE_GROHTML
-install-data-hook: install_doc_gnu_eps install_doc_examples
+install-data-hook: \
+ install_doc_gnu_eps install_doc_gnu_png install_doc_examples
install_doc_gnu_eps: $(DOC_GNU_EPS)
for d in $(doc_builddir) $(doc_srcdir); do \
@@ -493,7 +495,17 @@ install_doc_gnu_eps: $(DOC_GNU_EPS)
fi; \
done
-install_doc_examples: $(DOC_GNU_EPS)
+install_doc_gnu_png: $(DOC_GNU_PNG)
+ for d in $(doc_builddir) $(doc_srcdir); do \
+ if test -f "$$d/gnu.png"; then \
+ $(RM) $(DESTDIR)$(exampledir)/gnu.png; \
+ $(INSTALL_DATA) \
+ $$d/gnu.png $(DESTDIR)$(exampledir)/gnu.png; \
+ break; \
+ fi; \
+ done
+
+install_doc_examples: $(DOC_GNU_EPS) $(DOC_GNU_PNG)
if USE_GROHTML
cd $(doc_builddir) \
&& for f in `ls $(HTMLEXAMPLEFILESALL)`; do \
@@ -512,6 +524,7 @@ uninstall-hook: \
uninstall_doc_examples uninstall_doc_htmldoc
uninstall_doc_examples:
$(RM) $(DESTDIR)$(exampledir)/gnu.eps
+ $(RM) $(DESTDIR)$(exampledir)/gnu.png
if USE_GROHTML
-test -d $(DESTDIR)$(docexamplesdir) \
&& cd $(DESTDIR)$(docexamplesdir) \
@@ -576,6 +589,27 @@ endif # USE_TEX
$(GROFF_DVI): $(DOC_GNU_EPS)
$(GROFF_PDF): $(DOC_GNU_PNG)
+# pdfTeX can find resources in a VPATH build when generating PDF (with
+# pdfetex), but not when generating DVI (with etex). Steer the latter's
+# nose to the correct place.
+TEXINPUTS="$(doc_srcdir)$(PATH_SEPARATOR)$$TEXINPUTS"
+
+# We also have to override Automake's built-in rule for generation of
+# HTML from Texinfo to include our embedded images.
+$(GROFF_HTML): doc/groff.texi $(DOC_GNU_PNG)
+ $(AM_V_GEN)$(MKDIR_P) `dirname $@` \
+ && LANG=C LC_ALL=C $(MAKEINFO) --html \
+ -I $(doc_builddir) -I $(doc_srcdir) \
+ -o $(GROFF_HTML).node $< \
+ && if test -f "$(srcdir)/$(DOC_GNU_PNG)"; then \
+ cp -f "$(srcdir)/$(DOC_GNU_PNG)" $(GROFF_HTML).node; \
+ else \
+ cp "$(builddir)/$(DOC_GNU_PNG)" $(GROFF_HTML).node; \
+ fi \
+ && LANG=C LC_ALL=C $(MAKEINFO) --html \
+ -I $(doc_builddir) -I $(doc_srcdir) \
+ --no-split -o $@ $<
+
all: $(GROFF_INFO) $(GROFF_TXT) $(GROFF_HTML) $(GROFF_DVI) $(GROFF_PDF)
# Distribute the manual in source form as well.
@@ -683,6 +717,7 @@ install-doc: install-dvi install-html install-pdf
maintainer-clean-local:
$(RM) $(doc_builddir)/gnu.eps
+ $(RM) $(doc_builddir)/gnu.png
$(RM) $(doc_builddir)/groff.info*
$(RM) $(doc_builddir)/groff.pdf
$(RM) $(doc_builddir)/groff.dvi
@@ -750,7 +785,7 @@ install-html-local: $(GROFF_HTML)
|| $(mkinstalldirs) $(DESTDIR)$(htmldocdir)/groff.html.mono
for d in $(doc_builddir) $(doc_srcdir); do \
if [ -f "$$d"/groff.html ]; then \
- cp -r "$$d"/groff.html \
+ cp -r "$$d"/groff.html "$$d"/gnu.png \
$(DESTDIR)$(htmldocdir)/groff.html.mono; \
cp -r "$$d"/groff.html.node \
$(DESTDIR)$(htmldocdir); \
@@ -783,7 +818,7 @@ uninstall-txt:
# An image of a gnu in encapsulated PostScript is generated during the
# build process if necessary. Our configure script assumes pnmdepth is
# available if xpmtoppm is (see macro "GROFF_PROG_XPMTOPPM").
-EXTRA_DIST += $(DOC_GNU_EPS) doc/gnu.xpm
+EXTRA_DIST += $(DOC_GNU_EPS) $(DOC_GNU_PNG) doc/gnu.xpm
$(DOC_GNU_EPS): doc/gnu.xpm
$(AM_V_GEN)$(MKDIR_P) `dirname $@` \
&& if test "$(XPMTOPPM)" != found; then \
@@ -802,6 +837,23 @@ $(DOC_GNU_EPS): doc/gnu.xpm
xpmtoppm $(top_srcdir)/doc/gnu.xpm | pnmdepth 15 \
| $(pnmtops_nosetpage) -noturn -rle >$@
+$(DOC_GNU_PNG): doc/gnu.xpm
+ $(AM_V_GEN)$(MKDIR_P) `dirname $@` \
+ && if test "$(XPMTOPPM)" != found; then \
+ echo "program 'xpmtoppm' is missing; can't generate $@" >&2; \
+ exit 1; \
+ fi; \
+ if test "$(pnmtops)" != found; then \
+ echo "program 'pnmtops' is missing; can't generate $@" >&2; \
+ exit 1; \
+ fi; \
+ if ! echo "$(pnmtops_nosetpage)" | grep -q nosetpage; then \
+ echo "program 'pnmtops' can't handle -nosetpage option;" \
+ "can't generate $@" >&2; \
+ exit 1; \
+ fi; \
+ xpmtoppm $(top_srcdir)/doc/gnu.xpm | pnmtopng >$@
+
# Provide a copy of the image in the distribution archive to accommodate
# systems without a tool to generate it from an X pixmap.
dist-hook: dist-gnueps
diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index 683cb680e..430373e1e 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -26462,6 +26462,12 @@ follow quite naturally.
@codequotebacktick off
@codequoteundirected off
+@c Mark the end of the main matter with an image.
+@iftex
+@page
+@sp 6 @c vees
+@end iftex
+@center @image{gnu,1in,,A wildebeest happily regards a Gutenberg press.,.png}
@c =====================================================================
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit