Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 572382 - app-text/poppler - qt4 support is broken with qt5 installed
Summary: app-text/poppler - qt4 support is broken with qt5 installed
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Maciej Mrozowski
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: qtbindir
  Show dependency tree
 
Reported: 2016-01-19 19:53 UTC by Alexander Sergeyev
Modified: 2016-01-29 10:53 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
poppler-FindQt4.patch (poppler-FindQt4.patch,1.14 KB, patch)
2016-01-20 07:40 UTC, Michael Palimaka (kensington)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Sergeyev 2016-01-19 19:53:51 UTC
Initially, I had a problem with okular -- there was (suddenly) no plugin to display pdf files. And after some digging I've released that the actual problem is with poppler library.

Okular configuration stage log:

-----------------------------------------------------------------------------
-- The following OPTIONAL packages could NOT be located on your system.
-- Consider installing them to enable more features from this software.
-----------------------------------------------------------------------------
   * Poppler-Qt4 (0.12.1 or higher)  <http://poppler.freedesktop.org>
     A PDF rendering library
     Support for PDF files in okular.

poppler-qt4 is missing despite its support is requested with "pdf" use-flag on okular package, there definetelly should be an *explicit* error, silent errors don't make debugging easier.
Next, poppler on the configuration stage fails to detect qt4 (while it is present and poppler has qt4 use-flag enabled). It could be clearly seen in its configuration logs:

Building Poppler with support for:
  font configuration:   fontconfig
  splash output:        yes
  cairo output:         yes
  qt4 wrapper:          no <-- look here
  qt5 wrapper:          no

The problem arises when qt5 is also installed in the system. Without any additional setup qmake will fallback to qt5-related binary:

$ qmake -v
QMake version 3.0
Using Qt version 5.5.1 in /usr/lib64

Poppler on its cmake configuration stage looks for qt4-version of the qmake (and obviously fails). To check extactly the scenario I've done the following (mark qt4 to be *required* import -- why is it not (with qt4 use flag enabled)?):

# ebuild /usr/portage/app-text/poppler/poppler-0.39.0.ebuild clean prepare
<...>
# sed -i 's|macro_optional_find_package(Qt4)|find_package(Qt4 REQUIRED)|' /var/tmp/portage/app-text/poppler-0.39.0/work/poppler-0.39.0/CMakeLists.txt
# ebuild /usr/portage/app-text/poppler/poppler-0.39.0.ebuild configure
<...>
CMake Error at cmake/modules/FindQt4.cmake:1301 (MESSAGE):
  Qt qmake not found!
Call Stack (most recent call first):
  CMakeLists.txt:111 (find_package)

So, the quick fix of the issue (is to enable qt4 via environment variables):

# echo 'QT_SELECT=4' >> /etc/portage/env/qt4.conf
# echo 'app-text/poppler qt4.conf' >> /etc/portage/package.env

With this workaround in use poppler and okular configuration are fixed (and pdf files are readable again by okular):

Building Poppler with support for:
  font configuration:   fontconfig
  splash output:        yes
  cairo output:         yes
  qt4 wrapper:          yes <-- look here
  qt5 wrapper:          no

Okular:
-- Checking for module 'poppler-qt4'
--   Found poppler-qt4, version 0.39.0

Anyway, the workaround will probably break qt5 support, so a proper fix is required.
Comment 1 Alexander Sergeyev 2016-01-19 20:02:51 UTC
Installed qt packages list:

$ equery list '*qt*'
 * Searching for *qt* ...
[IP-] [  ] app-eselect/eselect-qtgraphicssystem-1.1.1:0
[IP-] [  ] dev-libs/libdbusmenu-qt-0.9.3_pre20140619-r1:0
[IP-] [  ] dev-qt/qt3support-4.8.7:4
[IP-] [  ] dev-qt/qtchooser-0_p20151008:0
[IP-] [  ] dev-qt/qtcore-4.8.7-r1:4
[IP-] [  ] dev-qt/qtcore-5.5.1:5
[IP-] [  ] dev-qt/qtdbus-4.8.7:4
[IP-] [  ] dev-qt/qtdbus-5.5.1:5
[IP-] [  ] dev-qt/qtdeclarative-4.8.7:4
[IP-] [  ] dev-qt/qtdeclarative-5.5.1-r1:5
[IP-] [  ] dev-qt/qtgui-4.8.7:4
[IP-] [  ] dev-qt/qtgui-5.5.1:5
[IP-] [  ] dev-qt/qtmultimedia-5.5.1-r1:5
[IP-] [  ] dev-qt/qtnetwork-5.5.1:5
[IP-] [  ] dev-qt/qtopengl-4.8.7:4
[IP-] [  ] dev-qt/qtprintsupport-5.5.1:5
[IP-] [  ] dev-qt/qtscript-4.8.7:4
[IP-] [  ] dev-qt/qtsql-4.8.7-r1:4
[IP-] [  ] dev-qt/qtsvg-4.8.7:4
[IP-] [  ] dev-qt/qtsvg-5.5.1-r1:5
[IP-] [  ] dev-qt/qttest-4.8.7:4
[IP-] [  ] dev-qt/qttest-5.5.1:5
[IP-] [  ] dev-qt/qttranslations-4.8.7:4
[IP-] [  ] dev-qt/qtwebkit-4.8.7:4
[IP-] [  ] dev-qt/qtwidgets-5.5.1-r1:5
[IP-] [  ] dev-qt/qtx11extras-5.5.1:5
[IP-] [  ] dev-qt/qtxml-5.5.1:5
[IP-] [  ] dev-qt/qtxmlpatterns-4.8.7:4
[IP-] [  ] x11-themes/qtcurve-1.8.18-r1:0
Comment 2 Michael Palimaka (kensington) gentoo-dev 2016-01-20 07:24:26 UTC
This appears to affect all versions. The cause seems to be a bundled FindQt4.cmake - system versions are patched to account for the slotted qmake.
Comment 3 Michael Palimaka (kensington) gentoo-dev 2016-01-20 07:40:29 UTC
Created attachment 423406 [details, diff]
poppler-FindQt4.patch

Proposed patch.
Comment 4 Alexander Sergeyev 2016-01-20 07:55:01 UTC
> Proposed patch.
Can confirm that the patch fixed the issue for me.
Comment 5 Michael Palimaka (kensington) gentoo-dev 2016-01-29 10:53:49 UTC
Thanks, fixed in git.

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c05a126fc8e2f1c17b1657c3483a337bcce63094