Source: mpgtx
Version: 1.3.1-6
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

mpgtx fails to cross build from source, because it uses the build
architecture compiler. ./configure hard codes the use of g++. After
making that substitutable and supplying a triplet-prefixed compiler
proceeds, but fails installing with -s. Deferring the stripping to
dh_strip fixes that and makes -dbgsym packages useful. Then the cross
build succeeds. Please consider applying the attached patch.

Helmut
diff --minimal -Nru mpgtx-1.3.1/debian/changelog mpgtx-1.3.1/debian/changelog
--- mpgtx-1.3.1/debian/changelog        2016-03-16 21:43:10.000000000 +0100
+++ mpgtx-1.3.1/debian/changelog        2017-08-11 06:59:41.000000000 +0200
@@ -1,3 +1,13 @@
+mpgtx (1.3.1-6.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + cross.patch: make compiler subtitutable
+    + Supply a triplet-prefixed CXX
+    + Defer stripping to dh_strip
+
+ -- Helmut Grohne <hel...@subdivi.de>  Fri, 11 Aug 2017 06:59:41 +0200
+
 mpgtx (1.3.1-6) unstable; urgency=low
 
   * Package improvements, thanks to Jari Aalto <jari.aa...@cante.net>.
diff --minimal -Nru mpgtx-1.3.1/debian/patches/45-cross.patch 
mpgtx-1.3.1/debian/patches/45-cross.patch
--- mpgtx-1.3.1/debian/patches/45-cross.patch   1970-01-01 01:00:00.000000000 
+0100
+++ mpgtx-1.3.1/debian/patches/45-cross.patch   2017-08-11 06:58:39.000000000 
+0200
@@ -0,0 +1,16 @@
+From: Helmut Grohne <hel...@subdivi.de>
+Subject: make the chosen compiler subtitutable for cross compilation
+
+Index: mpgtx-1.3.1/configure
+===================================================================
+--- mpgtx-1.3.1.orig/configure
++++ mpgtx-1.3.1/configure
+@@ -9,7 +9,7 @@
+ prefix="/usr/local"
+ manprefix='$(PREFIX)'
+ #compiler flags
+-CC="g++"
++CC="${CXX:-g++}"
+ common_cflags="-Wall"
+ devel_cflags="-g -Werror -fno-builtin"
+ optimization_cflags="-O3"
diff --minimal -Nru mpgtx-1.3.1/debian/patches/series 
mpgtx-1.3.1/debian/patches/series
--- mpgtx-1.3.1/debian/patches/series   2016-03-16 21:22:23.000000000 +0100
+++ mpgtx-1.3.1/debian/patches/series   2017-08-11 06:57:51.000000000 +0200
@@ -5,3 +5,4 @@
 25-fix-crash-missing-audio.patch
 30-g++4.9-fixes.patch
 40-enable-ext-compile-flags.patch
+45-cross.patch
diff --minimal -Nru mpgtx-1.3.1/debian/rules mpgtx-1.3.1/debian/rules
--- mpgtx-1.3.1/debian/rules    2016-03-16 21:12:02.000000000 +0100
+++ mpgtx-1.3.1/debian/rules    2017-08-11 06:59:37.000000000 +0200
@@ -8,6 +8,9 @@
 
 export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+ifeq ($(origin CXX),default)
+CXX = $(DEB_HOST_GNU_TYPE)-g++
+endif
 
 INSTALL = install
 INSTALL_FILE    = $(INSTALL) -p    -o root -g root  -m  644
@@ -20,8 +23,6 @@
 endif
 ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
         confflags += --devel
-else
-        INSTALL_PROGRAM += -s
 endif
 
 DPKG_EXPORT_BUILDFLAGS = 1
@@ -37,7 +38,7 @@
        ln -sf /usr/share/misc/config.guess .
 
        # Add here commands to configure the package.
-       ./configure '$(confflags)' '-prefix=$$(DESTDIR)/usr' 
'-manprefix=$$(DESTDIR)/usr/share'
+       CXX='$(CXX)' ./configure '$(confflags)' '-prefix=$$(DESTDIR)/usr' 
'-manprefix=$$(DESTDIR)/usr/share'
 
        touch configure-stamp
 

Reply via email to