Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 545380 - app-office/libreoffice-4.4.1.2 compilation fails due to bad Qt include directives
Summary: app-office/libreoffice-4.4.1.2 compilation fails due to bad Qt include direct...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Office Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-03 06:35 UTC by Thomas
Modified: 2016-02-28 23:11 UTC (History)
0 users

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


Attachments
patch to fix the bad Qt include directives (libreoffice-4.4.1.2-fix-old-qt-includes.diff,5.91 KB, text/plain)
2015-04-03 06:35 UTC, Thomas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas 2015-04-03 06:35:36 UTC
Created attachment 400458 [details]
patch to fix the bad Qt include directives

app-office/libreoffice-4.4.1.2 fails to compile here when using "kde" USE flag.

The reason is that it uses a mix of old fashioned and sometimes bad or wrong include directives. Somtimes the quotation is wrong, sometimes the component is missing, somethimes the old fashioned (and also deprecated) lowercase *.h file names are used.

Here some examples:

old/wrong:              => should be:
#include "QString"      => #include <QtCore/QString>
#include <qclipboard.h> => #include <QtGui/QClipboard>
#include <QHash>        => #include <QtCore/QHash>

I reopened a corresponding upstream bug here:
https://bugs.documentfoundation.org/show_bug.cgi?id=84263

Please find the patch attached to this bug report, it makes compilation and configure checks work again.

kind regards,
   Thomas
Comment 1 Andreas Sturmlechner gentoo-dev 2015-04-04 14:24:31 UTC
I'm puzzled - please attach build.log. I haven't had Qt related trouble at all, be it 4.8.5 or 4.8.6, and various libreoffice versions.
Comment 2 Thomas 2015-04-05 09:34:00 UTC
Sorry, I don't have the build log anymore, but there were 3 issues.

First, in the "configure" phase it claimed that my Qt version is buggy and that the KDE integration has to be disabled at runtime (because libreoffice-4.4.1.2/vcl/unx/kde4/tst_exclude_posted_events.hxx and libreoffice-4.4.1.2/vcl/unx/kde4/tst_exclude_socket_notifiers.hxx did not compile). This may rush through the messages and may stay unnoticed until you run the application.

The second one was more obvious: the statements
#include "QString"   and 
#include "QFont"
... these use wrong quoting, as these files are in a system include directory the correct quoting has to be done with '<' and '>".

The third one was about some "file not found" messages from old style Qt include files (lowercase *.h).

If you do not have that kind of issues, then you might have a different Qt include path and a more relaxed compiler (here: sys-devel/gcc-4.8.3).

$ locate qclipboard.h
/usr/include/qt4/Qt/qclipboard.h
/usr/include/qt4/QtGui/qclipboard.h

May it be that for some strange reason you have "/usr/include/qt4/Qt" in your include path? This seems not to be the case here...

Currently 4.4.2.2 is compiling, and what I can find in the output is something like this:

[build CXX] shell/source/backends/kde4be/kde4backend.cxx
S=/var/tmp/portage/app-office/libreoffice-4.4.2.2/work/libreoffice-4.4.2.2 && I=$S/instdir && W=$S/workdir &&  mkdir -p $W/CxxObject/shell/source/backends/kde4be/ $W/Dep/CxxObject/shell/source/backends/kde4be/ && cd /var/tmp/portage/app-office/libreoffice-4.4.2.2/work/libreoffice-4.4.2.2 &&   i686-pc-linux-gnu-g++ -DCPPU_ENV=gcc3 -DINTEL -DLIBO_INTERNAL_ONLY -DLINUX -DNDEBUG -DOPTIMIZE -DOSL_DEBUG_LEVEL=0 -DUNIX -DUNX -DX86 -D_PTHREADS -D_REENTRANT  -DRTL_USING   -DQT_SHARED -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT   -DHAVE_GCC_VISIBILITY_FEATURE -fvisibility=hidden   -Wall -Wnon-virtual-dtor -Wendif-labels -Wextra -Wundef -Wunused-macros -fmessage-length=0 -fno-common -pipe  -fvisibility-inlines-hidden -fPIC -Wshadow -Woverloaded-virtual -std=gnu++11   -DEXCEPTIONS_ON -fexceptions -fno-enforce-eh-specs -O2 -march=native -mtune=native -mpopcnt -fomit-frame-pointer -frename-registers -pipe -floop-interchange -floop-strip-mine -floop-block -fno-omit-frame-pointer  -Wno-shadow  -c $S/shell/source/backends/kde4be/kde4backend.cxx -o $W/CxxObject/shell/source/backends/kde4be/kde4backend.o  -I$S/shell/source/backends/kde4be/ -isystem /usr/include -isystem /usr/include/qt4 -isystem /usr/include/qt4/QtNetwork -isystem /usr/include/qt4 -isystem /usr/include/qt4/QtGui  -I$S/include  -I/opt/oracle-jdk-bin-1.7.0.76/include -I/opt/oracle-jdk-bin-1.7.0.76/include/linux -I$S/config_host  -I$W/UnoApiHeadersTarget/udkapi/normal -I$W/UnoApiHeadersTarget/offapi/normal -I/usr/include     

