Created attachment 565406 [details] build.log calibre-3.36.0 appears to be suffering ABI breakage with Qt-5.12: emerge fails with the following errors: /usr/include/qt5/QtGui/qpainter.h:482:18: note: forward declaration of ‘class QFontEngineFT’ friend class QFontEngineFT; ^~~~~~~~~~~~~ /var/tmp/portage/app-text/calibre-3.36.0/work/calibre-3.36.0/src/calibre/headless/fontconfig_database.cpp:1069:11: error: invalid use of incomplete type ‘class QFontEngineFT’ engine->antialias = antialias; ^~ In file included from /usr/include/qt5/QtGui/qpaintengine.h:47, from /usr/include/qt5/QtGui/5.12.1/QtGui/private/qtextengine_p.h:62, from /usr/include/qt5/QtGui/5.12.1/QtGui/private/qfontengine_p.h:59, from /usr/include/qt5/QtGui/5.12.1/QtGui/qpa/qplatformfontdatabase.h:60, from /var/tmp/portage/app-text/calibre-3.36.0/work/calibre-3.36.0/src/calibre/headless/fontconfig_database.h:9, from /var/tmp/portage/app-text/calibre-3.36.0/work/calibre-3.36.0/src/calibre/headless/fontconfig_database.cpp:40: /usr/include/qt5/QtGui/qpainter.h:482:18: note: forward declaration of ‘class QFontEngineFT’ friend class QFontEngineFT; ^~~~~~~~~~~~~ /var/tmp/portage/app-text/calibre-3.36.0/work/calibre-3.36.0/src/calibre/headless/fontconfig_database.cpp:1070:11: error: invalid use of incomplete type ‘class QFontEngineFT’ engine->defaultFormat = format; ^~ In file included from /usr/include/qt5/QtGui/qpaintengine.h:47, from /usr/include/qt5/QtGui/5.12.1/QtGui/private/qtextengine_p.h:62, from /usr/include/qt5/QtGui/5.12.1/QtGui/private/qfontengine_p.h:59, from /usr/include/qt5/QtGui/5.12.1/QtGui/qpa/qplatformfontdatabase.h:60, from /var/tmp/portage/app-text/calibre-3.36.0/work/calibre-3.36.0/src/calibre/headless/fontconfig_database.h:9, from /var/tmp/portage/app-text/calibre-3.36.0/work/calibre-3.36.0/src/calibre/headless/fontconfig_database.cpp:40: /usr/include/qt5/QtGui/qpainter.h:482:18: note: forward declaration of ‘class QFontEngineFT’ friend class QFontEngineFT; ^~~~~~~~~~~~~ /var/tmp/portage/app-text/calibre-3.36.0/work/calibre-3.36.0/src/calibre/headless/fontconfig_database.cpp:1071:11: error: invalid use of incomplete type ‘class QFontEngineFT’ engine->glyphFormat = format; ^~ In file included from /usr/include/qt5/QtGui/qpaintengine.h:47, from /usr/include/qt5/QtGui/5.12.1/QtGui/private/qtextengine_p.h:62, from /usr/include/qt5/QtGui/5.12.1/QtGui/private/qfontengine_p.h:59, from /usr/include/qt5/QtGui/5.12.1/QtGui/qpa/qplatformfontdatabase.h:60, from /var/tmp/portage/app-text/calibre-3.36.0/work/calibre-3.36.0/src/calibre/headless/fontconfig_database.h:9, from /var/tmp/portage/app-text/calibre-3.36.0/work/calibre-3.36.0/src/calibre/headless/fontconfig_database.cpp:40: /usr/include/qt5/QtGui/qpainter.h:482:18: note: forward declaration of ‘class QFontEngineFT’ friend class QFontEngineFT; ^~~~~~~~~~~~~ make: *** [Makefile:439: fontconfig_database.o] Error 1 complete build.log is attached.
NB: this issue also affects app-text/calibre-3.38.1 (and I'm guessing all versions). I haven't yet tried calibre-3.39.*, available on a couple overlays.
update: it fails on calibre-3.39.1, from the salfter overlay as well. So I'm going to have to remove calibre until upstream can fix the issue.
According to https://bugs.launchpad.net/calibre/+bug/1817355, this might be related to packaging, as the compile seems to work out of the box at least on arch. I checked the offending pre-processor output with gcc -E and found that, while the correct header is included, the preprocessor doesn't insert its contents. A patch to this is to actually #undef QT_NO_FREETYPE before the include. Then the header is correctly inserted by the pre-processor and the class will be fine. But this seems like a bogus patch. I just tried it because the offending private header is using an ifndef here. My remaining question is if and if why QT_NO_FREETYPE is defined in the first place, when compiling the freetype font engine for the headless source tree. But I don't have the time to go down this rabbit hole right now.
(In reply to Jan-Matthias Braun from comment #3) I recognize braindead header file locations for Qt-5.12.1. For example: qpa/qplatformfontdatabase.h is located at: qt5/QtGui/5.12.1/QtGui/qpa/qplatformfontdatabase.h or QtFontDatabaseSupport/private/qfreetypefontdatabase_p.h resides instead here: qt5/QtFontDatabaseSupport/5.12.1/QtFontDatabaseSupport/private/qfreetypefontdatabase_p.h Although arch has the same weird header file location and this might be actually expected. This means that a given source file should hardcode the version while including a header file. Seriously: what is this mickey mouse shit? Exactly where I should insert that undef QT_NO_FREETYPE? Thanks: Dw.
Created attachment 567420 [details, diff] calibre-3.39.1-qtgui-5.12.patch Thanks to Jan-Matthias' research I created this patch which fixes the build error for me. Although I dunno if this is the right approach and if this breaks compilation with qtgui-5.11
*** Bug 679232 has been marked as a duplicate of this bug. ***
The patch from #5 solved it for me. calibre compiled, and appears to run without error. Thanks!
Also confirming the patch works.
(In reply to Lars Wendler (Polynomial-C) from comment #5) > Created attachment 567420 [details, diff] [details, diff] > calibre-3.39.1-qtgui-5.12.patch > > Thanks to Jan-Matthias' research I created this patch which fixes the build > error for me. Although I dunno if this is the right approach and if this > breaks compilation with qtgui-5.11 No, that can't be right. If you end up with QT_NO_FREETYPE defined in your Qt installation then something is very wrong. Can you or someone else attach their /usr/include/qt5/Gentoo/gentoo-qconfig.h ?
Reassigning to qt@ as this is most likely a qt packaging bug.
Created attachment 567494 [details] gentoo-qconfig.h Here's mine from my Gentoo dev machine...
Created attachment 567496 [details] gentoo-qconfig.h
So, the patch seems to address the issue as described in the linked bug report to launchpad. Also, the requested output from "/usr/include/qt5/Gentoo/gentoo-qconfig.h" shows that the patch does not create an undesirable entry "QT_NO_FREETYPE" there. Is this correct thus far? If so, the patch might be an appropriate resolution to this issue.
(In reply to Davide Pesavento from comment #9) > No, that can't be right. If you end up with QT_NO_FREETYPE defined in your > Qt installation then something is very wrong. > @Davide, the patch doesn't define QT_NO_FREETYPE ! It undefines it if the QT version is above or equal 5.9.0 ! Besides it is only for Calibre and obviously the QT doesn't have a fontconfig defined in its config :) (In reply to Amel Hodzic from comment #13) > ...Also, the requested output from > "/usr/include/qt5/Gentoo/gentoo-qconfig.h" shows that the patch does not > create an undesirable entry "QT_NO_FREETYPE" there. @Amel, The patch doesn't mess up with main QT config at all (the gentoo-config.h is part of dev-qt/qtcore). It just undefines the variable inside calibre thus making calibre know that QT has fonconfig in it. To me the patch seems OK and works OK
(In reply to Amel Hodzic from comment #13) > So, the patch seems to address the issue as described in the linked bug > report to launchpad. Also, the requested output from > "/usr/include/qt5/Gentoo/gentoo-qconfig.h" shows that the patch does not > create an undesirable entry "QT_NO_FREETYPE" there. That's not why I asked to see the file. > Is this correct thus far? If so, the patch might be an appropriate > resolution to this issue. It's not.
(In reply to PhobosK from comment #14) > @Davide, > the patch doesn't define QT_NO_FREETYPE ! It undefines it if the QT version > is above or equal 5.9.0 ! I'm well aware, thank you.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d487758dc1bcf53cbfaf35647f4acdae9cf442e9 commit d487758dc1bcf53cbfaf35647f4acdae9cf442e9 Author: Davide Pesavento <pesa@gentoo.org> AuthorDate: 2019-03-03 19:52:01 +0000 Commit: Davide Pesavento <pesa@gentoo.org> CommitDate: 2019-03-03 19:52:01 +0000 dev-qt/qtgui: restore QT_FREETYPE define Closes: https://bugs.gentoo.org/678022 Package-Manager: Portage-2.3.62, Repoman-2.3.12 Signed-off-by: Davide Pesavento <pesa@gentoo.org> dev-qt/qtgui/{qtgui-5.12.1.ebuild => qtgui-5.12.1-r1.ebuild} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/qt.git/commit/?id=fa12b7b7bb8b139ce5ad484d554a7fa7902d4918 commit fa12b7b7bb8b139ce5ad484d554a7fa7902d4918 Author: Davide Pesavento <pesa@gentoo.org> AuthorDate: 2019-03-03 20:01:37 +0000 Commit: Davide Pesavento <pesa@gentoo.org> CommitDate: 2019-03-03 20:01:37 +0000 dev-qt/qtgui: restore QT_FREETYPE define Bug: https://bugs.gentoo.org/678022 Package-Manager: Portage-2.3.62, Repoman-2.3.12 Signed-off-by: Davide Pesavento <pesa@gentoo.org> dev-qt/qtgui/qtgui-5.12.9999.ebuild | 4 ++-- dev-qt/qtgui/qtgui-5.13.9999.ebuild | 4 ++-- dev-qt/qtgui/qtgui-5.9999.ebuild | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-)