Source: kerneloops
Version: 0.12+git20140509-5
Tags: patch
User: [email protected]
Usertags: rebootstrap

kerneloops fails to cross build from source, because it uses build
architecture tools in a few remaining places. dh_auto_build already
substitutes CC, but the Makefile still invokes a plain pkg-config and
has two plain gcc calls. Substituting all calls makes the cross build
succeed. Please consider applying the attached patch.

Helmut
diff --minimal -Nru kerneloops-0.12+git20140509/debian/changelog 
kerneloops-0.12+git20140509/debian/changelog
--- kerneloops-0.12+git20140509/debian/changelog        2016-09-15 
00:18:47.000000000 +0200
+++ kerneloops-0.12+git20140509/debian/changelog        2016-11-14 
07:29:15.000000000 +0100
@@ -1,3 +1,10 @@
+kerneloops (0.12+git20140509-5.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: Use triplet-prefixed pkg-config (Closes: #-1)
+
+ -- Helmut Grohne <[email protected]>  Mon, 14 Nov 2016 07:29:15 +0100
+
 kerneloops (0.12+git20140509-5) unstable; urgency=medium
 
   * Rename conffile in maintainer scripts properly (Closes: 837760)
diff --minimal -Nru kerneloops-0.12+git20140509/debian/patches/0005-cross.patch 
kerneloops-0.12+git20140509/debian/patches/0005-cross.patch
--- kerneloops-0.12+git20140509/debian/patches/0005-cross.patch 1970-01-01 
01:00:00.000000000 +0100
+++ kerneloops-0.12+git20140509/debian/patches/0005-cross.patch 2016-11-14 
07:29:15.000000000 +0100
@@ -0,0 +1,47 @@
+Subject: fix cross compilation
+From: Helmut Grohne <[email protected]>
+
+Allow substituting pkg-config with a triplet-prefixed version.
+
+Allow substituting gcc with a triplet-prefixed version in all places.
+
+Index: kerneloops-0.12+git20140509/Makefile
+===================================================================
+--- kerneloops-0.12+git20140509.orig/Makefile
++++ kerneloops-0.12+git20140509/Makefile
+@@ -9,17 +9,18 @@
+ LOCALESDIR=/usr/share/locale
+ MANDIR=/usr/share/man/man8
+ CC?=gcc
++PKG_CONFIG?=pkg-config
+ 
+ CFLAGS ?= -O2 -g -fstack-protector -D_FORTIFY_SOURCE=2 -Wall -W 
-Wstrict-prototypes -Wundef -fno-common -Werror-implicit-function-declaration 
-Wdeclaration-after-statement -Wformat -Wformat-security -Werror=format-security
+ 
+-MY_CFLAGS = $(shell pkg-config --cflags libnotify gtk+-2.0 dbus-glib-1)
++MY_CFLAGS = $(shell $(PKG_CONFIG) --cflags libnotify gtk+-2.0 dbus-glib-1)
+ #
+ # pkg-config tends to make programs pull in a ton of libraries, not all 
+ # are needed. -Wl,--as-needed tells the linker to just drop unused ones,
+ # and that makes the applet load faster and use less memory.
+ #
+-LDF_A ?= -Wl,--as-needed $(shell pkg-config --libs libnotify gtk+-2.0 
dbus-glib-1) $(LDFLAGS)
+-LDF_D ?= -Wl,--as-needed $(shell pkg-config --libs glib-2.0 dbus-glib-1) 
$(shell curl-config --libs) -Wl,"-z relro" -Wl,"-z now" $(LDFLAGS)
++LDF_A ?= -Wl,--as-needed $(shell $(PKG_CONFIG) --libs libnotify gtk+-2.0 
dbus-glib-1) $(LDFLAGS)
++LDF_D ?= -Wl,--as-needed $(shell $(PKG_CONFIG) --libs glib-2.0 dbus-glib-1) 
$(shell curl-config --libs) -Wl,"-z relro" -Wl,"-z now" $(LDFLAGS)
+ 
+ all:  kerneloops kerneloops-applet kerneloops.8.gz
+ 
+@@ -30,11 +31,11 @@
+ 
+ 
+ kerneloops:   kerneloops.o submit.o dmesg.o configfile.o kerneloops.h
+-      gcc kerneloops.o submit.o dmesg.o configfile.o $(LDF_D) -o kerneloops
++      $(CC) kerneloops.o submit.o dmesg.o configfile.o $(LDF_D) -o kerneloops
+       @(cd po/ && $(MAKE))
+ 
+ kerneloops-applet: kerneloops-applet.o
+-      gcc kerneloops-applet.o $(LDF_A) -o kerneloops-applet
++      $(CC) kerneloops-applet.o $(LDF_A) -o kerneloops-applet
+ 
+ kerneloops.8.gz: kerneloops.8
+       gzip -9 -c $< > $@
diff --minimal -Nru kerneloops-0.12+git20140509/debian/patches/series 
kerneloops-0.12+git20140509/debian/patches/series
--- kerneloops-0.12+git20140509/debian/patches/series   2016-09-15 
00:18:47.000000000 +0200
+++ kerneloops-0.12+git20140509/debian/patches/series   2016-11-14 
07:27:53.000000000 +0100
@@ -2,3 +2,4 @@
 0002-n-is-two-characters-long.patch
 0003-Don-t-parse-newline-to-configured-values.patch
 0004-Use-oops.kernel.org-host.patch
+0005-cross.patch
diff --minimal -Nru kerneloops-0.12+git20140509/debian/rules 
kerneloops-0.12+git20140509/debian/rules
--- kerneloops-0.12+git20140509/debian/rules    2016-09-15 00:18:47.000000000 
+0200
+++ kerneloops-0.12+git20140509/debian/rules    2016-11-14 07:29:14.000000000 
+0100
@@ -4,6 +4,9 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
+include /usr/share/dpkg/architecture.mk
+export PKG_CONFIG=$(DEB_HOST_GNU_TYPE)-pkg-config
+
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 
 # This has to be exported to make some magic below work.

Reply via email to