Source: zxing-cpp
Version: 2.3.0-4
Tags: patch
User: [email protected]
Usertags: cross-satisfiability ftcbfs

zxing-cpp fails to cross build from source for two reasons both of which
relate to its Python extension. The python3-dev build dependency cannot
be installed for the host architecture as the host architecture Python
compiler fails postinst when attempting byte compilation. Instead a
build architecture interpreter and a host architecture development
package is needed. This is usually achieved by depending on
python3-dev:native and libpython3-dev. Beyond this, the extension build
defaults to using the build architecture name for installing the built
extension. It needs to be told about the correct path via the sysconfig
mechanism. I'm attaching a patch addressing both problems. Please
consider applying it as it makes zxing-cpp cross buildable.

Helmut
diff -Nru zxing-cpp-2.3.0/debian/changelog zxing-cpp-2.3.0/debian/changelog
--- zxing-cpp-2.3.0/debian/changelog    2025-04-30 20:07:19.000000000 +0200
+++ zxing-cpp-2.3.0/debian/changelog    2025-12-19 22:46:20.000000000 +0100
@@ -1,3 +1,12 @@
+zxing-cpp (2.3.0-4.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Multiarchify Python Build-Depends.
+    + Export sysconfig data for cross compilation.
+
+ -- Helmut Grohne <[email protected]>  Fri, 19 Dec 2025 22:46:20 +0100
+
 zxing-cpp (2.3.0-4) unstable; urgency=medium
 
   * debian/patches/backport/: Cherry-pick upstream-suggested patches
diff -Nru zxing-cpp-2.3.0/debian/control zxing-cpp-2.3.0/debian/control
--- zxing-cpp-2.3.0/debian/control      2025-04-30 19:11:10.000000000 +0200
+++ zxing-cpp-2.3.0/debian/control      2025-12-19 22:46:18.000000000 +0100
@@ -9,11 +9,11 @@
  libfmt-dev <!nocheck>,
  libgmock-dev <!nocheck>,
  libgtest-dev <!nocheck>,
+ libpython3-dev,
  libstb-dev,
  pkgconf,
  pybind11-dev,
- python3,
- python3-dev,
+ python3-dev:native,
  python3-numpy <!nocheck>,
  python3-opencv <!nocheck>,
  python3-pil <!nocheck>,
diff -Nru zxing-cpp-2.3.0/debian/rules zxing-cpp-2.3.0/debian/rules
--- zxing-cpp-2.3.0/debian/rules        2025-04-30 19:43:29.000000000 +0200
+++ zxing-cpp-2.3.0/debian/rules        2025-12-19 22:46:20.000000000 +0100
@@ -23,6 +23,9 @@
 include /usr/share/dpkg/default.mk
 include /usr/share/dpkg/buildflags.mk
 
+ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
+export 
_PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__$(DEB_HOST_ARCH_OS)_$(DEB_HOST_MULTIARCH)
+endif
 
 %:
        dh $@ --with python3

Reply via email to