My system has both qt5+6 due to dependencies (Arch Linux - qt5-base 5.15.18+kde+r109-2 (x86_64) (“Required by")).
CMake starts off rough by alluding to there being an error even after it said it configured:
<...>
-- Configuring done (5.5s)
CMake Error: The INTERFACE_QT_MAJOR_VERSION property of "Qt5::Core" does
not agree with the value of QT_MAJOR_VERSION already determined
for "jami".
-- Generating done (0.2s)
CMake Generate step failed.
So moving ahead, I just attempted to build it anyway.
I eventually hit an error that looks to be because it’s including headers for qt5 instead:
[ 37%] Building CXX object CMakeFiles/jami.dir/jami_autogen/mocs_compilation.cpp.o
/usr/bin/c++ -DAPPSTORE=0 -DCRASH_REPORT_URL=\"\" -DENABLE_CRASHREPORTS=0 -DENABLE_LIBWRAP=true -DHUNSPELL_INSTALL_DIR=\"\" -DJAMI_INSTALL_PREFIX=\"/usr/local/share\" -DQT_CONCURRENT_LIB -DQT_CORE5COMPAT_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_NO_KEYWORDS -DQT_OPENGL_LIB -DQT_POSITIONING_LIB -DQT_PRINTSUPPORT_LIB -DQT_QMLINTEGRATION_LIB -DQT_QMLMETA_LIB -DQT_QMLMODELS_LIB -DQT_QMLWORKERSCRIPT_LIB -DQT_QML_LIB -DQT_QUICK_LIB -DQT_SQL_LIB -DQT_SVG_LIB -DQT_WEBCHANNELQUICK_LIB -DQT_WEBCHANNEL_LIB -DQT_WEBENGINECORE_LIB -DQT_WEBENGINEQUICK_LIB -DQT_WEBENGINEWIDGETS_LIB -DQT_WIDGETS_LIB -DQWK_CORE_STATIC -DQWK_QUICK_STATIC -DUSE_LIBNOTIFY -DWITH_WEBENGINE=1 -I/<pathTo>/jami-client-qt/build -I/<pathTo>/jami-client-qt -I/<pathTo>/jami-client-qt/build/jami_autogen/include -I/usr/local/include/jami -I/<pathTo>/jami-client-qt/src/libclient -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glycin-2 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gio-unix-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/sysprof-6 -I/<pathTo>/jami-client-qt/src/app -I/<pathTo>/jami-client-qt/build/_deps/qwindowkit-build/include -I/<pathTo>/jami-client-qt/src/version_info -I/<pathTo>/jami-client-qt/build/include -I/<pathTo>/jami-client-qt/3rdparty/hunspell/src -I/<pathTo>/jami-client-qt/build/_deps/qwindowkit-build/src/../include -isystem /usr/include/qt6/QtCore -isystem /usr/include/qt6 -isystem /usr/lib/qt6/mkspecs/linux-g++ -isystem /usr/include/qt -isystem /usr/include/qt/QtCore -isystem /usr/lib/qt/mkspecs/linux-g++ -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtQuick -isystem /usr/include/qt/QtQmlModels -isystem /usr/include/qt/QtQml -isystem /usr/include/qt/QtNetwork -isystem /usr/include/hunspell -isystem /usr/include/qt6/QtQuick -isystem /usr/include/qt6/QtGui -isystem /usr/include/qt6/QtQml -isystem /usr/include/qt6/QtQmlIntegration -isystem /usr/include/qt6/QtNetwork -isystem /usr/include/qt6/QtQmlMeta -isystem /usr/include/qt6/QtQmlModels -isystem /usr/include/qt6/QtQmlWorkerScript -isystem /usr/include/qt6/QtOpenGL -isystem /usr/include/qt6/QtSvg -isystem /usr/include/qt6/QtSql -isystem /usr/include/qt6/QtConcurrent -isystem /usr/include/qt6/QtCore5Compat -isystem /usr/include/qt6/QtMultimedia -isystem /usr/include/qt6/QtWidgets -isystem /usr/include/qt6/QtPositioning -isystem /usr/include/qt6/QtWebEngineCore -isystem /usr/include/qt6/QtWebChannel -isystem /usr/include/qt6/QtWebEngineQuick -isystem /usr/include/qt6/QtWebChannelQuick -isystem /usr/include/qt6/QtWebEngineWidgets -isystem /usr/include/qt6/QtPrintSupport -isystem /usr/include/qt6/QtDBus -std=gnu++17 -pthread -I/usr/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/sysprof-6 -pthread -I/usr/include/gio-unix-2.0 -I/usr/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/sysprof-6 -pthread -I/usr/include -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glycin-2 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gio-unix-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/sysprof-6 -pthread -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glycin-2 -I/usr/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/sysprof-6 -pthread -mno-direct-extern-access -fPIC -MD -MT CMakeFiles/jami.dir/jami_autogen/mocs_compilation.cpp.o -MF CMakeFiles/jami.dir/jami_autogen/mocs_compilation.cpp.o.d -o CMakeFiles/jami.dir/jami_autogen/mocs_compilation.cpp.o -c /<pathTo>/jami-client-qt/build/jami_autogen/mocs_compilation.cpp
In file included from /usr/include/qt/QtNetwork/QNetworkReply:1,
from /<pathTo>/jami-client-qt/build/jami_autogen/ISMKEKEPX5/../../../src/app/networkmanager.h:25,
from /<pathTo>/jami-client-qt/build/jami_autogen/ISMKEKEPX5/../../../src/app/appversionmanager.h:20,
from /<pathTo>/jami-client-qt/build/jami_autogen/ISMKEKEPX5/../../../src/app/lrcinstance.h:24,
from /<pathTo>/jami-client-qt/build/jami_autogen/ISMKEKEPX5/../../../src/app/abstractlistmodelbase.h:22,
from /<pathTo>/jami-client-qt/build/jami_autogen/ISMKEKEPX5/moc_abstractlistmodelbase.cpp:9,
from /<pathTo>/jami-client-qt/build/jami_autogen/mocs_compilation.cpp:2:
/usr/include/qt/QtNetwork/qnetworkreply.h:160:38: error: expected identifier before string constant
160 | QT_DEPRECATED_NETWORK_API_5_15_X("Use QNetworkReply::errorOccurred(QNetworkReply::NetworkError) instead")
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/qt/QtNetwork/qnetworkreply.h:160:38: error: expected ‘,’ or ‘...’ before string constant
/usr/include/qt/QtNetwork/qnetworkreply.h:160:109: error: expected ‘;’ at end of member declaration
160 | QT_DEPRECATED_NETWORK_API_5_15_X("Use QNetworkReply::errorOccurred(QNetworkReply::NetworkError) instead")
| ^
| ;
In file included from /usr/include/qt/QtGui/QImage:1,
from /<pathTo>/jami-client-qt/build/jami_autogen/ISMKEKEPX5/../../../src/app/utils.h:25,
from /<pathTo>/jami-client-qt/build/jami_autogen/ISMKEKEPX5/../../../src/app/lrcinstance.h:26:
/usr/include/qt/QtGui/qimage.h:68:7: error: using typedef-name ‘using QStringList = class QList<QString>’ after ‘class’
68 | class QStringList;
| ^~~~~~~~~~~
In file included from /usr/include/qt6/QtCore/qtypeinfo.h:9,
from /usr/include/qt6/QtCore/qglobal.h:45,
from /usr/include/qt6/QtCore/qcompare.h:12,
from /usr/include/qt6/QtCore/qabstractitemmodel.h:9,
from /usr/include/qt6/QtCore/QAbstractListModel:1,
from /<pathTo>/jami-client-qt/build/jami_autogen/ISMKEKEPX5/../../../src/app/abstractlistmodelbase.h:20:
/usr/include/qt6/QtCore/qcontainerfwd.h:40:7: note: ‘using QStringList = class QList<QString>’ has a previous declaration here
40 | using QStringList = QList<QString>;
| ^~~~~~~~~~~
/usr/include/qt/QtGui/qimage.h:72:26: error: conflicting declaration of template ‘template<class T> struct QVector’
72 | template <class T> class QVector;
| ^~~~~~~
/usr/include/qt6/QtCore/qcontainerfwd.h:39:28: note: previous declaration ‘template<class T> using QVector = QList<T>’
39 | template<typename T> using QVector = QList<T>;
| ^~~~~~~
In file included from /usr/include/qt/QtQuick/QQuickImageProvider:1,
from /<pathTo>/jami-client-qt/build/jami_autogen/ISMKEKEPX5/../../../src/app/quickimageproviderbase.h:22,
from /<pathTo>/jami-client-qt/build/jami_autogen/ISMKEKEPX5/../../../src/app/avatarimageprovider.h:20,
from /<pathTo>/jami-client-qt/build/jami_autogen/ISMKEKEPX5/moc_avatarimageprovider.cpp:9,
from /<pathTo>/jami-client-qt/build/jami_autogen/mocs_compilation.cpp:13:
/usr/include/qt/QtQuick/qquickimageprovider.h:106:99: error: ‘QQuickImageProviderOptions’ does not name a type; did you mean ‘QQuickImageProviderPrivate’?
106 | virtual QImage requestImage(const QString &id, QSize *size, const QSize& requestedSize, const QQuickImageProviderOptions &options);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| QQuickImageProviderPrivate
/usr/include/qt/QtQuick/qquickimageprovider.h:107:101: error: ‘QQuickImageProviderOptions’ does not name a type; did you mean ‘QQuickImageProviderPrivate’?
107 | virtual QPixmap requestPixmap(const QString &id, QSize *size, const QSize& requestedSize, const QQuickImageProviderOptions &options);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| QQuickImageProviderPrivate
/usr/include/qt/QtQuick/qquickimageprovider.h:108:116: error: ‘QQuickImageProviderOptions’ does not name a type; did you mean ‘QQuickImageProviderPrivate’?
108 | virtual QQuickTextureFactory *requestTexture(const QString &id, QSize *size, const QSize &requestedSize, const QQuickImageProviderOptions &options);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| QQuickImageProviderPrivate
/usr/include/qt/QtQuick/qquickimageprovider.h:126:108: error: ‘QQuickImageProviderOptions’ does not name a type; did you mean ‘QQuickImageProviderPrivate’?
126 | virtual QQuickImageResponse *requestImageResponse(const QString &id, const QSize &requestedSize, const QQuickImageProviderOptions &options) = 0;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| QQuickImageProviderPrivate
/<pathTo>/jami-client-qt/build/jami_autogen/ISMKEKEPX5/../../../src/app/avatarimageprovider.h:97:26: error: ‘QQuickImageResponse* AvatarImageProvider::requestImageResponse(const QString&, const QSize&)’ marked ‘override’, but does not override
97 | QQuickImageResponse* requestImageResponse(const QString& id, const QSize& requestedSize) override
| ^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/qt6/QtCore/qtcoreglobal.h:13,
from /usr/include/qt6/QtCore/qglobal.h:24:
/usr/include/qt/QtCore/qtextcodec.h:46:1: error: ‘QT_FEATURE_textcodec’ was not declared in this scope; did you mean ‘QT_FEATURE_textdate’?
46 | QT_REQUIRE_CONFIG(textcodec);
| ^~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/jami.dir/build.make:571: CMakeFiles/jami.dir/jami_autogen/mocs_compilation.cpp.o] Error 1
I see it’s looking in /usr/include/qt/(qt5) first, then /usr/include/qt6/, and I’m assuming that’s a problem.
Setting -DQT_DEFAULT_MAJOR_VERSION=6 makes no difference (and shouldn’t even have been needed given: -- Found a suitable Qt version 6.10.0)
build/_install/lib/cmake/qmsetup/cmake/QMSetupAPI.cmake(219): find_package(QT NAMES Qt6;Qt5 COMPONENTS Core REQUIRED ) seems odd that it’d need qt5.
Even more odd that ends up resulting in /usr/lib/cmake/Qt5/Qt5Config.cmake(7): set(Qt5_NOT_FOUND_MESSAGE The Qt5 package requires at least one component ).
At least build/_install/lib/cmake/qmsetup/cmake/QMSetupAPI.cmake(223): find_package(Qt5 COMPONENTS Core REQUIRED ) seems to succeed.
I thought I’d try Arch’s unbundling of qwindowkit (unbundle-qwindowkit.patch · main · Arch Linux / Packaging / Packages / jami-qt · GitLab), but build also failed regarding bannedContact.erase(it) or something.
It looks like if I set -DQT_DIR=/usr/lib/cmake/Qt6, it no longer looks for qt5 includes, but that still doesn’t help much when something like #include <QtCore/private/qobject_p.h> doesn’t exist because the include dirs include the version, eg /usr/include/qt6/QtCore/6.10.0. So the -I needs to be that in order to find that #include.
I don’t know why that isn’t the case organically. Even the QT6 includes needs -I/usr/include/qt6/QtCore/6.10.0/QtCore.
I don’t know why PKGBUILD · main · Arch Linux / Packaging / Packages / jami-qt · GitLab doesn’t need all of this.
I couldn’t use Arch’s zxing because it was missing the MultiFormatReader header.
After using https://gitlab.archlinux.org/archlinux/packaging/packages/jami-qt/-/blob/main/fix-link.patch?ref_type=heads I could finally build, though I don’t know yet if things are working as I’m noticing issues in the log (along with the linked device not syncing).