Source: onscripter
Version: 20190527-1
Tags: patch
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

onscripter fails to cross build from source, because it uses build
architecture build tools. In debian/rules, pkg-config is hard coded.
Seeding pkg-config from dpkg's buildtools.mk is the common way to fix
that. Then it fails to pass cross tools to Makefile.Linux. We cannot
easily rely on dh_auto_build doing this, because it uses non standard
variables. CC usually contains the C compiler, but onscripter stores a
C++ compiler there. Thus the attached patch also constructs these values
explicitly. Please consider applying it.

Helmut
diff --minimal -Nru onscripter-20190527/debian/changelog 
onscripter-20190527/debian/changelog
--- onscripter-20190527/debian/changelog        2019-07-07 05:31:57.000000000 
+0200
+++ onscripter-20190527/debian/changelog        2019-07-14 12:00:43.000000000 
+0200
@@ -1,3 +1,10 @@
+onscripter (20190527-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: Seed build tools from dpkg's buildtools.mk. (Closes: #-1)
+
+ -- Helmut Grohne <hel...@subdivi.de>  Sun, 14 Jul 2019 12:00:43 +0200
+
 onscripter (20190527-1) unstable; urgency=low
 
   * New upstream release
diff --minimal -Nru onscripter-20190527/debian/control 
onscripter-20190527/debian/control
--- onscripter-20190527/debian/control  2018-12-05 05:58:52.000000000 +0100
+++ onscripter-20190527/debian/control  2019-07-14 12:00:22.000000000 +0200
@@ -2,7 +2,7 @@
 Section: games
 Priority: optional
 Maintainer: Ying-Chun Liu (PaulLiu) <paul...@debian.org>
-Build-Depends: debhelper (>= 11), docbook-to-man,
+Build-Depends: debhelper (>= 11), docbook-to-man, dpkg-dev (>= 1.19.0),
                libsdl1.2-dev, libavifile-0.7-dev,
                libsdl-image1.2-dev, libsdl-mixer1.2-dev, libsdl-ttf2.0-dev,
                libbz2-dev, libjpeg-dev, liblua5.2-dev, libfontconfig1-dev,
diff --minimal -Nru onscripter-20190527/debian/rules 
onscripter-20190527/debian/rules
--- onscripter-20190527/debian/rules    2018-11-06 08:09:31.000000000 +0100
+++ onscripter-20190527/debian/rules    2019-07-14 12:00:43.000000000 +0200
@@ -9,6 +9,8 @@
 DEB_FONTCONFIG_FLAG := $(findstring ok installed,$(shell dpkg-query -W 
-f='$${Status}' libfontconfig1-dev))
 DEB_LUA_FLAG        := $(findstring ok installed,$(shell dpkg-query -W 
-f='$${Status}' liblua5.2-dev))
 
+include /usr/share/dpkg/buildtools.mk
+
 M_CFLAGS = $(shell dpkg-buildflags --get CFLAGS) $(shell dpkg-buildflags --get 
CPPFLAGS) -Wall
 M_LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
 
@@ -26,8 +28,8 @@
 else
 # Use mad if it is installed
 ifneq (,$(DEB_MP3MAD_FLAG))
-CONFINCS += `pkg-config --cflags mad`
-CONFLIBS += `pkg-config --libs mad`
+CONFINCS += `$(PKG_CONFIG) --cflags mad`
+CONFLIBS += `$(PKG_CONFIG) --libs mad`
 CONFDEFS += -DMP3_MAD
 endif
 endif
@@ -47,23 +49,23 @@
 CONFDEFS += -DUSE_OGG_VORBIS -DINTEGER_OGG_VORBIS
 else
 ifneq (,$(DEB_VORBIS_FLAG))
-CONFINCS += `pkg-config --cflags vorbisfile`
-CONFLIBS += `pkg-config --libs vorbisfile`
+CONFINCS += `$(PKG_CONFIG) --cflags vorbisfile`
+CONFLIBS += `$(PKG_CONFIG) --libs vorbisfile`
 CONFDEFS += -DUSE_OGG_VORBIS
 endif
 endif
 
 # Use fontconfig if it is installed
 ifneq (,$(DEB_FONTCONFIG_FLAG))
-CONFINCS += `pkg-config --cflags fontconfig`
-CONFLIBS += `pkg-config --libs fontconfig`
+CONFINCS += `$(PKG_CONFIG) --cflags fontconfig`
+CONFLIBS += `$(PKG_CONFIG) --libs fontconfig`
 CONFDEFS += -DUSE_FONTCONFIG
 endif
 
 # Use lua if it is installed
 ifneq (,$(DEB_LUA_FLAG))
-CONFINCS += `pkg-config --cflags lua5.2`
-CONFLIBS += `pkg-config --libs lua5.2`
+CONFINCS += `$(PKG_CONFIG) --cflags lua5.2`
+CONFLIBS += `$(PKG_CONFIG) --libs lua5.2`
 CONFDEFS += -DUSE_LUA
 CONFEXT_OBJS += LUAHandler.o
 endif
@@ -87,6 +89,7 @@
        $(MAKE) DEFS="$(CONFDEFS) -DENABLE_1BYTE_CHAR -DFORCE_1BYTE_CHAR" \
                INCS="$(CONFINCS)" LIBS="$(CONFLIBS)" \
                TARGET="$(CONFTARGET)" EXT_OBJS="$(CONFEXT_OBJS)" \
+               'CC=$(CXX)' 'LD=$(CXX) -o' \
                -f Makefile.Linux
        if test ! -e onscripter-1byte; then \
                cp -f onscripter onscripter-1byte; \
@@ -94,6 +97,7 @@
        $(MAKE) -f Makefile.Linux clean
        $(MAKE) DEFS="$(CONFDEFS)" INCS="$(CONFINCS)" LIBS="$(CONFLIBS)" \
                TARGET="$(CONFTARGET)" EXT_OBJS="$(CONFEXT_OBJS)" \
+               'CC=$(CXX)' 'LD=$(CXX) -o' \
                -f Makefile.Linux
 
 override_dh_auto_clean:

Reply via email to