Source: qpdfview
Version: 0.4.14-1
Tags: patch
Control: affects 886315 + src:qpdfview
User: [email protected]
Usertags: rebootstrap

qpdfview fails to cross build from source for a number of reasons. Let
me discuss the individual reasons.

 * The lrelease errors out (but it exists successfully), because it
   thinks its qmake installation is incomplete. qmake is only installed
   for the host architecture, but lrelease apparently is a build tools.
   Thus we need to pull qt5-qmake for the build architecture as well.
 * The explicit qmake invocation lacks the relevant -specs flag. The
   easiest way of adding it is letting dh_auto_configure do it.
 * Finally, it uses the build architecture pkg-config to interrogate the
   version of poppler and concludes that poppler is very ancient as
   there is no poppler for the build architecture. Using the host
   architecture pkg-config fixes the detection and makes it use the
   correct poppler version.
 * #886315

All of these issues but the last are covered in the attached patch.
Please consider applying it.

Helmut
diff --minimal -Nru qpdfview-0.4.14/debian/changelog 
qpdfview-0.4.14/debian/changelog
--- qpdfview-0.4.14/debian/changelog    2015-03-22 11:43:17.000000000 +0100
+++ qpdfview-0.4.14/debian/changelog    2018-01-06 19:40:41.000000000 +0100
@@ -1,3 +1,13 @@
+qpdfview (0.4.14-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Add qt5-qmake:native to Build-Depends for lrelease.
+    + Let dh_auto_configure pass cross flags to qmake.
+    + Add cross.patch.
+
+ -- Helmut Grohne <[email protected]>  Sat, 06 Jan 2018 19:40:41 +0100
+
 qpdfview (0.4.14-1) unstable; urgency=low
 
   * New upstream release.
diff --minimal -Nru qpdfview-0.4.14/debian/control 
qpdfview-0.4.14/debian/control
--- qpdfview-0.4.14/debian/control      2015-05-08 10:49:38.000000000 +0200
+++ qpdfview-0.4.14/debian/control      2018-01-06 19:40:03.000000000 +0100
@@ -2,7 +2,7 @@
 Section: graphics
 Priority: optional
 Maintainer: Benjamin Eltzner <[email protected]>
-Build-Depends: debhelper (>=9.0.0), libcups2-dev, qttools5-dev-tools, 
qtbase5-dev, libqt5svg5-dev, libpoppler-qt5-dev, pkg-config, libspectre-dev, 
libdjvulibre-dev, dpkg-dev (>=1.16.1.1), zlib1g-dev
+Build-Depends: debhelper (>=9.0.0), libcups2-dev, qttools5-dev-tools, 
qtbase5-dev, libqt5svg5-dev, libpoppler-qt5-dev, pkg-config, libspectre-dev, 
libdjvulibre-dev, dpkg-dev (>=1.16.1.1), zlib1g-dev, qt5-qmake:native
 Standards-Version: 3.9.6
 Homepage: https://launchpad.net/qpdfview
 
diff --minimal -Nru qpdfview-0.4.14/debian/patches/cross.patch 
qpdfview-0.4.14/debian/patches/cross.patch
--- qpdfview-0.4.14/debian/patches/cross.patch  1970-01-01 01:00:00.000000000 
+0100
+++ qpdfview-0.4.14/debian/patches/cross.patch  2018-01-06 19:40:41.000000000 
+0100
@@ -0,0 +1,34 @@
+From: Helmut Grohne <[email protected]>
+Subject: use the correct pkg-config for cross compilation
+
+Index: qpdfview-0.4.14/pdf-plugin.pro
+===================================================================
+--- qpdfview-0.4.14.orig/pdf-plugin.pro
++++ qpdfview-0.4.14/pdf-plugin.pro
+@@ -19,18 +19,19 @@
+ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+ 
+ !without_pkgconfig {
++    PKG_CONFIG = $$pkgConfigExecutable()
+     poppler_qt_pkg = poppler-qt$${QT_MAJOR_VERSION}
+ 
+     CONFIG += link_pkgconfig
+     PKGCONFIG += $${poppler_qt_pkg}
+ 
+-    system(pkg-config --atleast-version=0.14 $${poppler_qt_pkg}):DEFINES += 
HAS_POPPLER_14
+-    system(pkg-config --atleast-version=0.18 $${poppler_qt_pkg}):DEFINES += 
HAS_POPPLER_18
+-    system(pkg-config --atleast-version=0.20.1 $${poppler_qt_pkg}):DEFINES += 
HAS_POPPLER_20
+-    system(pkg-config --atleast-version=0.22 $${poppler_qt_pkg}):DEFINES += 
HAS_POPPLER_22
+-    system(pkg-config --atleast-version=0.24 $${poppler_qt_pkg}):DEFINES += 
HAS_POPPLER_24
+-    system(pkg-config --atleast-version=0.26 $${poppler_qt_pkg}):DEFINES += 
HAS_POPPLER_26
+-    system(pkg-config --atleast-version=0.31 $${poppler_qt_pkg}):DEFINES += 
HAS_POPPLER_31
++    system($$PKG_CONFIG --atleast-version=0.14 $${poppler_qt_pkg}):DEFINES += 
HAS_POPPLER_14
++    system($$PKG_CONFIG --atleast-version=0.18 $${poppler_qt_pkg}):DEFINES += 
HAS_POPPLER_18
++    system($$PKG_CONFIG --atleast-version=0.20.1 $${poppler_qt_pkg}):DEFINES 
+= HAS_POPPLER_20
++    system($$PKG_CONFIG --atleast-version=0.22 $${poppler_qt_pkg}):DEFINES += 
HAS_POPPLER_22
++    system($$PKG_CONFIG --atleast-version=0.24 $${poppler_qt_pkg}):DEFINES += 
HAS_POPPLER_24
++    system($$PKG_CONFIG --atleast-version=0.26 $${poppler_qt_pkg}):DEFINES += 
HAS_POPPLER_26
++    system($$PKG_CONFIG --atleast-version=0.31 $${poppler_qt_pkg}):DEFINES += 
HAS_POPPLER_31
+ } else {
+     DEFINES += $$PDF_PLUGIN_DEFINES
+     INCLUDEPATH += $$PDF_PLUGIN_INCLUDEPATH
diff --minimal -Nru qpdfview-0.4.14/debian/patches/series 
qpdfview-0.4.14/debian/patches/series
--- qpdfview-0.4.14/debian/patches/series       2015-03-22 11:40:37.000000000 
+0100
+++ qpdfview-0.4.14/debian/patches/series       2018-01-06 19:40:41.000000000 
+0100
@@ -1 +1,2 @@
 toolbars.patch
+cross.patch
diff --minimal -Nru qpdfview-0.4.14/debian/rules qpdfview-0.4.14/debian/rules
--- qpdfview-0.4.14/debian/rules        2015-03-22 12:18:04.000000000 +0100
+++ qpdfview-0.4.14/debian/rules        2018-01-06 19:40:40.000000000 +0100
@@ -14,7 +14,7 @@
 
 override_dh_auto_configure:
        lrelease qpdfview.pro
-       qmake DEFINES+="_FILE_OFFSET_BITS=64" QMAKE_CFLAGS="$(CFLAGS) 
$(CPPFLAGS)" QMAKE_CXXFLAGS="$(CFLAGS) $(CPPFLAGS) $(CXXFLAGS)" 
QMAKE_LFLAGS="$(LDFLAGS)" qpdfview.pro
+       dh_auto_configure -- DEFINES+="_FILE_OFFSET_BITS=64" qpdfview.pro
 
 override_dh_installchangelogs:
        dh_installchangelogs CHANGES

Reply via email to