Source: gkrellshoot
Version: 0.4.4-2
Tags: patch
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

gkrellshoot fails to cross build from source. The immediate reason is
passing compiler flags inside the CC variable as that gets substituted
by dh_auto_build during cross compilation. Then the compiler flags are
constructed using the build architecture pkg-config as it is hard coded
in the upstream Makefile. Finally, make install strips using the build
architecture strip via install -s. Doing so also breaks generation of
-dbgsym packages as well as DEB_BUILD_OPTIONS=nostrip. The attached
patch fixes all of that. Please consider applying it.

Helmut
diff --minimal -Nru gkrellshoot-0.4.4/debian/changelog 
gkrellshoot-0.4.4/debian/changelog
--- gkrellshoot-0.4.4/debian/changelog  2016-11-14 03:55:43.000000000 +0100
+++ gkrellshoot-0.4.4/debian/changelog  2020-04-19 18:00:25.000000000 +0200
@@ -1,3 +1,13 @@
+gkrellshoot (0.4.4-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Don't pass compiler flags via CC.
+    + Make pkg-config substitutable.
+    + Defer stripping to dh_strip.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Sun, 19 Apr 2020 18:00:25 +0200
+
 gkrellshoot (0.4.4-2) unstable; urgency=medium
 
   * Changed maintainer's email address.
diff --minimal -Nru gkrellshoot-0.4.4/debian/patches/cross.patch 
gkrellshoot-0.4.4/debian/patches/cross.patch
--- gkrellshoot-0.4.4/debian/patches/cross.patch        1970-01-01 
01:00:00.000000000 +0100
+++ gkrellshoot-0.4.4/debian/patches/cross.patch        2020-04-19 
18:00:25.000000000 +0200
@@ -0,0 +1,36 @@
+--- gkrellshoot-0.4.4.orig/Makefile
++++ gkrellshoot-0.4.4/Makefile
+@@ -1,17 +1,19 @@
+-GTK_INCLUDE = `pkg-config gtk+-2.0 --cflags`
+-GTK_LIB = `pkg-config gtk+-2.0 --libs`
++PKG_CONFIG ?= pkg-config
++GTK_INCLUDE = `$(PKG_CONFIG) gtk+-2.0 --cflags`
++GTK_LIB = `$(PKG_CONFIG) gtk+-2.0 --libs`
+ 
+-FLAGS = -O2 -Wall $(GTK_INCLUDE) 
++CFLAGS += -O2 -Wall $(GTK_INCLUDE) 
+ LIBS = $(GTK_LIB)
+ CFLAGS += -fPIC
+ LDFLAGS += -shared
+ 
+-CC = gcc $(FLAGS)
++CC = gcc
++INSTALL ?= install
+ 
+ OBJS = gkrellshoot.o
+ 
+ gkrellshoot.so: $(OBJS)
+-      $(CC) $(OBJS) -o gkrellshoot.so $(LDFLAGS) $(LIBS) 
++      $(CC) $(CFLAGS) $(OBJS) -o gkrellshoot.so $(LDFLAGS) $(LIBS) 
+ 
+ clean:
+       rm -f *.o core *.so* *.bak *~
+@@ -19,7 +21,7 @@
+ gkrellshoot.o: gkrellshoot.c
+ 
+ install:
+-      install -D -p -s -m 644 gkrellshoot.so 
$(DESTDIR)/usr/lib/gkrellm2/plugins/gkrellshoot.so
++      $(INSTALL) -D -p -s -m 644 gkrellshoot.so 
$(DESTDIR)/usr/lib/gkrellm2/plugins/gkrellshoot.so
+ 
+ uninstall:
+       rm -f $(DESTDIR)/usr/lib/gkrellm2/plugins/gkrellshoot.so
diff --minimal -Nru gkrellshoot-0.4.4/debian/patches/series 
gkrellshoot-0.4.4/debian/patches/series
--- gkrellshoot-0.4.4/debian/patches/series     2016-11-14 03:55:43.000000000 
+0100
+++ gkrellshoot-0.4.4/debian/patches/series     2020-04-19 18:00:08.000000000 
+0200
@@ -1 +1,2 @@
 install.patch
+cross.patch
diff --minimal -Nru gkrellshoot-0.4.4/debian/rules 
gkrellshoot-0.4.4/debian/rules
--- gkrellshoot-0.4.4/debian/rules      2016-04-17 02:42:59.000000000 +0200
+++ gkrellshoot-0.4.4/debian/rules      2020-04-19 18:00:25.000000000 +0200
@@ -7,3 +7,6 @@
 
 %:
        dh $@
+
+override_dh_auto_install:
+       dh_auto_install -- INSTALL='install --strip-program=true'

Reply via email to