FS#34088 - [qt5-base] headers should be installed in /usr/include/qt5

Attached to Project: Arch Linux
Opened by Weng Xuetian (csslayer) - Friday, 01 March 2013, 15:20 GMT
Last edited by Andrea Scarpino (BaSh) - Friday, 01 March 2013, 20:40 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Andrea Scarpino (BaSh)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:
if qt4 and qt5 installed at the same time, if there is any other library use /usr/include as its include directory, and the path is being put before qt4's include, moc will use /usr/include with higher priority and generate moc with qt5 header.

The solution is to put qt5's include in a separate directory like /usr/include/qt5, for people using cmake, pkg_check_modules and any other macro will possibly returns /usr/include for a library, and no one will notice it will conflict with two different Qt install.

cmake 2.8.10.2-3
qt4 4.8.4-9
qt5-base 5.0.1-4
This task depends upon

Closed by  Andrea Scarpino (BaSh)
Friday, 01 March 2013, 20:40 GMT
Reason for closing:  Fixed
Additional comments about closing:  qt5-base 5.0.1-5
Comment by Andrea Scarpino (BaSh) - Friday, 01 March 2013, 15:34 GMT
qmake always have to refers to the 5.x version when it's installed, and qmake4 to the 4.x one.
So, isn't this fixed using -DQT_QMAKE_EXECUTABLE=qmake4 ?
Comment by Yichao Yu (yuyichao) - Friday, 01 March 2013, 15:36 GMT
NO, it is about the moc include path. and has nothing to do with qmake.
The version of qmake and moc is correct, but the include path of other packages causes moc to include qt5 before qt4
Comment by Andrea Scarpino (BaSh) - Friday, 01 March 2013, 15:41 GMT
how could I reproduce this?
Comment by Yichao Yu (yuyichao) - Friday, 01 March 2013, 15:45 GMT
install qt4 and qt5
compile fcitx
Comment by Andrea Scarpino (BaSh) - Friday, 01 March 2013, 15:52 GMT
I'm trying to build it.
Anyway, I'd say that this is a bug in cmake: they should query qmake (qmake4 in this case) to find the binaries to use.
Comment by Yichao Yu (yuyichao) - Friday, 01 March 2013, 15:54 GMT
No, the binary is correct. moc of qt4 is used correctly. It's about include path not binary!...
Comment by Andrea Scarpino (BaSh) - Friday, 01 March 2013, 15:57 GMT
Ok, then replace binaries by includes in my previous comment:

Anyway, I'd say that this is a bug in cmake: they should query qmake (qmake4 in this case) to find the headers to use.

Talking seriously, I'll talk with upstream about this.
Comment by Yichao Yu (yuyichao) - Friday, 01 March 2013, 16:03 GMT
If it is not clear enough, this is NOT a bug in cmake.
The correct include directory is found!! But the extra include path from other packages needed by the project pull in /usr/include, which causes the trouble of moc!!
Comment by Andrea Scarpino (BaSh) - Friday, 01 March 2013, 16:27 GMT
Attaching the fcitx failed build log useful for future references
   fcitx.log (444.6 KiB)
Comment by Yichao Yu (yuyichao) - Friday, 01 March 2013, 16:32 GMT
And fyi, this is the line that causes the error

cd /build/src/build/src/frontend/qt && /usr/lib/qt4/bin/moc -I/build/src/build -I/build/src/build/src -I/build/src/fcitx-4.2.7/src -I/build/src/fcitx-4.2.7/src/lib -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include/qt4 -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtDBus -I/build/src/build/src/frontend/qt -I/build/src/fcitx-4.2.7/src/frontend/qt -o /build/src/build/src/frontend/qt/moc_qfcitxinputcontext.cxx /build/src/fcitx-4.2.7/src/frontend/qt/qfcitxinputcontext.h
Comment by Weng Xuetian (csslayer) - Friday, 01 March 2013, 16:41 GMT
As you can see, -I/usr/include appears before the qt include dir, and make the moc find the wrong qt header file.

But that's not avoidable, when do the compile, people use cmake to check other library header, and they might return /usr/include, and you just can't let every people to make sure that qt's include directory is put at the very beginning, that's not possible.

This problem is not limit to cmake, but any other build system which use moc on arch.
Comment by Andrea Scarpino (BaSh) - Friday, 01 March 2013, 16:51 GMT
Sorry, I guess that I've finally understood your issue :) Have been a busy day.

I'll push a new set of qt5* packages with /usr/include/qt5 as headers locations

Loading...