Source: qt6-wayland
Version: 6.3.1-2
Tags: patch
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

qt6-wayland fails to cross build from source. The immediate failure is a
missing QT_HOST_PATH variable. Beyond that, it also needs
QT_HOST_PATH_CMAKE_DIR and the relevant cmake files from a native
qt6-wayland-dev. Surprisingly qt6-wayland-dev does not yet depend on
qt6-wayland-dev-tools even though its cmake files reference the
contained tool. I think this is a missing runtime dependency. Finally,
we also need to tell qt6-wayland to cross build its tools. I'm attaching
a patch that makes qt6-wayland cross buildable for your convenience.

Helmut
diff --minimal -Nru qt6-wayland-6.3.1/debian/changelog 
qt6-wayland-6.3.1/debian/changelog
--- qt6-wayland-6.3.1/debian/changelog  2022-08-15 19:24:06.000000000 +0200
+++ qt6-wayland-6.3.1/debian/changelog  2022-10-30 00:56:48.000000000 +0200
@@ -1,3 +1,14 @@
+qt6-wayland (6.3.1-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Pass QT_HOST_PATH and QT_HOST_PATH_CMAKE_DIR.
+    + Depend on a native version of ourselves.
+    + qt6-wayland-dev needs to depend on qt6-wayland-dev-tools.
+    + Do build tools when cross compiling.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Sun, 30 Oct 2022 00:56:48 +0200
+
 qt6-wayland (6.3.1-2) unstable; urgency=medium
 
   [ Patrick Franz ]
diff --minimal -Nru qt6-wayland-6.3.1/debian/control 
qt6-wayland-6.3.1/debian/control
--- qt6-wayland-6.3.1/debian/control    2022-08-15 18:52:08.000000000 +0200
+++ qt6-wayland-6.3.1/debian/control    2022-10-30 00:56:48.000000000 +0200
@@ -24,6 +24,7 @@
                qt6-base-private-dev (>= 6.3.1+dfsg~),
                qt6-declarative-dev (>= 6.3.1+dfsg~),
                qt6-declarative-private-dev (>= 6.3.1+dfsg~),
+               qt6-wayland-dev:native <cross>,
                xauth <!nocheck>,
                xvfb <!nocheck>,
                zlib1g-dev,
@@ -144,6 +146,7 @@
          libqt6waylandeglclienthwintegration6 (= ${binary:Version}),
          libqt6waylandeglcompositorhwintegration6 (= ${binary:Version}),
          libqt6wlshellintegration6 (= ${binary:Version}),
+         qt6-wayland-dev-tools (= ${binary:Version}),
          ${misc:Depends},
 Description: Qt 6 Wayland - development files
  Qt is a cross-platform C++ application framework. Qt's primary feature
diff --minimal -Nru qt6-wayland-6.3.1/debian/rules 
qt6-wayland-6.3.1/debian/rules
--- qt6-wayland-6.3.1/debian/rules      2021-12-13 22:33:29.000000000 +0100
+++ qt6-wayland-6.3.1/debian/rules      2022-10-30 00:56:48.000000000 +0200
@@ -4,12 +4,22 @@
 
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 
+extra_cmake_args :=
+
+ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
+extra_cmake_args += \
+       -DQT_HOST_PATH=/usr \
+       -DQT_HOST_PATH_CMAKE_DIR=/usr/lib/${DEB_BUILD_MULTIARCH}/cmake \
+       -DQT_BUILD_TOOLS_WHEN_CROSSCOMPILING=ON
+endif
+
 %:
        dh $@ --with pkgkde_symbolshelper --buildsystem=cmake+ninja
 
 override_dh_auto_configure:
        dh_auto_configure -- \
-               -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
+               -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) \
+               $(extra_cmake_args)
 
 execute_after_dh_auto_install:
        # Reproducible builds: remove build paths from .prl files

Reply via email to