Source: kluppe
Version: 0.6.20-1.1
Tags: patch
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

kluppe fails to cross build from source. The immediate cause is not
passing cross tools to make. The easiest way of doing so is using
dh_auto_build. Once doing that, one notices that the upstream Makefiles
hard code the build architecture pkg-config. After making it
substitutable, the dh_auto_build step passes, but it fails during make
install as no cross tools are passed there and it insists on relinking
everything. That unconditional relinking is unnecessary and after
removing it, kluppe cross builds. Please consider applying the attached
patch.

Helmut
diff --minimal -Nru kluppe-0.6.20/debian/changelog 
kluppe-0.6.20/debian/changelog
--- kluppe-0.6.20/debian/changelog      2017-05-27 10:41:28.000000000 +0200
+++ kluppe-0.6.20/debian/changelog      2020-09-05 07:31:44.000000000 +0200
@@ -1,3 +1,13 @@
+kluppe (0.6.20-1.2) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Let dh_auto_build pass cross tools to make.
+    + cross.patch: Make pkg-config substitutable
+    + cross.patch: Don't force a rebuild during make install.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Sat, 05 Sep 2020 07:31:44 +0200
+
 kluppe (0.6.20-1.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff --minimal -Nru kluppe-0.6.20/debian/patches/cross.patch 
kluppe-0.6.20/debian/patches/cross.patch
--- kluppe-0.6.20/debian/patches/cross.patch    1970-01-01 01:00:00.000000000 
+0100
+++ kluppe-0.6.20/debian/patches/cross.patch    2020-09-05 07:31:44.000000000 
+0200
@@ -0,0 +1,34 @@
+--- kluppe-0.6.20.orig/src/frontend/kluppe/Makefile
++++ kluppe-0.6.20/src/frontend/kluppe/Makefile
+@@ -1,3 +1,4 @@
++PKG_CONFIG ?= pkg-config
+ BIN_DIR = $(INSTALL_PREFIX)/bin
+ PIXMAPS_DIR = $(INSTALL_PREFIX)/share/pixmaps
+ MAN_DIR = $(INSTALL_PREFIX)/share/man/man1
+@@ -5,10 +6,10 @@
+ TARGETS = $(SOURCES:.c=.o)
+ 
+ kluppe: $(TARGETS) 
+-      $(CC) -DPIXMAPS_DIR=\"$(PIXMAPS_DIR)\" *.o ../../common/*.o -o kluppe 
$(LDFLAGS) `pkg-config gtk+-2.0 gthread-2.0 libusb alsa jack sndfile liblo 
libxml-2.0 --libs gthread-2.0` -lm
++      $(CC) -DPIXMAPS_DIR=\"$(PIXMAPS_DIR)\" *.o ../../common/*.o -o kluppe 
$(LDFLAGS) `$(PKG_CONFIG) gtk+-2.0 gthread-2.0 libusb alsa jack sndfile liblo 
libxml-2.0 --libs gthread-2.0` -lm
+ 
+ .c.o: 
+-      $(CC) -DPIXMAPS_DIR=\"$(PIXMAPS_DIR)\" -c -o $@ $*.c $(CFLAGS) 
`pkg-config gtk+-2.0 --cflags` `xml2-config --cflags`
++      $(CC) -DPIXMAPS_DIR=\"$(PIXMAPS_DIR)\" -c -o $@ $*.c $(CFLAGS) 
`$(PKG_CONFIG) gtk+-2.0 --cflags` `xml2-config --cflags`
+ 
+ 
+ 
+--- kluppe-0.6.20.orig/Makefile
++++ kluppe-0.6.20/Makefile
+@@ -10,11 +10,9 @@
+ export 
+ 
+ kluppe: commons 
+-      rm -f src/frontend/kluppe/kluppe.o 
+       cd src/frontend/kluppe && $(MAKE)
+ 
+ klopfer: commons
+-      rm -f src/frontend/klopfer/klopfer.o
+       cd src/frontend/klopfer && $(MAKE)
+ 
+ commons:
diff --minimal -Nru kluppe-0.6.20/debian/patches/series 
kluppe-0.6.20/debian/patches/series
--- kluppe-0.6.20/debian/patches/series 2017-05-27 10:41:28.000000000 +0200
+++ kluppe-0.6.20/debian/patches/series 2020-09-05 07:31:03.000000000 +0200
@@ -5,3 +5,4 @@
 70_cflags.diff
 80_manpage_email.diff
 90_gtkmeter_truncated_pointer.diff
+cross.patch
diff --minimal -Nru kluppe-0.6.20/debian/rules kluppe-0.6.20/debian/rules
--- kluppe-0.6.20/debian/rules  2016-11-25 17:12:31.000000000 +0100
+++ kluppe-0.6.20/debian/rules  2020-09-05 07:31:44.000000000 +0200
@@ -9,7 +9,7 @@
        dh $@
 
 override_dh_auto_build:
-       $(MAKE) CFLAGS="$(CFLAGS)" INSTALL_PREFIX=/usr
+       dh_auto_build -- CFLAGS="$(CFLAGS)" INSTALL_PREFIX=/usr
 
 override_dh_auto_clean:
        [ ! -f Makefile ] || $(MAKE) clean INSTALL_PREFIX=/usr

Reply via email to