Bug#882536: blockout2 FTCBFS: uses the build architecture compiler

Helmut Grohne helmut at subdivi.de
Thu Nov 23 19:12:08 UTC 2017


Source: blockout2
Version: 2.4+dfsg1-8
Tags: patch
User: helmutg at debian.org
Usertags: rebootstrap

blockout2 fails to cross build from source for three reasons:
 * debian/rules fails to pass cross compilers to the debian/Makefile.
   Using dh_auto_build fixes that.
 * It determines the added flags on the build architecture rather than
   the host architecture.
 * debian/Makefile hard codes the build architecture compiler and
   ignores the substitutions provided by dh_auto_build.

After fixing all of the above, blockout2 cross builds successfully.
Please consider applying the attached patch.

Helmut
-------------- next part --------------
diff --minimal -Nru blockout2-2.4+dfsg1/debian/Makefile blockout2-2.4+dfsg1/debian/Makefile
--- blockout2-2.4+dfsg1/debian/Makefile	2017-07-15 17:50:21.000000000 +0200
+++ blockout2-2.4+dfsg1/debian/Makefile	2017-11-23 19:37:44.000000000 +0100
@@ -19,16 +19,16 @@
 	touch $@
 
 $(TARGET): $(BOBJ) $(IOBJ)
-	g++ $^ -o $@ $(LDFLAGS)
+	$(CXX) $^ -o $@ $(LDFLAGS)
 
 obj/bo/%.o: BlockOut/%.cpp
-	g++ -MMD $(CFLAGS) -c $< -o $@
+	$(CXX) -MMD $(CFLAGS) -c $< -o $@
 
 obj/il/%.o: ImageLib/%.c
-	gcc -MMD $(CFLAGS) -c $< -o $@
+	$(CC) -MMD $(CFLAGS) -c $< -o $@
 
 obj/il/%.o: ImageLib/%.cpp
-	g++ -MMD $(CFLAGS) -c $< -o $@
+	$(CXX) -MMD $(CFLAGS) -c $< -o $@
 
 clean:
 	rm -fr obj
diff --minimal -Nru blockout2-2.4+dfsg1/debian/changelog blockout2-2.4+dfsg1/debian/changelog
--- blockout2-2.4+dfsg1/debian/changelog	2017-07-15 17:50:21.000000000 +0200
+++ blockout2-2.4+dfsg1/debian/changelog	2017-11-23 19:37:44.000000000 +0100
@@ -1,3 +1,13 @@
+blockout2 (2.4+dfsg1-8.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Let dh_auto_build pass cross compilers to make.
+    + Fix build/host confusion in d/rules.
+    + Make compilers in d/Makefile substitutable.
+
+ -- Helmut Grohne <helmut at subdivi.de>  Thu, 23 Nov 2017 19:37:44 +0100
+
 blockout2 (2.4+dfsg1-8) unstable; urgency=medium
 
   * Team upload.
diff --minimal -Nru blockout2-2.4+dfsg1/debian/rules blockout2-2.4+dfsg1/debian/rules
--- blockout2-2.4+dfsg1/debian/rules	2017-07-15 17:50:21.000000000 +0200
+++ blockout2-2.4+dfsg1/debian/rules	2017-11-23 19:37:44.000000000 +0100
@@ -1,15 +1,18 @@
 #!/usr/bin/make -f
 # vim: noet sw=4 ts=4 ai
 
+include /usr/share/dpkg/architecture.mk
+
+BUILD_FLAGS=
+ifeq ($(DEB_HOST_ARCH),amd64)
+BUILD_FLAGS = ADDCFLAGS=-DLOCALTIME64
+endif
+
 %:
 	dh $@
 
 override_dh_auto_build:
-	if test `dpkg-architecture -qDEB_BUILD_ARCH` = amd64; then \
-		$(MAKE) -f debian/Makefile ADDCFLAGS=-DLOCALTIME64; \
-	else \
-		$(MAKE) -f debian/Makefile; \
-	fi
+	dh_auto_build --buildsystem=makefile -- -f debian/Makefile $(BUILD_FLAGS)
 
 override_dh_clean:
 	dh_clean


More information about the Pkg-games-devel mailing list