Source: mah-jong Version: 1.11-2 Tags: patch User: helm...@debian.org Usertags: rebootstrap
mah-jong fails to cross build from source, because it uses the build architecture toolchain. Using dh_auto_build mostly fixes that except for bare pkg-config invocations in the upstream Makefile. After making them substitutable as well, mah-jong cross builds successfully. Please consider applying the attached patch. Helmut
diff --minimal -Nru mah-jong-1.11/debian/changelog mah-jong-1.11/debian/changelog --- mah-jong-1.11/debian/changelog 2012-01-03 00:31:10.000000000 +0100 +++ mah-jong-1.11/debian/changelog 2018-06-13 20:10:04.000000000 +0200 @@ -1,3 +1,12 @@ +mah-jong (1.11-2.1) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * Fix FTCBFS: (Closes: #-1) + + Let dh_auto_build pass cross tools to make. + + cross.patch: Make pkg-config substitutable. + + -- Helmut Grohne <hel...@subdivi.de> Wed, 13 Jun 2018 20:10:04 +0200 + mah-jong (1.11-2) unstable; urgency=low * Switch to dpkg-source 3.0 (quilt) format. diff --minimal -Nru mah-jong-1.11/debian/patches/cross.patch mah-jong-1.11/debian/patches/cross.patch --- mah-jong-1.11/debian/patches/cross.patch 1970-01-01 01:00:00.000000000 +0100 +++ mah-jong-1.11/debian/patches/cross.patch 2018-06-13 20:09:42.000000000 +0200 @@ -0,0 +1,31 @@ +--- mah-jong-1.11.orig/Makefile ++++ mah-jong-1.11/Makefile +@@ -67,6 +67,7 @@ + + # It's best to use gcc if you can. + CC = gcc ++PKG_CONFIG ?= pkg-config + + # C debugging and optimization flags. + # In development, we turn on all reasonable warnings. +@@ -141,9 +142,9 @@ + ifdef Win32 + ifdef Gtk + # should be the same as unix, if it can find pkg-config +-EXTRA_INCLUDES=$(shell pkg-config --cflags gtk+-$(Gtk)) ++EXTRA_INCLUDES=$(shell $(PKG_CONFIG) --cflags gtk+-$(Gtk)) + # We also add the flag that makes xmj.exe be a GUI program +-GUILIBS=$(shell pkg-config --libs gtk+-$(Gtk)) -mwindows ++GUILIBS=$(shell $(PKG_CONFIG) --libs gtk+-$(Gtk)) -mwindows + else + # You'll need to say explicitly where they are, as here, which is + # a bit of a mess in my setup +@@ -154,7 +155,7 @@ + else + # Not Windows. If gtk+ is properly installed, this is all that's needed. + ifdef Gtk +-EXTRA_INCLUDES=`pkg-config --cflags gtk+-$(Gtk)` ++EXTRA_INCLUDES=`$(PKG_CONFIG) --cflags gtk+-$(Gtk)` + GUILIBS=-lgtk-x11-2.0 -lgdk-x11-2.0 -lgobject-2.0 -lglib-2.0 -lm + else + EXTRA_INCLUDES=`gtk-config --cflags` diff --minimal -Nru mah-jong-1.11/debian/patches/series mah-jong-1.11/debian/patches/series --- mah-jong-1.11/debian/patches/series 2012-01-03 00:12:02.000000000 +0100 +++ mah-jong-1.11/debian/patches/series 2018-06-13 20:09:18.000000000 +0200 @@ -3,3 +3,4 @@ extra_gui_libraries manpage_cleanup autogenerated_files +cross.patch diff --minimal -Nru mah-jong-1.11/debian/rules mah-jong-1.11/debian/rules --- mah-jong-1.11/debian/rules 2012-01-03 00:29:08.000000000 +0100 +++ mah-jong-1.11/debian/rules 2018-06-13 20:10:02.000000000 +0200 @@ -25,7 +25,7 @@ build-arch: build-stamp build-stamp: dh_testdir - $(MAKE) CCOPTIONS=$(CCOPTIONS) CDEBUGFLAGS="-g" TILESETPATH=\""/usr/share/mah-jong"\" + dh_auto_build -- CCOPTIONS=$(CCOPTIONS) CDEBUGFLAGS="-g" TILESETPATH=\""/usr/share/mah-jong"\" touch build-stamp clean: