Source: gkrellm-radio
Version: 2.0.4-1.2
Tags: patch
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

gkrellm-radio fails to build from source, because it does not pass cross
tools to make. Even when doing so (e.g. via dh_auto_build), it uses the
build architecture pkg-config as it does not use a common substitution.
After fixing that, it strips with the build architecture strip, which
also happens to break the nostrip option (#437031) as well as generation
of -dbgsym packages. Skipping such upstream stripping and deferring it
to dh_strip is usually best. Please consider applying the attached patch
to fix all mentioned issues.

Helmut
diff -u gkrellm-radio-2.0.4/Makefile gkrellm-radio-2.0.4/Makefile
--- gkrellm-radio-2.0.4/Makefile
+++ gkrellm-radio-2.0.4/Makefile
@@ -15,7 +15,8 @@
 PLUGIN_DIR ?= /usr/local/lib/gkrellm2/plugins
 INSTALL = install -c
 INSTALL_PROGRAM = $(INSTALL) -s
-GTK_CONFIG = pkg-config gtk+-2.0
+PKG_CONFIG ?= pkg-config
+GTK_CONFIG = $(PKG_CONFIG) gtk+-2.0
 CFLAGS := ${CFLAGS} -fPIC -I$(GKRELLMDIR)/include `$(GTK_CONFIG) --cflags`  
-DVERSION=\"$(VERSION)\" -Wall
 
 ifdef WITH_LIRC
diff -u gkrellm-radio-2.0.4/debian/changelog 
gkrellm-radio-2.0.4/debian/changelog
--- gkrellm-radio-2.0.4/debian/changelog
+++ gkrellm-radio-2.0.4/debian/changelog
@@ -1,3 +1,13 @@
+gkrellm-radio (2.0.4-1.3) 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.
+    + Defer stripping to dh_strip. (Closes: #437031)
+
+ -- Helmut Grohne <hel...@subdivi.de>  Thu, 24 Jun 2021 12:17:53 +0200
+
 gkrellm-radio (2.0.4-1.2) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -u gkrellm-radio-2.0.4/debian/rules gkrellm-radio-2.0.4/debian/rules
--- gkrellm-radio-2.0.4/debian/rules
+++ gkrellm-radio-2.0.4/debian/rules
@@ -20,9 +20,7 @@
 
 build-stamp: 
        dh_testdir
-
-       # Add here commands to compile the package.
-       enable_nls=1 WITH_LIRC=1 $(MAKE)
+       enable_nls=1 WITH_LIRC=1 dh_auto_build
        touch build-stamp
 
 clean:
@@ -44,6 +42,7 @@
         enable_nls=1 WITH_LIRC=1 $(MAKE) install \
              
PLUGIN_DIR=$(CURDIR)/debian/gkrellm-radio/usr/lib/gkrellm2/plugins \
                                
LOCALEDIR=$(CURDIR)/debian/gkrellm-radio/usr/share/locale \
+                               INSTALL='install --strip-program=true' \
 
 # Build architecture-independent files here.
 binary-indep: build install
only in patch2:
unchanged:
--- gkrellm-radio-2.0.4.orig/.pc/.quilt_patches
+++ gkrellm-radio-2.0.4/.pc/.quilt_patches
@@ -0,0 +1 @@
+patches
only in patch2:
unchanged:
--- gkrellm-radio-2.0.4.orig/.pc/.quilt_series
+++ gkrellm-radio-2.0.4/.pc/.quilt_series
@@ -0,0 +1 @@
+series
only in patch2:
unchanged:
--- gkrellm-radio-2.0.4.orig/.pc/.version
+++ gkrellm-radio-2.0.4/.pc/.version
@@ -0,0 +1 @@
+2
only in patch2:
unchanged:
--- gkrellm-radio-2.0.4.orig/.pc/applied-patches
+++ gkrellm-radio-2.0.4/.pc/applied-patches
@@ -0,0 +1 @@
+cross.patch
only in patch2:
unchanged:
--- gkrellm-radio-2.0.4.orig/.pc/cross.patch/Makefile
+++ gkrellm-radio-2.0.4/.pc/cross.patch/Makefile
@@ -0,0 +1,57 @@
+GKRELLMDIR=
+
+PACKAGE=gkrellm-radio
+VERSIONMAJOR=2
+VERSIONMINOR=0
+VERSIONREV=4
+
+VERSION=$(VERSIONMAJOR).$(VERSIONMINOR).$(VERSIONREV)
+
+DISTFILES=gkrellm_radio.c radio.c radio.h videodev.h README Makefile CHANGES
+
+CC=gcc
+LDFLAGS=
+OBJS=gkrellm_radio.o radio.o
+PLUGIN_DIR ?= /usr/local/lib/gkrellm2/plugins
+INSTALL = install -c
+INSTALL_PROGRAM = $(INSTALL) -s
+GTK_CONFIG = pkg-config gtk+-2.0
+CFLAGS := ${CFLAGS} -fPIC -I$(GKRELLMDIR)/include `$(GTK_CONFIG) --cflags`  
-DVERSION=\"$(VERSION)\" -Wall
+
+ifdef WITH_LIRC
+CFLAGS := ${CFLAGS} -DHAVE_LIRC
+LDFLAGS:= ${LDFLAGS} -llirc_client
+OBJS := ${OBJS} gkrellm_radio_lirc.o
+DISTFILES := ${DISTFILES} gkrellm_radio_lirc.c
+endif
+
+LOCALEDIR ?= /usr/share/locale
+ifeq ($(enable_nls),1)
+  CFLAGS += -DENABLE_NLS -DLOCALEDIR=\"$(LOCALEDIR)\"
+  export enable_nls
+endif
+PACKAGE ?= gkrellm-radio
+CFLAGS += -DPACKAGE="\"$(PACKAGE)\"" 
+export PACKAGE LOCALEDIR
+
+radio.so: $(OBJS)
+       $(CC) -shared -o radio.so $(OBJS) $(LDFLAGS) 
+       (cd po && ${MAKE} all )
+
+%.o: %.c
+       $(CC) $(CFLAGS) -c $*.c
+
+install: radio.so
+       (cd po && ${MAKE} install)
+       $(INSTALL_PROGRAM) -m 755 radio.so $(PLUGIN_DIR)
+
+clean:
+       rm -f radio.so $(OBJS) gkrellm_radio_lirc.o *~
+       (cd po && ${MAKE} clean)
+
+dist:
+       rm -rf $(PACKAGE)-$(VERSION)
+       mkdir $(PACKAGE)-$(VERSION)
+       cp -a $(DISTFILES) $(PACKAGE)-$(VERSION)/
+       tar cfz $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)/
+       rm -rf $(PACKAGE)-$(VERSION)
only in patch2:
unchanged:
--- gkrellm-radio-2.0.4.orig/patches/cross.patch
+++ gkrellm-radio-2.0.4/patches/cross.patch
@@ -0,0 +1,14 @@
+Index: gkrellm-radio-2.0.4/Makefile
+===================================================================
+--- gkrellm-radio-2.0.4.orig/Makefile  2021-06-24 12:17:33.000000000 +0200
++++ gkrellm-radio-2.0.4/Makefile       2021-06-24 12:18:48.997239984 +0200
+@@ -15,7 +15,8 @@
+ PLUGIN_DIR ?= /usr/local/lib/gkrellm2/plugins
+ INSTALL = install -c
+ INSTALL_PROGRAM = $(INSTALL) -s
+-GTK_CONFIG = pkg-config gtk+-2.0
++PKG_CONFIG ?= pkg-config
++GTK_CONFIG = $(PKG_CONFIG) gtk+-2.0
+ CFLAGS := ${CFLAGS} -fPIC -I$(GKRELLMDIR)/include `$(GTK_CONFIG) --cflags`  
-DVERSION=\"$(VERSION)\" -Wall
+ 
+ ifdef WITH_LIRC
only in patch2:
unchanged:
--- gkrellm-radio-2.0.4.orig/patches/series
+++ gkrellm-radio-2.0.4/patches/series
@@ -0,0 +1 @@
+cross.patch

Reply via email to