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

libgpiod fails to cross build from source, because the Python extension
is built for the build architecture. There is a tricky environment
variable one has to set and when using the pybuild debhelper
buildsystem, this is handled automatically, but not when building a
Python extension inside autoconf. Thus it needs to be set explicitly.
Then it fails for non-default Python versions as only libpython3-dev is
included in build dependencies and libpython3-all-dev is missing. The
<!cross> annotation on help2man is a lie, because debian/*.install fails
when skipping help2man. I have no good answer to help2man unfortunately
and that's what makes it continue failing for now. The attached patch
fixes the other mentioned issues.

Helmut
diff --minimal -Nru libgpiod-2.1.3/debian/changelog 
libgpiod-2.1.3/debian/changelog
--- libgpiod-2.1.3/debian/changelog     2024-08-27 16:35:02.000000000 +0200
+++ libgpiod-2.1.3/debian/changelog     2024-11-24 14:09:22.000000000 +0100
@@ -1,3 +1,14 @@
+libgpiod (2.1.3-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Improve cross building:
+    + Missing dependency libpython3-all-dev.
+    + Export _PYTHON_SYSCONFIGDATA_NAME for cross building.
+    + Drop <!cross> profile from help2man as debian/*.install requires it.
+  * Drop --with argument implied in dh-sequence-* build dependency.
+
+ -- Helmut Grohne <[email protected]>  Sun, 24 Nov 2024 14:09:22 +0100
+
 libgpiod (2.1.3-1) unstable; urgency=medium
 
   * Upload to unstable (Closes: #1055129)
diff --minimal -Nru libgpiod-2.1.3/debian/control libgpiod-2.1.3/debian/control
--- libgpiod-2.1.3/debian/control       2024-08-27 16:34:34.000000000 +0200
+++ libgpiod-2.1.3/debian/control       2024-11-24 14:09:22.000000000 +0100
@@ -7,12 +7,12 @@
                autoconf-archive,
                automake,
                dh-sequence-python3 <!nopython>,
-               help2man <!cross>,
+               help2man,
                pkgconf,
                m4,
                graphviz,
                python3-all-dev:any <!nopython>,
-               libpython3-dev <!nopython>,
+               libpython3-all-dev <!nopython>,
                python3-setuptools <!nopython>,
                linux-libc-dev (>= 4.8)
 Standards-Version: 4.7.0
diff --minimal -Nru libgpiod-2.1.3/debian/rules libgpiod-2.1.3/debian/rules
--- libgpiod-2.1.3/debian/rules 2024-08-27 16:35:02.000000000 +0200
+++ libgpiod-2.1.3/debian/rules 2024-11-24 14:09:17.000000000 +0100
@@ -3,11 +3,15 @@
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=+lto abi=+time64
 export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
 
+include /usr/share/dpkg/architecture.mk
+
 %:
-ifeq ($(filter nopython,$(DEB_BUILD_PROFILES)),)
-       dh $@ --with python3 --exclude=.la
-else
        dh $@ --exclude=.la
+
+ifeq (,$(filter nopython,$(DEB_BUILD_PROFILES)))
+ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
+export 
_PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__$(DEB_HOST_ARCH_OS)_$(DEB_HOST_MULTIARCH)
+endif
 endif
 
 override_dh_auto_configure:

Reply via email to