Source: freebirth
Version: 0.3.2-9.2
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

freebirth fails to cross build from source, for many reasons:
 * debian/rules does not pass cross tools to make. The easiest way of
   fixing that is deferring it to dh_auto_build.
 * debian/rules uses the build architecture pkg-config and thus fails
   finding gtk-2, which is only requested for the host architecture by
   its Build-Depends. Using dpkg's buildtools.mk can fix that.
 * The upstream build system hard codes the build architecture compiler
   and the build architecture pkg-config in a few places. Making them
   substitutable is the proper solution here.

The attached patch fixes all of that and makes freebirth cross build
successfully. Please consider applying it.

Helmut
diff -u freebirth-0.3.2/Makefile freebirth-0.3.2/Makefile
--- freebirth-0.3.2/Makefile
+++ freebirth-0.3.2/Makefile
@@ -2,9 +2,10 @@
 #
 
 CC=gcc
+PKG_CONFIG ?= pkg-config
 LOADLIBES=-lm -L/usr/lib -lgtk-x11-2.0
-CFLAGS=-g -Wall $(shell pkg-config --cflags gtk+-2.0)
-LDFLAGS=$(LOADLIBES) $(shell pkg-config --libs gtk+-2.0)
+CFLAGS=-g -Wall $(shell $(PKG_CONFIG) --cflags gtk+-2.0)
+LDFLAGS=$(LOADLIBES) $(shell $(PKG_CONFIG) --libs gtk+-2.0)
 
 OFILES=\
 oscillator.o sequencer.o envelope.o filter.o gtkdial.o mixer.o \
@@ -32,5 +33,5 @@
 
 Makefile.deps:
-       gcc -MM $(CFLAGS) $(CFILES) > Makefile.deps
+       $(CC) -MM $(CFLAGS) $(CFILES) > Makefile.deps
 
 include Makefile.deps
diff -u freebirth-0.3.2/debian/changelog freebirth-0.3.2/debian/changelog
--- freebirth-0.3.2/debian/changelog
+++ freebirth-0.3.2/debian/changelog
@@ -1,3 +1,13 @@
+freebirth (0.3.2-9.3) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+   + Let dh_auto_build pass cross tools to make.
+   + Patch build system to allow substituting build tools.
+   + Let dpkg's buildtools.mk supply pkg-config in d/rules.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Thu, 03 May 2018 21:32:18 +0200
+
 freebirth (0.3.2-9.2) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -u freebirth-0.3.2/debian/rules freebirth-0.3.2/debian/rules
--- freebirth-0.3.2/debian/rules
+++ freebirth-0.3.2/debian/rules
@@ -5,8 +5,11 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
-CFLAGS=-g -Wall $(shell pkg-config --cflags gtk+-2.0) $(shell dpkg-buildflags 
--get CFLAGS)
-LDFLAGS=$(shell pkg-config --libs gtk+-2.0) $(shell dpkg-buildflags --get 
LDFLAGS)
+-include /usr/share/dpkg/buildtools.mk
+PKG_CONFIG ?= pkg-config
+
+CFLAGS=-g -Wall $(shell $(PKG_CONFIG) --cflags gtk+-2.0) $(shell 
dpkg-buildflags --get CFLAGS)
+LDFLAGS=$(shell $(PKG_CONFIG) --libs gtk+-2.0) $(shell dpkg-buildflags --get 
LDFLAGS)
 
 # Handle DEB_BUILD_OPTIONS
 ifneq "$(findstring noopt,$(DEB_BUILD_OPTIONS))" ""
@@ -29,7 +32,7 @@
        dh_testdir
 
        # Add here commands to compile the package.
-       $(MAKE) CFLAGS="$(CFLAGS)"
+       dh_auto_build -- CFLAGS="$(CFLAGS)"
        /usr/bin/docbook-to-man debian/freebirth.sgml > debian/freebirth.1
 
        touch build-stamp

Reply via email to