Source: ibus
Version: 1.5.35-1
Tags: patch
User: [email protected]
Usertags: cross-satisfiability ftcbfs

ibus fails to cross build from source for a wealth of distinct reasons.

Initially, its Build-Depends are not cross-satisfiable. python3-all
requests a host architecture Python interpreter, which cannot be
installed. Looking into it, I realized that ibus builds an
architecture-independent Python module. We don't actually have to build
in in an arch-only build such as a cross build, so I looked into
demoting it to Build-Depends-Indep. This mostly works, except that meson
readily fails on pyoverridesdir never being defined. It looks like the
meson.build file hasn't been used without pygobject in a while. Once
fixing this, I can move the Python module to B-D-I and had reproducible
builds confirm that an arch-only build faithfully reproduces a full
build.

The next failure arises from the use of the build architecture
pkg-config. It is hard coded in meson.build. A comment indicates that
this was not due to being careless. The regular way of using the
meson-internal dependency mechanism doesn't seem to work right (though I
don't exactly understand how). As far as I understand it, the dependency
is being found, but has inappropriate fields. The compile_args and
link_args are ok though, so we could copy them from the original
dependency object instead of invoking the wrong pkg-config. Does that
sound workable?

And with all of this changed, the build gets somewhat far until it
figures that it needs an exe_wrapper for a build tool that is not marked
native. Fixing this is more involved. Please consider it out of scope
for this bug report. Can you still forward the proposed upstream changes
and apply the Debian changes to fix the lower hanging fruit?

Helmut
diff -Nru ibus-1.5.35/debian/changelog ibus-1.5.35/debian/changelog
--- ibus-1.5.35/debian/changelog        2026-11-09 13:09:04.000000000 +0100
+++ ibus-1.5.35/debian/changelog        2026-11-22 22:04:42.000000000 +0100
@@ -1,3 +1,13 @@
+ibus (1.5.35-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Improve cross building: (Closes: #-1)
+    + Move the Python module build to indep-only.
+    + cross.patch: Fix building without pygobject
+    + cross.patch: Stop hardcoding pkg-config
+
+ -- Helmut Grohne <[email protected]>  Sun, 22 Nov 2026 22:04:42 +0100
+
 ibus (1.5.35-1) unstable; urgency=medium
 
   [ Jeremy BĂ­cha ]
diff -Nru ibus-1.5.35/debian/control ibus-1.5.35/debian/control
--- ibus-1.5.35/debian/control  2026-11-09 13:09:04.000000000 +0100
+++ ibus-1.5.35/debian/control  2026-11-22 22:04:42.000000000 +0100
@@ -7,7 +7,6 @@
 Build-Depends: debhelper-compat (= 14),
                desktop-file-utils,
                dh-exec,
-               dh-sequence-python3,
                dbus-daemon <!nocheck>,
                gettext,
                gir1.2-gio-2.0-dev,
@@ -31,15 +30,16 @@
                libwayland-dev [linux-any],
                meson,
                pkgconf,
-               python-gi-dev,
-               python3-all,
                systemd-dev [linux-any],
                unicode-cldr-core (>= 44),
                unicode-data (>= 15.1),
                valac,
                wayland-protocols [linux-any],
                xkb-data (>= 2.48~),
-Build-Depends-Indep: libglib2.0-doc <!nodoc>
+Build-Depends-Indep: dh-sequence-python3,
+                     libglib2.0-doc <!nodoc>,
+                     python-gi-dev,
+                     python3-all,
 Standards-Version: 4.7.4
 Vcs-Browser: https://salsa.debian.org/debian/ibus
 Vcs-Git: https://salsa.debian.org/debian/ibus.git
diff -Nru ibus-1.5.35/debian/patches/cross.patch 
ibus-1.5.35/debian/patches/cross.patch
--- ibus-1.5.35/debian/patches/cross.patch      1970-01-01 01:00:00.000000000 
+0100
+++ ibus-1.5.35/debian/patches/cross.patch      2026-11-22 22:04:42.000000000 
+0100
@@ -0,0 +1,40 @@
+--- ibus-1.5.35.orig/meson.build
++++ ibus-1.5.35/meson.build
+@@ -244,6 +244,8 @@
+                                  'import gi; print(gi._overridesdir)',
+                                  check: true).stdout().strip()
+   endif
++else
++  pyoverridesdir = ''
+ endif
+ 
+ # DConf
+@@ -285,20 +287,18 @@
+   # files but Typelib files only.
+   # My understanding is, currently dependency('Dbusmenu-0.4') does not support
+   # Typelib files so I cannot use dependency() but use declare_dependency().
+-  dependency('dbusmenu-glib-0.4', method: 'pkg-config')
+-  dependency('dbusmenu-gtk3-0.4', method: 'pkg-config')
++  dbusmenu_glib_hidden_dep = dependency('dbusmenu-glib-0.4', method: 
'pkg-config')
++  dbusmenu_gtk3_hidden_dep = dependency('dbusmenu-gtk3-0.4', method: 
'pkg-config')
+   dbusmenu_glib_dep = declare_dependency(
+-    compile_args: run_command('pkg-config', '--cflags', 'dbusmenu-glib-0.4',
+-                              check: true).stdout().strip().split(),
+-    link_args: run_command('pkg-config', '--libs', 'dbusmenu-glib-0.4',
+-                           check: true).stdout().strip().split(),
++    dependencies: [dbusmenu_glib_hidden_dep.partial_dependency(
++      compile_args: true, link_args: true
++    )],
+     variables: { 'vala': '--pkg Dbusmenu-0.4' },
+   )
+   dbusmenu_gtk3_dep = declare_dependency(
+-    compile_args: run_command('pkg-config', '--cflags', 'dbusmenu-gtk3-0.4',
+-                              check: true).stdout().strip().split(),
+-    link_args: run_command('pkg-config', '--libs', 'dbusmenu-gtk3-0.4',
+-                           check: true).stdout().strip().split(),
++    dependencies: [dbusmenu_gtk3_hidden_dep.partial_dependency(
++      compile_args: true, link_args: true
++    )],
+     variables: { 'vala': '--pkg DbusmenuGtk3-0.4' },
+   )
+ endif
diff -Nru ibus-1.5.35/debian/patches/series ibus-1.5.35/debian/patches/series
--- ibus-1.5.35/debian/patches/series   2026-11-09 13:09:04.000000000 +0100
+++ ibus-1.5.35/debian/patches/series   2026-11-22 22:04:42.000000000 +0100
@@ -2,3 +2,4 @@
 0003-dconf-Use-dbus-run-session-to-set-up-dconf-overrides.patch
 dconf-Create-a-temporary-XDG_RUNTIME_DIR.patch
 ubuntu-forward-panel-properties.patch
+cross.patch

Reply via email to