[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#929345: getstream FTCBFS: builds for the wrong architecture



Source: getstream
Version: 20100616-1
Tags: patch
User: helmutg@debian.org
Usertags: rebootstrap

getstream fails to cross build from source, because it does not pass
cross tools to make. The easiest way of fixing that - using
dh_auto_build - does not entirely fix the issue, because the upstream
Makefile hard codes plain gcc and Makefile.defs.sh hard codes
pkg-config. Substituting the latter is a little difficult, because
dh_auto_build does not pass environment variables, but make variables.
So we need to supply PKG_CONFIG ourselves. The attached patch makes
getstream cross buildable. Please consider applying it.

Helmut
diff --minimal -Nru getstream-20100616/debian/changelog getstream-20100616/debian/changelog
--- getstream-20100616/debian/changelog	2017-01-21 20:32:23.000000000 +0100
+++ getstream-20100616/debian/changelog	2019-05-22 06:00:26.000000000 +0200
@@ -1,3 +1,12 @@
+getstream (20100616-2) UNRELEASED; urgency=medium
+
+  * Fix FTCBFS: (Closes: #-1)
+    + Let dh_auto_build supply cross tools to make.
+    + cross.patch: Make build tools substitutable.
+    + Additionally pass PKG_CONFIG as environment variable.
+
+ -- Helmut Grohne <helmut@subdivi.de>  Wed, 22 May 2019 06:00:26 +0200
+
 getstream (20100616-1) unstable; urgency=medium
 
   * QA upload.
diff --minimal -Nru getstream-20100616/debian/patches/cross.patch getstream-20100616/debian/patches/cross.patch
--- getstream-20100616/debian/patches/cross.patch	1970-01-01 01:00:00.000000000 +0100
+++ getstream-20100616/debian/patches/cross.patch	2019-05-22 06:00:26.000000000 +0200
@@ -0,0 +1,31 @@
+--- getstream-20100616.orig/Makefile.defs.sh
++++ getstream-20100616/Makefile.defs.sh
+@@ -1,8 +1,9 @@
+-echo CFLAGS+=`pkg-config --cflags glib-2.0`
+-echo LDFLAGS+=`pkg-config --libs glib-2.0`
++: "${PKG_CONFIG:=pkg-config}"
++echo CFLAGS+=`${PKG_CONFIG} --cflags glib-2.0`
++echo LDFLAGS+=`${PKG_CONFIG} --libs glib-2.0`
+ 
+-libeventlibs=`pkg-config --libs libevent 2>/dev/null`
+-libeventcflags=`pkg-config --cflags libevent 2>/dev/null`
++libeventlibs=`${PKG_CONFIG} --libs libevent 2>/dev/null`
++libeventcflags=`${PKG_CONFIG} --cflags libevent 2>/dev/null`
+ 
+ if [ -z "${libeventcflags}" ]; then
+ 	libeventcflags=
+--- getstream-20100616.orig/Makefile
++++ getstream-20100616/Makefile
+@@ -26,10 +26,10 @@
+ all: getstream tsdecode
+ 
+ tsdecode: $(OBJ-tsdecode)
+-	gcc -o $@ $+ $(LDFLAGS)
++	$(CC) -o $@ $+ $(LDFLAGS)
+ 
+ getstream: $(OBJ-getstream)
+-	gcc -o $@ $+ $(LDFLAGS) 
++	$(CC) -o $@ $+ $(LDFLAGS) 
+ 
+ clean:
+ 	-rm -f $(OBJ-getstream) $(OBJ-tsdecode)
diff --minimal -Nru getstream-20100616/debian/patches/series getstream-20100616/debian/patches/series
--- getstream-20100616/debian/patches/series	2017-01-21 20:32:23.000000000 +0100
+++ getstream-20100616/debian/patches/series	2019-05-22 06:00:26.000000000 +0200
@@ -2,3 +2,4 @@
 glib-single-include.patch
 0001-Makefile-fix-for-link-as-needed.patch
 0001-Make-building-easier-by-using-pkg-config.patch
+cross.patch
diff --minimal -Nru getstream-20100616/debian/rules getstream-20100616/debian/rules
--- getstream-20100616/debian/rules	2017-01-21 20:32:23.000000000 +0100
+++ getstream-20100616/debian/rules	2019-05-22 06:00:26.000000000 +0200
@@ -1,6 +1,8 @@
 #!/usr/bin/make -f
 #export DH_VERBOSE=1
 
+-include /usr/share/dpkg/buildtools.mk
+export PKG_CONFIG ?= pkg-config
 
 CFLAGS = -Wall -g
 
@@ -9,7 +11,7 @@
 build-stamp: $(DPATCH_STAMPFN)
 	dh_testdir
 
-	$(MAKE)
+	dh_auto_build
 
 	touch $@
 

Reply to: