Source: modem-manager-gui
Version: 0.0.19.1-3
Tags: patch
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

modem-manager-gui fails to cross build from source, because it builds
for the build architecture. The home grown configure script doesn't make
any attempt at supporting cross compilation. An easy way to do so is
using exported tool variables such as CC and PKG_CONFIG. The attached
patch implements that as well as exporting the relevant variables.
Please consider applying it. Alternatively, please consider using the
meson build system, which presumably supports cross building out of the
box.

Helmut
diff --minimal -Nru modem-manager-gui-0.0.19.1/debian/changelog 
modem-manager-gui-0.0.19.1/debian/changelog
--- modem-manager-gui-0.0.19.1/debian/changelog 2020-04-25 15:20:23.000000000 
+0200
+++ modem-manager-gui-0.0.19.1/debian/changelog 2020-05-18 16:51:18.000000000 
+0200
@@ -1,3 +1,12 @@
+modem-manager-gui (0.0.19.1-3.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + cross.patch: Make configure pick up cross tools.
+    + Let dpkg's buildtools.mk export cross tools.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Mon, 18 May 2020 16:51:18 +0200
+
 modem-manager-gui (0.0.19.1-3) unstable; urgency=medium
 
   [ Graham Inggs ]
diff --minimal -Nru modem-manager-gui-0.0.19.1/debian/patches/cross.patch 
modem-manager-gui-0.0.19.1/debian/patches/cross.patch
--- modem-manager-gui-0.0.19.1/debian/patches/cross.patch       1970-01-01 
01:00:00.000000000 +0100
+++ modem-manager-gui-0.0.19.1/debian/patches/cross.patch       2020-05-18 
16:51:18.000000000 +0200
@@ -0,0 +1,113 @@
+--- modem-manager-gui-0.0.19.1.orig/configure
++++ modem-manager-gui-0.0.19.1/configure
+@@ -28,6 +28,9 @@
+ spellchecker=1
+ indicator=1
+ 
++: "${CC:=gcc}"
++: "${PKG_CONFIG:=pkg-config}"
++
+ cflags=$CFLAGS
+ if [ "x$cflags" = x ] ; then
+     cflags='-mtune=native -O3'
+@@ -71,7 +74,7 @@
+ 
+ echo -n "Checking dependencies... "
+ 
+-if ! pkg-config --exists 'gtk+-3.0 >= 3.4.0'; then
++if ! "$PKG_CONFIG" --exists 'gtk+-3.0 >= 3.4.0'; then
+       echo "ERROR: Please install GTK+ version 3.4.0 or later with 
development headers."
+       exit 1
+ fi
+@@ -83,12 +86,12 @@
+       fi
+ fi
+ 
+-if ! pkg-config --exists 'ofono >= 1.9'; then
++if ! "$PKG_CONFIG" --exists 'ofono >= 1.9'; then
+       echo "WARNING: oFono plugin won't be built. Please install oFono 
development package for version 1.9 or later if you want better oFono 
experience."
+       ofonoplugin=false
+ fi
+ 
+-if ! pkg-config --exists 'gtkspell3-3.0 >= 3.0.3'; then
++if ! "$PKG_CONFIG" --exists 'gtkspell3-3.0 >= 3.0.3'; then
+       echo "WARNING: Spell checking won't be supported. Please install 
gtkspell library version 3.0.3 or later with development headers if you want to 
use it."
+       spellchecker=0
+ else
+@@ -99,7 +102,7 @@
+       fi      
+ fi
+ 
+-if ! pkg-config --exists 'ayatana-appindicator3-0.1 >= 0.4.92'; then
++if ! "$PKG_CONFIG" --exists 'ayatana-appindicator3-0.1 >= 0.4.92'; then
+       echo "WARNING: Indicator won't be supported. Please install 
ayatana-appindicator library version 0.4.92 or later with development headers 
if you want to use it."
+       indicator=0
+ else
+@@ -115,6 +118,8 @@
+ 
+ echo -n "Generating Makefile_h... "
+ echo "#WARNING: Auto-generated file, edit with care.
++CC := $CC
++PKG_CONFIG := $PKG_CONFIG
+ CFLAGS := $cflags
+ LIBPATH := $libpath
+ PREFIX := $prefix
+--- modem-manager-gui-0.0.19.1.orig/src/Makefile
++++ modem-manager-gui-0.0.19.1/src/Makefile
+@@ -1,13 +1,13 @@
+ include ../Makefile_h
+ 
+ BINDIR    = $(PREFIX)/bin
+-GCC       = gcc
++GCC       = $(CC)
+ ifeq ($(ADDLIBSNAMES),)
+-INC       = `pkg-config --cflags gtk+-3.0 gthread-2.0 gmodule-2.0`
+-LIB       = `pkg-config --libs gtk+-3.0 gthread-2.0 gmodule-2.0` -lgdbm -lm
++INC       = `$(PKG_CONFIG) --cflags gtk+-3.0 gthread-2.0 gmodule-2.0`
++LIB       = `$(PKG_CONFIG) --libs gtk+-3.0 gthread-2.0 gmodule-2.0` -lgdbm -lm
+ else
+-INC       = `pkg-config --cflags gtk+-3.0 gthread-2.0 gmodule-2.0 
$(ADDLIBSNAMES)`
+-LIB       = `pkg-config --libs gtk+-3.0 gthread-2.0 gmodule-2.0 
$(ADDLIBSNAMES)` -lgdbm -lm
++INC       = `$(PKG_CONFIG) --cflags gtk+-3.0 gthread-2.0 gmodule-2.0 
$(ADDLIBSNAMES)`
++LIB       = `$(PKG_CONFIG) --libs gtk+-3.0 gthread-2.0 gmodule-2.0 
$(ADDLIBSNAMES)` -lgdbm -lm
+ endif
+ OBJ       = settings.o strformat.o libpaths.o dbus-utils.o notifications.o 
addressbooks.o ayatana.o smsdb.o trafficdb.o providersdb.o modem-settings.o 
ussdlist.o encoding.o vcard.o netlink.o polkit.o svcmanager.o mmguicore.o 
contacts-page.o traffic-page.o scan-page.o info-page.o ussd-page.o sms-page.o 
devices-page.o preferences-window.o welcome-window.o connection-editor-window.o 
main.o
+ 
+--- modem-manager-gui-0.0.19.1.orig/src/modules/Makefile
++++ modem-manager-gui-0.0.19.1/src/modules/Makefile
+@@ -1,12 +1,12 @@
+ include ../../Makefile_h
+ 
+-GCCMOD     = gcc -fPIC
+-GCCLMOD    = gcc -shared
+-INCMOD     = `pkg-config --cflags glib-2.0` `pkg-config --cflags  
gmodule-2.0` `pkg-config --cflags gio-2.0`
+-LIBMOD     = `pkg-config --libs glib-2.0` `pkg-config --libs gmodule-2.0` 
`pkg-config --libs gio-2.0`
+-LIBMOD1    = `pkg-config --libs glib-2.0` `pkg-config --libs gmodule-2.0` 
`pkg-config --libs gio-2.0` -lgdbm -lm
+-LIBMOD2    = `pkg-config --libs glib-2.0` `pkg-config --libs gmodule-2.0` 
`pkg-config --libs gio-2.0` -lgdbm -lm
+-LIBMOD5    = `pkg-config --libs glib-2.0` `pkg-config --libs gmodule-2.0` 
`pkg-config --libs gio-2.0` -lgdbm -lrt -lm
++GCCMOD     = $(CC) -fPIC
++GCCLMOD    = $(CC) -shared
++INCMOD     = `$(PKG_CONFIG) --cflags glib-2.0` `$(PKG_CONFIG) --cflags  
gmodule-2.0` `$(PKG_CONFIG) --cflags gio-2.0`
++LIBMOD     = `$(PKG_CONFIG) --libs glib-2.0` `$(PKG_CONFIG) --libs 
gmodule-2.0` `$(PKG_CONFIG) --libs gio-2.0`
++LIBMOD1    = `$(PKG_CONFIG) --libs glib-2.0` `$(PKG_CONFIG) --libs 
gmodule-2.0` `$(PKG_CONFIG) --libs gio-2.0` -lgdbm -lm
++LIBMOD2    = `$(PKG_CONFIG) --libs glib-2.0` `$(PKG_CONFIG) --libs 
gmodule-2.0` `$(PKG_CONFIG) --libs gio-2.0` -lgdbm -lm
++LIBMOD5    = `$(PKG_CONFIG) --libs glib-2.0` `$(PKG_CONFIG) --libs 
gmodule-2.0` `$(PKG_CONFIG) --libs gio-2.0` -lgdbm -lrt -lm
+ OBJMOD1    = smsdb.o encoding.o dbus-utils.o mm06.o
+ OBJMOD2    = smsdb.o encoding.o dbus-utils.o mm07.o
+ OBJMOD3    = uuid.o nm09.o
+--- modem-manager-gui-0.0.19.1.orig/src/plugins/Makefile
++++ modem-manager-gui-0.0.19.1/src/plugins/Makefile
+@@ -1,9 +1,9 @@
+ include ../../Makefile_h
+ 
+-GCCMOD        = gcc -fPIC
+-GCCLMOD       = gcc -shared
+-INCMOD        = `pkg-config --cflags glib-2.0 ofono`
+-OFONOLIBMOD   = `pkg-config --libs glib-2.0` -lgdbm -lrt
++GCCMOD        = $(CC) -fPIC
++GCCLMOD       = $(CC) -shared
++INCMOD        = `$(PKG_CONFIG) --cflags glib-2.0 ofono`
++OFONOLIBMOD   = `$(PKG_CONFIG) --libs glib-2.0` -lgdbm -lrt
+ OFONOOBJMOD   = ofonohistory.o
+ OFONOLIBDIR   = $(LIBPATH)/ofono/plugins/
+ FILES_OFONO:= $(wildcard libmmgui-ofono*.so)
diff --minimal -Nru modem-manager-gui-0.0.19.1/debian/patches/series 
modem-manager-gui-0.0.19.1/debian/patches/series
--- modem-manager-gui-0.0.19.1/debian/patches/series    2020-04-24 
16:44:29.000000000 +0200
+++ modem-manager-gui-0.0.19.1/debian/patches/series    2020-05-18 
16:47:35.000000000 +0200
@@ -1,3 +1,4 @@
 fix-wrong-strsep-usage.patch
 fix-strftime-segfaults.patch
 ayatana-appindicator.patch
+cross.patch
diff --minimal -Nru modem-manager-gui-0.0.19.1/debian/rules 
modem-manager-gui-0.0.19.1/debian/rules
--- modem-manager-gui-0.0.19.1/debian/rules     2020-04-24 16:33:17.000000000 
+0200
+++ modem-manager-gui-0.0.19.1/debian/rules     2020-05-18 16:51:18.000000000 
+0200
@@ -2,6 +2,9 @@
 export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed
 export DEB_BUILD_MAINT_OPTIONS=hardening=+all
 
+DPKG_EXPORT_BUILDTOOLS=1
+-include /usr/share/dpkg/buildtools.mk
+
 %:
        dh $@
 

Reply via email to