Source: gkrellmwireless
Version: 2.0.3-1.1
Tags: patch
User: [email protected]
Usertags: rebootstrap

gkrellmwireless fails to cross build from source. The immediate problem
is that it doesn't pass cross tools to make. dh_auto_build fixes that,
but the upstream Makefile doesn't pick up $(PKG_CONFIG) and uses the
build architecture pkg-config instead. After fixing that, one notices
that it lost its CFLAGS, because it stuffs the CFLAGS into $(CC), but
dh_auto_build replaces that. Even after fixing that, it continues to
fail while calling install with -s. It uses the wrong strip here, which
not only breaks cross building, but also generation of a -dbgsym package
as well as DEB_BUILD_OPTIONS=nostrip (aka #437038). The attached patch
fixes all of that. Please consider applying it.

Helmut
diff -u gkrellmwireless-2.0.3/debian/changelog 
gkrellmwireless-2.0.3/debian/changelog
--- gkrellmwireless-2.0.3/debian/changelog
+++ gkrellmwireless-2.0.3/debian/changelog
@@ -1,3 +1,14 @@
+gkrellmwireless (2.0.3-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 stuff flags into $(CC).
+    + Defer stripping to dh_strip.
+
+ -- Helmut Grohne <[email protected]>  Tue, 27 Nov 2018 19:47:27 +0100
+
 gkrellmwireless (2.0.3-1.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -u gkrellmwireless-2.0.3/debian/rules gkrellmwireless-2.0.3/debian/rules
--- gkrellmwireless-2.0.3/debian/rules
+++ gkrellmwireless-2.0.3/debian/rules
@@ -24,7 +24,7 @@
        dh_testdir
 
        # Add here commands to compile the package.
-       $(MAKE)
+       dh_auto_build
        touch build-stamp
 
 clean:
@@ -44,7 +44,7 @@
 
        # Add here commands to install the package into debian/tmp.
        # $(MAKE) install DESTDIR=`pwd`/debian/tmp
-       install -c -s -m 755 wireless.so 
`pwd`/debian/gkrellmwireless/usr/lib/gkrellm2/plugins
+       install -c -m 755 wireless.so 
`pwd`/debian/gkrellmwireless/usr/lib/gkrellm2/plugins
 
 # Build architecture-independent files here.
 binary-indep: build install
only in patch2:
unchanged:
--- gkrellmwireless-2.0.3.orig/Makefile
+++ gkrellmwireless-2.0.3/Makefile
@@ -1,15 +1,16 @@
 # Depends on gmake..
 #
 OS = $(shell uname)
+PKG_CONFIG ?= pkg-config
 
 ifeq ($(OS),FreeBSD)
-       GTK_CONFIG = pkg-config gtk+-2.0
+       GTK_CONFIG = $(PKG_CONFIG) gtk+-2.0
        INCLUDE = -I/usr/src/sys
 elseif eq ($(OS),NetBSD)
-       GTK_CONFIG = pkg-config gtk+-2.0
+       GTK_CONFIG = $(PKG_CONFIG) gtk+-2.0
 else
 # default to the linux 
-       GTK_CONFIG = pkg-config gtk+-2.0
+       GTK_CONFIG = $(PKG_CONFIG) gtk+-2.0
 endif
 
 
@@ -19,8 +20,9 @@
 FLAGS = -O2 -Wall -fPIC $(GTK_CFLAGS) $(GKRELLM_INCLUDE)
 LIBS = $(GTK_LIB)
 LFLAGS = -shared
+CFLAGS += $(FLAGS)
 
-CC = gcc $(CFLAGS) $(FLAGS)
+CC = gcc
 
 OBJS = wireless.o
 
@@ -32,7 +34,7 @@
 all:   wireless.so
 
 wireless.so: $(OBJS)
-       $(CC) $(OBJS) -o wireless.so $(LFLAGS) $(LIBS)
+       $(CC) $(CFLAGS) $(OBJS) -o wireless.so $(LFLAGS) $(LIBS)
 
 clean:
        rm -f *.o core *.so* *.bak *~

Reply via email to