Bug#930939: etw FTCBFS: multiple reasons

Helmut Grohne helmut at subdivi.de
Sat Jun 22 21:51:40 BST 2019


Source: etw
Version: 3.6+svn162-5
Tags: patch
User: debian-cross at lists.debian.org
Usertags: ftcbfs

etw fails to cross build from source. The immediate cause is not passing
cross tools to make. This is best fixed using dh_auto_build.
Unfortunately, the upstream build system stuffs flags into CC, which get
lost by dh_auto_build overriding them. It also hard codes the build
architecture pkg-config. The attached patch fixes all of that and makes
etw cross buildable. Please consider applying the attached patch.

Helmut
-------------- next part --------------
diff --minimal -Nru etw-3.6+svn162/debian/changelog etw-3.6+svn162/debian/changelog
--- etw-3.6+svn162/debian/changelog	2019-05-01 22:13:04.000000000 +0200
+++ etw-3.6+svn162/debian/changelog	2019-06-22 22:48:02.000000000 +0200
@@ -1,3 +1,13 @@
+etw (3.6+svn162-5.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Let dh_auto_build pass cross tools to make.
+    + cross.patch: Don't stuff flags into CC.
+    + cross.patch: Make pkg-config substitutable.
+
+ -- Helmut Grohne <helmut at subdivi.de>  Sat, 22 Jun 2019 22:48:02 +0200
+
 etw (3.6+svn162-5) unstable; urgency=medium
 
   * Fix Debian bug 928240, segmentation fault on startup.
diff --minimal -Nru etw-3.6+svn162/debian/patches/cross.patch etw-3.6+svn162/debian/patches/cross.patch
--- etw-3.6+svn162/debian/patches/cross.patch	1970-01-01 01:00:00.000000000 +0100
+++ etw-3.6+svn162/debian/patches/cross.patch	2019-06-22 22:47:59.000000000 +0200
@@ -0,0 +1,44 @@
+--- etw-3.6+svn162.orig/etw/Makefile.linux
++++ etw-3.6+svn162/etw/Makefile.linux
+@@ -1,16 +1,17 @@
+-CC = gcc -pthread
++CC = gcc
++PKG_CONFIG ?= pkg-config
+ 
+ CFLAGS = -Wall -g -fPIC -fsigned-char -Iinclude \
+     -Wpointer-arith -Wcast-align -Wcast-qual  -Wno-char-subscripts  -Wshadow \
+     -Waggregate-return  -Wsign-compare \
+-    `pkg-config --cflags sdl` `pkg-config --cflags gtk+-2.0`
++    `$(PKG_CONFIG) --cflags sdl` `$(PKG_CONFIG) --cflags gtk+-2.0`
+ 
+ #CFLAGS += `dpkg-buildflags --get CPPFLAGS`
+ #CFLAGS += `dpkg-buildflags --get CFLAGS`
+ 
+ SLIM = -Wl,--as-needed
+ 
+-LDFLAGS = `pkg-config --libs sdl` `pkg-config --libs gtk+-2.0`
++LDFLAGS = `$(PKG_CONFIG) --libs sdl` `$(PKG_CONFIG) --libs gtk+-2.0`
+ LDFLAGS += `dpkg-buildflags --get LDFLAGS`
+ 
+ DEFINES = -DLINUX -DCD_VERSION -DENABLE_BINRELOC -DHAVE_STDINT_H
+@@ -28,16 +29,16 @@
+ 	highsocket.o prefix.o
+ 
+ .c.o: etw.h menu.h
+-	$(CC) $(CFLAGS) $(DEFINES) -c $<
++	$(CC) -pthread $(CFLAGS) $(DEFINES) -c $<
+ 
+ all: CHECKTOOLS etw
+ 
+ etw: $(OBJECTS)
+-	$(CC) $(SLIM) -o etw $(OBJECTS) $(LDFLAGS)
++	$(CC) -pthread $(SLIM) -o etw $(OBJECTS) $(LDFLAGS)
+ 
+ clean:
+ 	rm -rf etw *.o
+ 
+ CHECKTOOLS:
+-	@pkg-config --cflags sdl >/dev/null 2>&1 || (echo "Error: you need SDL"; exit 1)
+-	@pkg-config --cflags gtk+-2.0 >/dev/null 2>&1 || (echo "Error: you need GTK+2.0"; exit 1)
++	@$(PKG_CONFIG) --cflags sdl >/dev/null 2>&1 || (echo "Error: you need SDL"; exit 1)
++	@$(PKG_CONFIG) --cflags gtk+-2.0 >/dev/null 2>&1 || (echo "Error: you need GTK+2.0"; exit 1)
diff --minimal -Nru etw-3.6+svn162/debian/patches/series etw-3.6+svn162/debian/patches/series
--- etw-3.6+svn162/debian/patches/series	2019-05-01 22:13:04.000000000 +0200
+++ etw-3.6+svn162/debian/patches/series	2019-06-22 22:46:31.000000000 +0200
@@ -5,3 +5,4 @@
 change-configuration-path.patch
 do-not-use-PATH_MAX.patch
 debian-bug-928240.patch
+cross.patch
diff --minimal -Nru etw-3.6+svn162/debian/rules etw-3.6+svn162/debian/rules
--- etw-3.6+svn162/debian/rules	2019-05-01 22:13:04.000000000 +0200
+++ etw-3.6+svn162/debian/rules	2019-06-22 22:47:55.000000000 +0200
@@ -7,7 +7,7 @@
 	dh $@
 
 override_dh_auto_configure:
-	$(MAKE) -C etw
+	dh_auto_build --sourcedirectory=etw
 
 override_dh_installdocs:
 	cp ./web/EatTheWhistle.txt README


More information about the Pkg-games-devel mailing list