Source: libgpiod
Version: 1.5.2-1
Tags: patch
User: [email protected]
Usertags: ftcbfs

libgpiod fails to cross build from source for two unrelated reasons.

The python build dependencies are not cross-satisfiable. A simple
workaround for this issue is building with the nopython build profile
now, but there is a real solution for cross building python extensions.
One simply turns a python$something-dev dependency into a combination of
libpython$something-dev plus python$something-dev:any.

libgpiod also started using help2man. help2man always breaks cross
compilation and there is no good solution to this. Let me list a number
of options:
 * Stop using help2man and write useful manual pages. (<- preferred)
 * Don't run help2man during cross builds and use pre-generated manual
   pages instead. (<- what the attached patch does)
 * Build the whole package twice: Once natively for help2man and once
   for real.
 * Skip manual pages in cross builds. (<- what upstream defaults to,
   breaks reproducibility)
 * Carefully extract --help output from C sources using a script without
   actually running it. (<- very fragile)

For libgpiod, by far the simplest option was using generated pages.
Please consider applying the attached patch. Please feel free to use a
better solution for help2man.

Helmut
diff --minimal -Nru libgpiod-1.5.2/debian/changelog 
libgpiod-1.5.2/debian/changelog
--- libgpiod-1.5.2/debian/changelog     2020-09-03 05:26:10.000000000 +0200
+++ libgpiod-1.5.2/debian/changelog     2020-10-16 14:12:19.000000000 +0200
@@ -1,3 +1,12 @@
+libgpiod (1.5.2-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Multiarchify python Build-Depends.
+    + Install pre-built manpages during cross builds.
+
+ -- Helmut Grohne <[email protected]>  Fri, 16 Oct 2020 14:12:19 +0200
+
 libgpiod (1.5.2-1) unstable; urgency=medium
 
   * Import new upstream release
diff --minimal -Nru libgpiod-1.5.2/debian/control libgpiod-1.5.2/debian/control
--- libgpiod-1.5.2/debian/control       2020-07-01 05:27:19.000000000 +0200
+++ libgpiod-1.5.2/debian/control       2020-10-16 14:12:19.000000000 +0200
@@ -6,10 +6,11 @@
                autoconf-archive,
                automake,
                dh-sequence-python3 <!nopython>,
-               help2man,
+               help2man <!cross>,
                pkg-config,
                m4,
-               python3-dev <!nopython>,
+               python3-dev:any <!nopython>,
+               libpython3-dev <!nopython>,
                python3-setuptools <!nopython>
 Standards-Version: 4.5.0
 Rules-Requires-Root: no
diff --minimal -Nru libgpiod-1.5.2/debian/patches/cross.patch 
libgpiod-1.5.2/debian/patches/cross.patch
--- libgpiod-1.5.2/debian/patches/cross.patch   1970-01-01 01:00:00.000000000 
+0100
+++ libgpiod-1.5.2/debian/patches/cross.patch   2020-10-16 14:12:19.000000000 
+0200
@@ -0,0 +1,26 @@
+--- libgpiod-1.5.2.orig/configure.ac
++++ libgpiod-1.5.2/configure.ac
+@@ -212,7 +212,7 @@
+ then
+       AC_CHECK_PROG([has_help2man], [help2man], [true], [false])
+ fi
+-AM_CONDITIONAL([WITH_MANPAGES], [test "x$has_help2man" = xtrue])
++AM_CONDITIONAL([WITH_HELP2MAN], [test "x$has_help2man" = xtrue])
+ if test "x$has_help2man" = xfalse
+ then
+       AC_MSG_NOTICE([help2man not found - man pages cannot be generated 
automatically])
+--- libgpiod-1.5.2.orig/man/Makefile.am
++++ libgpiod-1.5.2/man/Makefile.am
+@@ -6,10 +6,10 @@
+ # Copyright (C) 2019 Bartosz Golaszewski <[email protected]>
+ #
+ 
+-if WITH_MANPAGES
+-
+ dist_man1_MANS = gpiodetect.man gpioinfo.man gpioget.man gpioset.man 
gpiofind.man gpiomon.man
+ 
++if WITH_HELP2MAN
++
+ %.man: $(top_builddir)/tools/$(*F)
+       help2man $(top_builddir)/tools/$(*F) --include=$(srcdir)/template 
--output=$(builddir)/$@ --no-info
+ 
diff --minimal -Nru libgpiod-1.5.2/debian/patches/series 
libgpiod-1.5.2/debian/patches/series
--- libgpiod-1.5.2/debian/patches/series        1970-01-01 01:00:00.000000000 
+0100
+++ libgpiod-1.5.2/debian/patches/series        2020-10-16 14:12:19.000000000 
+0200
@@ -0,0 +1 @@
+cross.patch

Reply via email to