Source: pdp
Version: 1:0.14.1+darcs20180201-1
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

pdp fails to cross build from source. The immediate failure is a
confusion of build and host architecture in debian/rules. Refer to man
dpkg-architecture for a description. Ultimately, it tries to pass -mmmx
to a mips64el compiler that wonders whether you maybe meant -mdmx. Then
the various Makefile subprojects don't receive cross toolchains. Using
dh_auto_build fixes that. The attached patch makes pdp cross buildable.
Please consider applying it.

Helmut
diff --minimal -Nru pdp-0.14.1+darcs20180201/debian/changelog 
pdp-0.14.1+darcs20180201/debian/changelog
--- pdp-0.14.1+darcs20180201/debian/changelog   2018-02-06 14:48:40.000000000 
+0100
+++ pdp-0.14.1+darcs20180201/debian/changelog   2018-10-30 06:20:05.000000000 
+0100
@@ -1,3 +1,12 @@
+pdp (1:0.14.1+darcs20180201-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Fix build/host confusion.
+    + Let dh_auto_build pass cross tools to make.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Tue, 30 Oct 2018 06:20:05 +0100
+
 pdp (1:0.14.1+darcs20180201-1) unstable; urgency=medium
 
   * New upstream version 0.14.1+darcs20180201
diff --minimal -Nru pdp-0.14.1+darcs20180201/debian/rules 
pdp-0.14.1+darcs20180201/debian/rules
--- pdp-0.14.1+darcs20180201/debian/rules       2018-02-06 14:48:40.000000000 
+0100
+++ pdp-0.14.1+darcs20180201/debian/rules       2018-10-30 06:20:05.000000000 
+0100
@@ -3,16 +3,11 @@
 export PDP_EXTRA_CFLAGS = -fPIC -Wno-error $(CPPFLAGS) $(CFLAGS)
 DPKG_EXPORT_BUILDFLAGS = 1
 export DEB_BUILD_MAINT_OPTIONS=hardening=+all
+include /usr/share/dpkg/architecture.mk
 include /usr/share/dpkg/buildflags.mk
 
 
-ifeq ($(DEB_BUILD_ARCH),i386)
-DEB_CONFIGURE_EXTRA_FLAGS = --enable-mmx
-DEB_EXTRA_CFLAGS = -mmmx
-BUILD_SCAF = yes
-endif
-
-ifeq ($(DEB_BUILD_ARCH),amd64)
+ifneq ($(filter amd64 i386,$(DEB_HOST_ARCH)),)
 DEB_CONFIGURE_EXTRA_FLAGS = --enable-mmx
 DEB_EXTRA_CFLAGS = -mmmx
 BUILD_SCAF = yes
@@ -29,17 +24,17 @@
        dh_auto_configure -Dscaf -- $(DEB_CONFIGURE_EXTRA_FLAGS)
 
 override_dh_auto_build:
-       make pdp_all
-       make -C opengl \
+       dh_auto_build -- pdp_all
+       dh_auto_build --buildsystem=makefile --sourcedirectory=opengl -- \
                LDFLAGS="$(LDFLAGS)" \
                PDP_EXTRA_CFLAGS="$(CFLAGS) $(DEB_EXTRA_CFLAGS)" \
                PDP_EXTRA_CPPFLAGS="$(CPPFLAGS)"
-       [ -z $(BUILD_SCAF) ] || \
-       make -C scaf \
+ifneq ($(BUILD_SCAF),)
+       dh_auto_build --sourcedirectory=scaf -- \
                LDFLAGS="-fPIC $(LDFLAGS)" \
                PDP_CFLAGS="$(CPPFLAGS) -fPIC $(CFLAGS)"
-       [ -z $(BUILD_SCAF) ] || \
        cp scaf/rules/carules.scafo scaf/rules/default.scafo
+endif
        docbook-to-man debian/pdp-config.sgml > pdp-config.1
 
 override_dh_auto_clean:

Reply via email to