diff mbox series

[v5] groff: Upgrade 1.24.2 -> 1.25.0

Message ID 20261112100532.91258-1-jaipaul.cheernam@est.tech
State Under Review
Headers show
Series [v5] groff: Upgrade 1.24.2 -> 1.25.0 | expand

Commit Message

Jaipaul Cheernam Nov. 12, 2026, 10:05 a.m. UTC
- Drop builddep.patch as fix is part of release
- Drop 0001-gropdf-use-SOURCE_DATE_EPOCH-for-reproducible-builds.patch;
  fixed upstream (Savannah #68136, released in 1.24.1). gropdf's SubTag()
  no longer uses rand(), so the SOURCE_DATE_EPOCH srand() seed is obsolete.
- Refresh exisitng patches
- Fix cross-compilation of man pages by using native soelim and stripping build paths.
- Add GROFF_G patch to keep the "g" program prefix off in cross builds;
  it dropped plain nroff/troff and broke man-db (test_mandb).
  Upstream: Savannah #68901.

Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
---
Changes since v4:
- Fix patch signoff
Changes since v3:
- Fix oe-selftest failure for mandb
Changes since v2:
 - Remove dropped patch
Changes since v1:
- Fix cross-compilation of man pages

 ...001-Make-manpages-mulitlib-identical.patch |  7 ++--
 ...groff-not-found-in-cross-compilation.patch | 15 +++----
 ...E_DATE_EPOCH-for-reproducible-builds.patch | 39 ------------------
 ..._G-don-t-prefix-when-troff-fails-to-.patch | 40 +++++++++++++++++++
 .../groff/files/build-less.patch              | 22 ++++++++--
 .../groff/files/builddep.patch                | 33 ---------------
 ...groff-not-search-fonts-on-build-host.patch | 13 +++---
 .../{groff_1.24.2.bb => groff_1.25.0.bb}      | 12 ++++--
 8 files changed, 83 insertions(+), 98 deletions(-)
 delete mode 100644 meta/recipes-extended/groff/files/0001-gropdf-use-SOURCE_DATE_EPOCH-for-reproducible-builds.patch
 create mode 100644 meta/recipes-extended/groff/files/0001-m4-groff.m4-GROFF_G-don-t-prefix-when-troff-fails-to-.patch
 delete mode 100644 meta/recipes-extended/groff/files/builddep.patch
 rename meta/recipes-extended/groff/{groff_1.24.2.bb => groff_1.25.0.bb} (87%)
diff mbox series

Patch

diff --git a/meta/recipes-extended/groff/files/0001-Make-manpages-mulitlib-identical.patch b/meta/recipes-extended/groff/files/0001-Make-manpages-mulitlib-identical.patch
index 6dc84c9062..093f447bc2 100644
--- a/meta/recipes-extended/groff/files/0001-Make-manpages-mulitlib-identical.patch
+++ b/meta/recipes-extended/groff/files/0001-Make-manpages-mulitlib-identical.patch
@@ -1,20 +1,19 @@ 
-From aa1f37f1e0ff0dc0eeb199b52959e0deb275721e Mon Sep 17 00:00:00 2001
+From 3497a04ab9bf74f7d686ebbd3bc5997227083f6c Mon Sep 17 00:00:00 2001
 From: Jeremy Puhlman <jpuhlman@mvista.com>
 Date: Sat, 7 Mar 2020 00:59:13 +0000
 Subject: [PATCH] Make manpages mulitlib identical
 
 Upstream-Status: Submitted [by email to g.branden.robinson@gmail.com]
 Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
-
 ---
  Makefile.am | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/Makefile.am b/Makefile.am
-index f7ab410..7e1f3fb 100644
+index 32deb25..b74e100 100644
 --- a/Makefile.am
 +++ b/Makefile.am
-@@ -891,7 +891,7 @@ SUFFIXES += .man
+@@ -860,7 +860,7 @@ SUFFIXES += .man
  	     -e "s|[@]PAGE[@]|\\\\%$(PAGE)|g" \
  	     -e "s|[@]PDFDOCDIR[@]|`echo $(pdfdocdir) | sed -f $(makevarescape)`|g" \
  	     -e "s|[@]PSPRINT[@]|`echo $(PSPRINT) | sed -f $(makevarescape)`|g" \
diff --git a/meta/recipes-extended/groff/files/0001-groff-fix-test-groff-not-found-in-cross-compilation.patch b/meta/recipes-extended/groff/files/0001-groff-fix-test-groff-not-found-in-cross-compilation.patch
index e9214519e7..c1db0134f8 100644
--- a/meta/recipes-extended/groff/files/0001-groff-fix-test-groff-not-found-in-cross-compilation.patch
+++ b/meta/recipes-extended/groff/files/0001-groff-fix-test-groff-not-found-in-cross-compilation.patch
@@ -1,4 +1,4 @@ 
-From c0f835a59d7b33452f280c8a73c3214e0a3a3d9f Mon Sep 17 00:00:00 2001
+From f0dfb4b314893769659b25da145d602d1dd87499 Mon Sep 17 00:00:00 2001
 From: Zhang Peng <peng.zhang1.cn@windriver.com>
 Date: Fri, 6 Mar 2026 05:18:33 +0000
 Subject: [PATCH] groff: fix test-groff not found in cross-compilation
@@ -29,7 +29,7 @@  Signed-off-by: Zhang Peng <peng.zhang1.cn@windriver.com>
  3 files changed, 8 insertions(+), 4 deletions(-)
 
 diff --git a/contrib/mom/mom.am b/contrib/mom/mom.am
-index b99e869..120d3ee 100644
+index 98d1def..57a3b3e 100644
 --- a/contrib/mom/mom.am
 +++ b/contrib/mom/mom.am
 @@ -24,7 +24,7 @@ mom_srcdir = $(top_srcdir)/contrib/mom
@@ -42,12 +42,12 @@  index b99e869..120d3ee 100644
    GROFF_BIN_PATH="$(GROFF_BIN_PATH)" \
    $(PDFMOMBIN) $(FFLAG) $(MFLAG) -M$(mom_srcdir) -K utf8 -p -e -t \
 diff --git a/doc/doc.am b/doc/doc.am
-index 6cf9db5..906a989 100644
+index 8220a5d..e159f70 100644
 --- a/doc/doc.am
 +++ b/doc/doc.am
-@@ -54,7 +54,7 @@ groffmanpagesoption = -P-e
- endif
- 
+@@ -65,7 +65,7 @@ endif # HAVE_URW_FONTS
+ # Use this macro to render a document if it has forward internal
+ # references.
  DOC_PDFMOM = \
 -  GROFF_COMMAND=test-groff \
 +  GROFF_COMMAND=$(abs_top_builddir)/test-groff \
@@ -77,6 +77,3 @@  index a65898a..9c6a8b6 100644
  
 -exec $builddir/groff "$@"
 +exec $GROFF_BIN_PATH/groff "$@"
--- 
-2.51.2
-
diff --git a/meta/recipes-extended/groff/files/0001-gropdf-use-SOURCE_DATE_EPOCH-for-reproducible-builds.patch b/meta/recipes-extended/groff/files/0001-gropdf-use-SOURCE_DATE_EPOCH-for-reproducible-builds.patch
deleted file mode 100644
index 8ab3668edc..0000000000
--- a/meta/recipes-extended/groff/files/0001-gropdf-use-SOURCE_DATE_EPOCH-for-reproducible-builds.patch
+++ /dev/null
@@ -1,39 +0,0 @@ 
-From f28f0c4d8dfdfb1c173d21df6ffbe35448fada9f Mon Sep 17 00:00:00 2001
-From: Zhang Peng <peng.zhang1.cn@windriver.com>
-Date: Mon, 9 Mar 2026 20:10:00 +0800
-Subject: [PATCH] gropdf: use SOURCE_DATE_EPOCH for reproducible builds
-
-gropdf uses rand() to generate random font subset tags in SubTag().
-Without a deterministic seed, each build produces different PDF output.
-
-Initialize srand() with SOURCE_DATE_EPOCH when available to ensure
-reproducible builds.
-
-Upstream-Status: Submitted [https://savannah.gnu.org/bugs/?68136]
-
-Signed-off-by: Zhang Peng <peng.zhang1.cn@windriver.com>
----
- src/devices/gropdf/gropdf.pl | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
-index f519a53..3a79b4c 100644
---- a/src/devices/gropdf/gropdf.pl
-+++ b/src/devices/gropdf/gropdf.pl
-@@ -30,6 +30,13 @@ use POSIX qw(mktime);
- use File::Spec;
- use File::Path;
- 
-+# Initialize random seed for reproducible builds.
-+if (defined($ENV{SOURCE_DATE_EPOCH})) {
-+    srand($ENV{SOURCE_DATE_EPOCH});
-+} else {
-+    srand();
-+}
-+
- use constant
- {
-     WIDTH    => 0,
--- 
-2.50.0
-
diff --git a/meta/recipes-extended/groff/files/0001-m4-groff.m4-GROFF_G-don-t-prefix-when-troff-fails-to-.patch b/meta/recipes-extended/groff/files/0001-m4-groff.m4-GROFF_G-don-t-prefix-when-troff-fails-to-.patch
new file mode 100644
index 0000000000..3480fb0122
--- /dev/null
+++ b/meta/recipes-extended/groff/files/0001-m4-groff.m4-GROFF_G-don-t-prefix-when-troff-fails-to-.patch
@@ -0,0 +1,40 @@ 
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
+Date: Wed, 12 Nov 2026 09:00:00 +0000
+Subject: [PATCH] m4/groff.m4: Don't prefix when troff can't run.
+
+* m4/groff.m4 (GROFF_G): Apply the "g" command prefix only when the
+  troff on PATH runs and reports a non-GNU ".g" value, not whenever its
+  output differs from "1".  A troff that is installed but fails to run --
+  as the native groff does when cross compiling, lacking its device
+  files -- is no longer mistaken for a groff-incompatible troff.
+
+Continues commit 96b8274a90, 14 October.
+
+Upstream-Status: Submitted [https://savannah.gnu.org/bugs/index.php?68901]
+Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
+diff --git a/m4/groff.m4 b/m4/groff.m4
+index e16ff3d..7f41502 100644
+--- a/m4/groff.m4
++++ b/m4/groff.m4
+@@ -1065,11 +1065,14 @@ AC_DEFUN([GROFF_TMAC],
+ AC_DEFUN([GROFF_G], [
+   g=
+   AC_MSG_CHECKING([whether a groff-incompatible troff is installed])
+-  if test -n "`command -v troff`" \
+-    && test "`(echo .tm '|n(.g' | tr '|' '\\\\' | troff -z -i 2>&1) \
+-      2>/dev/null`" != 1
++  if test -n "`command -v troff`"
+   then
+-    g=g
++    troff_dotg=`(echo .tm '|n(.g' | tr '|' '\\\\' | troff -z -i 2>/dev/null) \
++      2>/dev/null`
++    if test -n "$troff_dotg" && test "$troff_dotg" != 1
++    then
++      g=g
++    fi
+   fi
+   if test "$g" = "g"
+   then
+-- 
+2.51.2
diff --git a/meta/recipes-extended/groff/files/build-less.patch b/meta/recipes-extended/groff/files/build-less.patch
index dc560fbb30..62cd9f1718 100644
--- a/meta/recipes-extended/groff/files/build-less.patch
+++ b/meta/recipes-extended/groff/files/build-less.patch
@@ -1,12 +1,25 @@ 
+From d30928c7ee37eabf32075d88b1e6a406968651c2 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@arm.com>
+Date: Tue, 19 May 2026 15:15:07 +0100
+Subject: [PATCH] groff: build less in groff-native
+
 Build less bits of groff to save time and reduce random build
 failures from missing dependencies in this logic.
 
 Upstream-Status: Inappropriate
 Signed-off-by: Ross Burton <ross.burton@arm.com>
+---
+ Makefile.am | 15 ---------------
+ 1 file changed, 15 deletions(-)
 
---- a/Makefile.am~	2026-05-15 13:23:08.000000000 +0100
-+++ b/Makefile.am	2026-05-15 13:29:17.053867035 +0100
-@@ -556,15 +556,0 @@
+diff --git a/Makefile.am b/Makefile.am
+index b74e100..9b5ecec 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -553,21 +553,6 @@ AM_CFLAGS =
+ include $(top_srcdir)/lib/gnulib.mk
+ include $(top_srcdir)/arch/mingw/mingw.am
+ include $(top_srcdir)/arch/misc/misc.am
 -include $(top_srcdir)/contrib/chem/chem.am
 -include $(top_srcdir)/contrib/eqn2graph/eqn2graph.am
 -include $(top_srcdir)/contrib/gdiffmk/gdiffmk.am
@@ -22,3 +35,6 @@  Signed-off-by: Ross Burton <ross.burton@arm.com>
 -include $(top_srcdir)/contrib/rfc1345/rfc1345.am
 -include $(top_srcdir)/contrib/sboxes/sboxes.am
 -include $(top_srcdir)/doc/doc.am
+ include $(top_srcdir)/font/devX100/devX100.am
+ include $(top_srcdir)/font/devX100-12/devX100-12.am
+ include $(top_srcdir)/font/devX75/devX75.am
diff --git a/meta/recipes-extended/groff/files/builddep.patch b/meta/recipes-extended/groff/files/builddep.patch
deleted file mode 100644
index 71c23d60b5..0000000000
--- a/meta/recipes-extended/groff/files/builddep.patch
+++ /dev/null
@@ -1,33 +0,0 @@ 
-[mom]: Fix example build dependencies
-
-We are seeing occasional failures for eqn being missing when building
-mom examples, e.g.:
-
-| groff-1.24.0/groff: error: couldn't exec eqn: Permission denied
-| pdfmom: fatal error: groff-1.24.0/test-groff exited with status 24
-| make[2]: *** [Makefile:19256: contrib/mom/examples/slide-demo.pdf] Error 1
-
-It may find eqn from the host system if installed too.
-
-Fix the build dependencies to add eqn, pic, tbl and preconv since a 
-quick strace indicates them all being used here
-
-Upstream-Status: Backport [https://cgit.git.savannah.gnu.org/cgit/groff.git/commit/?id=3f7d8ea20f91a8abf248fbf7ec73049cd8c3c9c2]
-
-Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-
-Index: groff-1.24.0/contrib/mom/mom.am
-===================================================================
---- groff-1.24.0.orig/contrib/mom/mom.am
-+++ groff-1.24.0/contrib/mom/mom.am
-@@ -144,8 +144,8 @@ SUFFIXES += .mom .pdf
- 	&& LC_ALL=C $(MOMPDFMOM) $< >$@
- 
- $(MOMPROCESSEDEXAMPLEFILES): $(MOMNORMALFILES) \
--  test-groff groff troff gropdf pdfmom penguin.ps penguin.pdf \
--  font/devpdf/stamp tmac/pdf.tmac
-+  test-groff groff troff gropdf pdfmom eqn pic tbl preconv \
-+  penguin.ps penguin.pdf font/devpdf/stamp tmac/pdf.tmac
- 
- penguin.ps:
- 	$(AM_V_at)cp $(mom_srcdir)/examples/penguin.ps $@
diff --git a/meta/recipes-extended/groff/files/groff-not-search-fonts-on-build-host.patch b/meta/recipes-extended/groff/files/groff-not-search-fonts-on-build-host.patch
index 111dbd385e..b1e7a08cf3 100644
--- a/meta/recipes-extended/groff/files/groff-not-search-fonts-on-build-host.patch
+++ b/meta/recipes-extended/groff/files/groff-not-search-fonts-on-build-host.patch
@@ -1,7 +1,8 @@ 
-From eb16276c3e2e34aa2e57f6a0e68554657b90cd28 Mon Sep 17 00:00:00 2001
+From 6c2c062e9ccd4235a6262e1effbdd40ec7d35b25 Mon Sep 17 00:00:00 2001
 From: Hongxu Jia <hongxu.jia@windriver.com>
 Date: Sat, 11 May 2019 17:06:29 +0800
 Subject: [PATCH] groff searchs fonts which are provided by ghostscript on
+
  build host. It causes non-determinism issue. So not search font dirs on host.
 
 Upstream-Status: Inappropriate [cross build specific]
@@ -13,25 +14,24 @@  Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
 
 Rebase to 1.24.0
 Signed-off-by: Zhang Peng <peng.zhang1.cn@windriver.com>
-
 ---
  font/devpdf/Foundry.in | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/font/devpdf/Foundry.in b/font/devpdf/Foundry.in
-index e5aba65..5441734 100644
+index 56297fc..3a43aaa 100644
 --- a/font/devpdf/Foundry.in
 +++ b/font/devpdf/Foundry.in
-@@ -23,7 +23,7 @@
+@@ -21,7 +21,7 @@
  
  #=======================================================================
  #Foundry|Name|Search path
--foundry||@urwfontsdir@:(gs):/usr/share/fonts/type1/urw-base35/:/usr/share/fonts/urw-base35:/opt/local/share/fonts/urw-fonts/:/usr/local/share/fonts/ghostscript/:/usr/share/fonts/type1/gsfonts/:/usr/share/fonts/type1/:/usr/share/fonts/default/Type1/adobestd35/:/usr/share/fonts/default/Type1/:/usr/share/ghostscript/Resource/Font
+-foundry||@urwfontsdir@:(gs):/usr/share/fonts/type1/urw-base35/:/usr/share/fonts/urw-base35:/opt/local/share/fonts/urw-fonts/:/usr/local/share/fonts/ghostscript/:/usr/share/fonts/type1/gsfonts/:/usr/share/fonts/type1/:/usr/share/fonts/default/Type1/adobestd35/:/usr/share/fonts/default/Type1/
 +foundry||(gs)
  
  # Enable the font description files for grops (generated from Adobe
  # foundry font files) to be used with gropdf.  afmtodit must not be
-@@ -79,7 +79,7 @@ EURO|N||||*../devps/freeeuro.pfa
+@@ -73,7 +73,7 @@ EURO|N||||*../devps/freeeuro.pfa
  # URW fonts are typically shipped with Ghostscript, but can be replaced.
  
  #Foundry|Name|Search path
@@ -39,3 +39,4 @@  index e5aba65..5441734 100644
 +foundry|U|(gs)
  
  # Define flags for afmtodit.
+ 
diff --git a/meta/recipes-extended/groff/groff_1.24.2.bb b/meta/recipes-extended/groff/groff_1.25.0.bb
similarity index 87%
rename from meta/recipes-extended/groff/groff_1.24.2.bb
rename to meta/recipes-extended/groff/groff_1.25.0.bb
index e13996500f..04001765ac 100644
--- a/meta/recipes-extended/groff/groff_1.24.2.bb
+++ b/meta/recipes-extended/groff/groff_1.25.0.bb
@@ -11,13 +11,12 @@  SRC_URI = "${GNU_MIRROR}/groff/groff-${PV}.tar.gz \
            file://groff-not-search-fonts-on-build-host.patch \
            file://0001-Make-manpages-mulitlib-identical.patch \
            file://0001-groff-fix-test-groff-not-found-in-cross-compilation.patch \
-           file://0001-gropdf-use-SOURCE_DATE_EPOCH-for-reproducible-builds.patch \
-           file://builddep.patch \
+           file://0001-m4-groff.m4-GROFF_G-don-t-prefix-when-troff-fails-to-.patch \
            "
 
 SRC_URI:append:class-native = "file://build-less.patch"
 
-SRC_URI[sha256sum] = "f9c1efd5bebbe37fc6e1063db7473ce8df1e3e0be4ff0f43ce04fce57e9c5dd9"
+SRC_URI[sha256sum] = "24d103a07eb79e418963bce206c8771b649871f83bda2fd4c2e65529c1c56921"
 
 DEPENDS = "bison-native groff-native"
 RDEPENDS:${PN} += "perl sed"
@@ -27,7 +26,7 @@  inherit autotools-brokensep texinfo multilib_script pkgconfig
 MULTILIB_SCRIPTS = "${PN}:${bindir}/gpinyin ${PN}:${bindir}/grog"
 
 EXTRA_OECONF = "--without-x --with-urw-fonts-dir=/completely/bogus/dir/"
-EXTRA_OEMAKE:class-target = "GROFFBIN=groff GROFF_BIN_PATH=${STAGING_BINDIR_NATIVE}"
+EXTRA_OEMAKE:class-target = "GROFFBIN=groff GROFF_BIN_PATH=${STAGING_BINDIR_NATIVE} SOELIMBIN=${STAGING_BINDIR_NATIVE}/soelim"
 
 CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl' ac_cv_path_BASH_PROG='no' PAGE=A4"
 
@@ -71,6 +70,11 @@  do_install:append() {
 	if [ -d ${D}${docdir}/${BP}/examples/hdtbl/ ]; then
 		sed -i -e 's:${HOSTTOOLS_DIR}/::g' ${D}${docdir}/${BP}/examples/hdtbl/*.roff
 	fi
+
+	# Remove build paths from generated groff.7 for reproducibility.
+	if [ -f ${D}${mandir}/man7/groff.7 ]; then
+		sed -i -e 's:${S}/::g' ${D}${mandir}/man7/groff.7
+	fi
 }
 
 do_install:append:class-native() {