Source: fribidi
Version: 1.0.16-4
Severity: important
Justification: breaks architecture cross bootstrap
Tags: patch
User: [email protected]
Usertags: ftcbfs
User: [email protected]
Usertags: rebootstrap

Hi,

thank you for your efforts on improviing the fribidi manual page. 
Unfortunately, using help2man tends to not play well with cross 
compilation. The built fribidi cannot be run and help2man fails. There 
are many solutions to this problem none of which are nice. For instance, 
installing the manual page into an arch:all package would remove the 
need for it to be cross built, but that would be a very small arch:all 
package.

Since fribidi is a very small packages with few dependencies, I suggest 
building it twice. A native pass is used to generate the manual page and 
then everything but the manual page is cross built. Implementing this 
for fribidi is a bit tricky. I've come up with the attached patch. I 
recognize that it does add quite a bit of complexity to the packaging, 
but please be aware that every known solution to the help2man problem 
has significant downsides. Is that something you're willing to apply?

If not, please consider alternative solutions:
 * fribidi could Build-Depends: libfribidi-bin <cross> and use the built
   and installed version of the fribidi command to generate the manual 
   page.
 * The help text could be extracted from the src/fribidi-main.c source
   code without running the built command (e.g. using Perl or Python) 
   and be passed to help2man.
 * A cross build could skip generating a manual page. Doing so
   permanently renders cross builds unreproducible.
 * A real manual page that does not rely on help2man could be written.

Additionally, I think that the command used to generate the manual page 
belongs into a verbose build log.

Helmut
diff -Nru fribidi-1.0.16/debian/changelog fribidi-1.0.16/debian/changelog
--- fribidi-1.0.16/debian/changelog     2025-12-12 17:53:26.000000000 +0100
+++ fribidi-1.0.16/debian/changelog     2025-12-13 07:58:46.000000000 +0100
@@ -1,3 +1,11 @@
+fribidi (1.0.16-4.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: Run help2man on a native build pass. (Closes: #-1)
+  * Build verbosely.
+
+ -- Helmut Grohne <[email protected]>  Sat, 13 Dec 2025 07:58:46 +0100
+
 fribidi (1.0.16-4) unstable; urgency=medium
 
   * d/rules: Add hardening=+all to DEB_BUILD_MAINT_OPTIONS
diff -Nru fribidi-1.0.16/debian/patches/generate_man1.patch 
fribidi-1.0.16/debian/patches/generate_man1.patch
--- fribidi-1.0.16/debian/patches/generate_man1.patch   2025-12-12 
17:53:26.000000000 +0100
+++ fribidi-1.0.16/debian/patches/generate_man1.patch   2025-12-13 
07:58:46.000000000 +0100
@@ -19,7 +19,7 @@
        cd $(top_builddir)/lib && $(MAKE) $(AM_MAKEFLAGS) libfribidi.la
  
 +%.1: %
-+      @$(top_srcdir)/missing --run help2man ./$< --no-info \
++      $(top_srcdir)/missing --run help2man ./$< --no-info \
 +      --version-string=- -n "$(shell ./$< --help | head -n 2 | tail -n 1)" \
 +      --output=$@
 +
diff -Nru fribidi-1.0.16/debian/rules fribidi-1.0.16/debian/rules
--- fribidi-1.0.16/debian/rules 2025-12-12 17:53:26.000000000 +0100
+++ fribidi-1.0.16/debian/rules 2025-12-13 07:58:46.000000000 +0100
@@ -3,6 +3,8 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
+include /usr/share/dpkg/architecture.mk
+
 export DEB_BUILD_MAINT_OPTIONS=hardening=+all
 FRIBIDI_UDEB=libfribidi0-udeb
 
@@ -16,7 +18,18 @@
        dh $@
 
 override_dh_auto_configure:
+ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
+       dpkg-architecture -a$(DEB_BUILD_ARCH) -f -c dh_auto_configure 
--reload-all-buildenv-variables -- --enable-malloc --enable-static
+       dpkg-architecture -a$(DEB_BUILD_ARCH) -f -c dh_auto_build -- -C bin 
fribidi.1
+       dpkg-architecture -a$(DEB_BUILD_ARCH) -f -c dh_auto_clean
+endif
        dh_auto_configure -- --enable-malloc --enable-static
 
+ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
+execute_before_dh_auto_build:
+       dh_auto_build -- -C bin fribidi
+       touch bin/fribidi.1
+endif
+
 override_dh_makeshlibs:
        dh_makeshlibs -V --add-udeb="$(FRIBIDI_UDEB)"

Reply via email to