The strange thing here is: where is "/usr/include/qt4/QtCore"? As you can see, there is a include for QtGui. But how can someone get that path without QtCore? When I try that I get this output from pkgconfig:

$ pkg-config QtGui --cflags-only-I
-I/usr/include/qt4 -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/usr/include/qt4/QtCore
Comment 3 Andreas Sturmlechner gentoo-dev 2015-04-05 11:09:23 UTC
I can tell you for sure that KDE integration works fine on my systems. I have built 4.4.1.2 with gcc-4.8.3, and just recently 4.4.2.2 using gcc-4.8.4.

I don't see those warnings in configure, and for some reason, /usr/include/qt4/QtCore is missing from your include path, when I jump to the same point in my build.log it is there:

[build CXX] shell/source/backends/kde4be/kde4backend.cxx
S=/usr/src/portage/app-office/libreoffice-4.4.2.2/work/libreoffice-4.4.2.2 && I=$S/instdir && W=$S/workdir &&  mkdir -p $W/CxxObject/shell/source/backends/kde4be/ $W/Dep/CxxObject/shell/source/backends/kde4be/ && cd /usr/src/portage/app-office/libreoffice-4.4.2.2/work/libreoffice-4.4.2.2 &&   x86_64-pc-linux-gnu-g++ -DCPPU_ENV=gcc3 -DLIBO_INTERNAL_ONLY -DLINUX -DNDEBUG -DOPTIMIZE -DOSL_DEBUG_LEVEL=0 -DUNIX -DUNX -DX86_64 -D_PTHREADS -D_REENTRANT  -DRTL_USING   -DQT_SHARED -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT   -DHAVE_GCC_VISIBILITY_FEATURE -fvisibility=hidden   -Wall -Wnon-virtual-dtor -Wendif-labels -Wextra -Wundef -Wunused-macros -fmessage-length=0 -fno-common -pipe  -fvisibility-inlines-hidden -fPIC -Wshadow -Woverloaded-virtual -std=gnu++11   -DEXCEPTIONS_ON -fexceptions -fno-enforce-eh-specs -O2 -march=core2 -pipe  -Wno-shadow  -c $S/shell/source/backends/kde4be/kde4backend.cxx -o $W/CxxObject/shell/source/backends/kde4be/kde4backend.o  -I$S/shell/source/backends/kde4be/ -isystem /usr/include -isystem /usr/include/qt4 -isystem /usr/include/qt4/QtNetwork -isystem /usr/include/qt4 -isystem /usr/include/qt4/QtGui -isystem /usr/include/qt4 -isystem /usr/include/qt4/QtCore  -I$S/include  -I/usr/lib64/icedtea7/include -I/usr/lib64/icedtea7/include/linux -I$S/config_host  -I$W/UnoApiHeadersTarget/udkapi/normal -I$W/UnoApiHeadersTarget/offapi/normal -I/usr/include
Comment 4 Thomas 2015-04-08 17:05:58 UTC
I now have a build log from version 4.4.2.2 (with my patches applied), it's about 500kB (xz compressed), are you interested ?
Comment 5 Andreas K. Hüttel archtester gentoo-dev 2015-04-11 20:45:14 UTC
(In reply to Thomas from comment #4)
> I now have a build log from version 4.4.2.2 (with my patches applied), it's
> about 500kB (xz compressed), are you interested ?

Please attach the file here.
Comment 6 Andreas K. Hüttel archtester gentoo-dev 2015-04-11 21:00:59 UTC
(In reply to Andreas K. Hüttel from comment #5)
> (In reply to Thomas from comment #4)
> > I now have a build log from version 4.4.2.2 (with my patches applied), it's
> > about 500kB (xz compressed), are you interested ?
> 
> Please attach the file here.

Scratch that. What we need is a *failing* build log, *without* your patches.