Bug#864534: bloboats FTCBFS: uses the build architecture compiler

Helmut Grohne helmut at subdivi.de
Sat Jun 10 06:39:13 UTC 2017


Source: bloboats
Version: 1.0.2+dfsg-2
Tags: patch
User: helmutg at debian.org
Usertags: rebootstrap

bloboats fails to cross build from source, because it uses the build
architecture compiler. Luckily, dh_auto_build knows how to do that and
just using it makes the build almost succeed. Except that make install
relinks the final executable - without a cross compiler. Thus changing
the Makefile target dependencies is in order. After applying the
attached patch, bloboats cross builds successfully. It also builds
faster by avoiding unnecessary rebuilds and by actually honouring
DEB_BUILD_OPTIONS=parallel=... via dh_auto_build. Please consider
applying it after stretch is released.

Helmut
-------------- next part --------------
diff --minimal -Nru bloboats-1.0.2+dfsg/debian/changelog bloboats-1.0.2+dfsg/debian/changelog
--- bloboats-1.0.2+dfsg/debian/changelog	2016-07-10 22:48:24.000000000 +0200
+++ bloboats-1.0.2+dfsg/debian/changelog	2017-06-10 08:25:10.000000000 +0200
@@ -1,3 +1,12 @@
+bloboats (1.0.2+dfsg-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Let dh_auto_build pass cross compilers.
+    + Do not rebuild during make install (cross.patch).
+
+ -- Helmut Grohne <helmut at subdivi.de>  Sat, 10 Jun 2017 08:25:10 +0200
+
 bloboats (1.0.2+dfsg-2) unstable; urgency=medium
 
   * Team upload.
diff --minimal -Nru bloboats-1.0.2+dfsg/debian/patches/cross.patch bloboats-1.0.2+dfsg/debian/patches/cross.patch
--- bloboats-1.0.2+dfsg/debian/patches/cross.patch	1970-01-01 01:00:00.000000000 +0100
+++ bloboats-1.0.2+dfsg/debian/patches/cross.patch	2017-06-10 08:25:10.000000000 +0200
@@ -0,0 +1,33 @@
+From: Helmut Grohne <helmut at subdivi.de>
+Subject: reverse X and X-stamp targets
+
+By having X contain the rules and X-stamp depend on X, X is always run. Thus
+the binary is relinked during make install. This is bad, because
+dh_auto_install doesn't pass cross compilers to make install.
+
+Index: bloboats-1.0.2+dfsg/Makefile
+===================================================================
+--- bloboats-1.0.2+dfsg.orig/Makefile
++++ bloboats-1.0.2+dfsg/Makefile
+@@ -143,8 +143,8 @@
+ all: config-stamp build-stamp
+ 
+ #main: $(OBJ)
+-build-stamp: build
+-build: config-stamp $(OBJ)
++build: build-stamp
++build-stamp: config-stamp $(OBJ)
+ 	mkdir -p bin
+ 	$(CXX) $(LDFLAGS) $(OBJ) $(LIBS) $(CXXFLAGS)
+ 	touch build-stamp
+@@ -155,8 +155,8 @@
+ 	$(CXX) -o bin/$(BINARY) $(OBJ) $(ICON) $(LIBS)
+ 	#$(STRIP) bin/$(BINARY)
+ 
+-config-stamp: config
+-config:
++config: config-stamp
++config-stamp:
+ 	echo "datadir $(DATADIR)" >bloboats.dirs
+ 	echo "privatedir $(PRIVATEDIR)" >>bloboats.dirs
+ 	chmod 644 bloboats.dirs
diff --minimal -Nru bloboats-1.0.2+dfsg/debian/patches/series bloboats-1.0.2+dfsg/debian/patches/series
--- bloboats-1.0.2+dfsg/debian/patches/series	2016-07-10 22:48:24.000000000 +0200
+++ bloboats-1.0.2+dfsg/debian/patches/series	2017-06-10 08:25:10.000000000 +0200
@@ -3,3 +3,4 @@
 03-uint32.patch
 Hardening.patch
 gcc-6-FTBFS.patch
+cross.patch
diff --minimal -Nru bloboats-1.0.2+dfsg/debian/rules bloboats-1.0.2+dfsg/debian/rules
--- bloboats-1.0.2+dfsg/debian/rules	2016-07-10 22:48:24.000000000 +0200
+++ bloboats-1.0.2+dfsg/debian/rules	2017-06-10 08:25:08.000000000 +0200
@@ -5,7 +5,7 @@
 
 
 override_dh_auto_build:
-	$(MAKE) DATADIR=/usr/share/games/bloboats
+	dh_auto_build -- DATADIR=/usr/share/games/bloboats
 
 override_dh_auto_install:
 	$(MAKE) \


More information about the Pkg-games-devel mailing list