Source: qiv
Version: 2.3.1-1
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

qiv fails to cross build from source, because it uses the build
architecture compiler and pkg-config. pkg-config is simply hard coded in
the Makefile and needs a patch to substitute. gcc is indirected through
$(CC), but it is assigned with "=" in Makefile, so cdbs' environment
variable is ignored. After fixing both, qiv cross builds successfully.
Please consider applying the attached patch.

Helmut
diff -u qiv-2.3.1/debian/changelog qiv-2.3.1/debian/changelog
--- qiv-2.3.1/debian/changelog
+++ qiv-2.3.1/debian/changelog
@@ -1,3 +1,12 @@
+qiv (2.3.1-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS:  Closes: #-1.
+    + Make pkg-config substitutable.
+    + Force substitution of CC.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Thu, 19 Oct 2017 16:36:58 +0200
+
 qiv (2.3.1-1) unstable; urgency=medium
 
   * New upstream release.
diff -u qiv-2.3.1/debian/rules qiv-2.3.1/debian/rules
--- qiv-2.3.1/debian/rules
+++ qiv-2.3.1/debian/rules
@@ -7,6 +7,8 @@
 include /usr/share/cdbs/1/rules/debhelper.mk
 include /usr/share/cdbs/1/rules/simple-patchsys.mk
 
+DEB_MAKE_EXTRA_ARGS += 'CC=$(CC)'
+
 update-config::
        [ -f qiv-command ] || mv contrib/qiv-command.example qiv-command
 
only in patch2:
unchanged:
--- qiv-2.3.1.orig/debian/patches/17_cross.diff
+++ qiv-2.3.1/debian/patches/17_cross.diff
@@ -0,0 +1,44 @@
+From: Helmut Grohne <hel...@subdivi.de>
+Subject: make pkg-config substitutable for cross compilation
+
+Index: qiv-2.3.1/Makefile
+===================================================================
+--- qiv-2.3.1.orig/Makefile
++++ qiv-2.3.1/Makefile
+@@ -50,6 +50,7 @@
+ ######################################################################
+ 
+ CC        = gcc
++PKG_CONFIG ?= pkg-config
+ #CFLAGS    = -O0 -g -Wall
+ CFLAGS    = -O2 -Wall \
+           -fcaller-saves -ffast-math -fno-strength-reduce \
+@@ -58,8 +59,8 @@
+ #         -fcaller-saves -ffast-math -fno-strength-reduce \
+ #         -fthread-jumps #-march=pentium #-DSTAT_MACROS_BROKEN
+ 
+-INCLUDES  := $(shell pkg-config --cflags gdk-2.0 imlib2)
+-LIBS      := $(shell pkg-config --libs gdk-2.0 imlib2) -lX11 -lXext
++INCLUDES  := $(shell $(PKG_CONFIG) --cflags gdk-2.0 imlib2)
++LIBS      := $(shell $(PKG_CONFIG) --libs gdk-2.0 imlib2) -lX11 -lXext
+ 
+ # [as] thinks that this is not portable enough:
+ # [lc] I use a virtual screen of 1600x1200, and the resolution is 1024x768,
+@@ -88,13 +89,13 @@
+ endif
+ 
+ ifdef LCMS
+-INCLUDES  += $(shell pkg-config --cflags lcms2)
+-LIBS      += $(shell pkg-config --libs lcms2) -ljpeg -ltiff
++INCLUDES  += $(shell $(PKG_CONFIG) --cflags lcms2)
++LIBS      += $(shell $(PKG_CONFIG) --libs lcms2) -ljpeg -ltiff
+ endif
+ 
+ ifdef EXIF
+-INCLUDES  += $(shell pkg-config --cflags libexif)
+-LIBS      += $(shell pkg-config --libs libexif)
++INCLUDES  += $(shell $(PKG_CONFIG) --cflags libexif)
++LIBS      += $(shell $(PKG_CONFIG) --libs libexif)
+ endif
+ 
+ ifdef MAGIC

Reply via email to