Source: muon-meson
Version: 0.5.0-1.1
Tags: patch
User: [email protected]
Usertags: ftcbfs

muon-meson cannot cross build itself. Even upstream uses Python meson
for cross building muon-meson. I suggest doing the same in Debian until
muon-meson gains this capability. Fundamentally, it would need a way to
communicate a build architecture compiler, but presently it understands
neither CC_FOR_BUILD nor --native-file. Please consider applying the
attached patch as a stop-gap solution to be reverted once muon-meson
advances.

Helmut
diff -Nru muon-meson-0.5.0/debian/changelog muon-meson-0.5.0/debian/changelog
--- muon-meson-0.5.0/debian/changelog   2026-02-23 02:17:55.000000000 +0100
+++ muon-meson-0.5.0/debian/changelog   2026-11-02 16:40:18.000000000 +0100
@@ -1,3 +1,10 @@
+muon-meson (0.5.0-1.2) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: Cross build using meson. (Closes: #-1)
+
+ -- Helmut Grohne <[email protected]>  Mon, 02 Nov 2026 16:40:18 +0100
+
 muon-meson (0.5.0-1.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru muon-meson-0.5.0/debian/control muon-meson-0.5.0/debian/control
--- muon-meson-0.5.0/debian/control     2026-02-23 02:15:20.000000000 +0100
+++ muon-meson-0.5.0/debian/control     2026-11-02 16:40:18.000000000 +0100
@@ -13,6 +13,7 @@
  libglib2.0-bin <!nocheck>,
  libglib2.0-dev-bin <!nocheck>,
  libpkgconf-dev (>= 1.9.0),
+ meson <cross>,
  ninja-build,
  pkg-config,
  python3-yaml:native <!nodoc>,
diff -Nru muon-meson-0.5.0/debian/rules muon-meson-0.5.0/debian/rules
--- muon-meson-0.5.0/debian/rules       2026-02-23 02:15:20.000000000 +0100
+++ muon-meson-0.5.0/debian/rules       2026-11-02 16:40:18.000000000 +0100
@@ -5,34 +5,46 @@
 DPKG_EXPORT_BUILDFLAGS := 1
 DPKG_EXPORT_BUILDTOOLS := 1
 
+include /usr/share/dpkg/architecture.mk
 include /usr/share/dpkg/buildflags.mk
 include /usr/share/dpkg/buildtools.mk
 
 %:
        dh $@ --buildsystem=none --builddir=build
 
+configure_flags = \
+       -Dauto_features=enabled \
+       -Dsamurai=disabled \
+       -Dreadline=bestline \
+       -Dtracy=disabled \
+       -Dui=disabled \
+       -Dwebsite=disabled
+
 override_dh_auto_build:
+ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
        CC="$(CC_FOR_BUILD)" CFLAGS="$(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) 
-DBOOTSTRAP_NO_SAMU" LDFLAGS="$(LDFLAGS_FOR_BUILD)" ./bootstrap.sh build
-       build/muon-bootstrap setup \
-               -Dprefix=/usr \
-               -Dauto_features=enabled \
-               -Dwrap_mode=nodownload \
-               -Dsamurai=disabled \
-               -Dreadline=bestline \
-               -Dtracy=disabled \
-               -Dui=disabled \
-               -Dwebsite=disabled \
-               build
+       build/muon-bootstrap setup -Dprefix=/usr -Dwrap_mode=nodownload 
$(configure_flags) build
+else
+       dh_auto_configure --buildsystem=meson -- $(configure_flags)
+endif
        ninja -C build --verbose
 
 # Meson's fs module tests require HOME to be a valid directory
 override_dh_auto_test:
+ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
        mkdir build/home
        HOME=$$(realpath build/home) build/muon -C build test -v
        rm -rf build/home
+else
+       dh_auto_test --buildsystem=meson
+endif
 
 override_dh_auto_install:
+ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
        DESTDIR=$(CURDIR)/debian/muon-meson build/muon -C build install
+else
+       dh_auto_install --buildsystem=meson
+endif
 
 execute_after_dh_auto_install:
        mv debian/muon-meson/usr/bin/muon debian/muon-meson/usr/bin/muon-meson

Reply via email to