lxqt / libqtxdg

Qt implementation of freedesktop.org xdg specs
https://lxqt.github.io
GNU Lesser General Public License v2.1
72 stars 35 forks source link

Started Qt6 port #272

Closed tsujan closed 5 months ago

tsujan commented 2 years ago

Depends on lxqt-build-tools#77

tsujan commented 2 years ago

Rebasing done. Now, it should be compiled with -DQTXDG_INSTALL_DEFAPPS_CONFIG=OFF, until LXQt is ported to Qt6 and the same option is used for Qt5 instead.

yan12125 commented 1 year ago

I got a test failure:

FAIL!  : QtXdgTest::testCustomFormat() 'test2.value(QStringLiteral("text/plain")) == QLatin1String("gvim.desktop")' returned FALSE. ()
   Loc: [/usr/src/debug/libqtxdg-qt6-git/libqtxdg/test/qtxdg_test.cpp(124)]
tsujan commented 1 year ago

I got a test failure:

Yes, I get this mysterious failure too!

tsujan commented 1 year ago

OK, it was because of a (logical) change of behavior in Qt6's QVariant. Fixed now.

tsimonq2 commented 1 year ago

Any thoughts on the following compilation error I'm getting?

[ 47%] Building CXX object src/qtxdg/CMakeFiles/Qt6Xdg.dir/xdgicon.cpp.o
cd /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/qtxdg && /usr/bin/c++ -DLXQT_DATA_DIR=\"/usr/share\" -DLXQT_ETC_XDG_DIR=\"\" -DLXQT_GRAPHICS_DIR=\"/usr/share/lxqt2/graphics\" -DLXQT_RELATIVE_SHARE_DIR=\"lxqt2\" -DLXQT_RELATIVE_SHARE_TRANSLATIONS_DIR=\"lxqt2/translations\" -DLXQT_SHARE_DIR=\"/usr/share/lxqt2\" -DLXQT_SHARE_TRANSLATIONS_DIR=\"/usr/share/lxqt2/translations\" -DQTXDG_COMPILATION=\"1\" -DQTXDG_VERSION=\"3.11.0\" -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_FOREACH -DQT_NO_KEYWORDS -DQT_NO_URL_CAST_FROM_STRING -DQT_SVG_LIB -DQT_USE_QSTRINGBUILDER -DQT_WIDGETS_LIB -DQT_XML_LIB -DQt6Xdg_EXPORTS -I/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/qtxdg -I/<<PKGBUILDDIR>>/src/qtxdg -I/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/qtxdg/Qt6Xdg_autogen/include -I/usr/include/x86_64-linux-gnu/qt6/QtGui/6.4.2 -I/usr/include/x86_64-linux-gnu/qt6/QtGui/6.4.2/QtGui -I/usr/include/x86_64-linux-gnu/qt6/QtCore/6.4.2 -I/usr/include/x86_64-linux-gnu/qt6/QtCore/6.4.2/QtCore -I/usr/include/x86_64-linux-gnu/qt6/QtDBus/6.4.2 -I/usr/include/x86_64-linux-gnu/qt6/QtDBus/6.4.2/QtDBus -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/gio-unix-2.0 -I/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/InTreeBuild/include/qt6xdgiconloader -I/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/InTreeBuild/include -I/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/InTreeBuild/include/qt6xdgiconloader/3.11.0 -isystem /usr/include/x86_64-linux-gnu/qt6/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt6 -isystem /usr/include/x86_64-linux-gnu/qt6/QtCore -isystem /usr/lib/x86_64-linux-gnu/qt6/mkspecs/linux-g++ -isystem /usr/include/x86_64-linux-gnu/qt6/QtGui -isystem /usr/include/x86_64-linux-gnu/qt6/QtXml -isystem /usr/include/x86_64-linux-gnu/qt6/QtDBus -isystem /usr/include/x86_64-linux-gnu/qt6/QtSvg -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fdebug-prefix-map=/<<PKGBUILDDIR>>=/usr/src/libqt6xdg-3.11.0-0ubuntu1 -Wdate-time -D_FORTIFY_SOURCE=2 -fno-exceptions -Wall -Wextra -Wchar-subscripts -Wno-long-long -Wpointer-arith -Wundef -Wformat-security -Wnon-virtual-dtor -Woverloaded-virtual -Wpedantic -O2 -g -DNDEBUG -std=c++17 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -fPIC -MD -MT src/qtxdg/CMakeFiles/Qt6Xdg.dir/xdgicon.cpp.o -MF CMakeFiles/Qt6Xdg.dir/xdgicon.cpp.o.d -o CMakeFiles/Qt6Xdg.dir/xdgicon.cpp.o -c /<<PKGBUILDDIR>>/src/qtxdg/xdgicon.cpp
In file included from /usr/include/c++/13/vector:65,
                 from /usr/include/c++/13/functional:64,
                 from /usr/include/x86_64-linux-gnu/qt6/QtCore/qchar.h:9,
                 from /usr/include/x86_64-linux-gnu/qt6/QtCore/qstring.h:14,
                 from /usr/include/x86_64-linux-gnu/qt6/QtCore/qcoreapplication.h:8,
                 from /usr/include/x86_64-linux-gnu/qt6/QtGui/qguiapplication.h:8,
                 from /usr/include/x86_64-linux-gnu/qt6/QtGui/QGuiApplication:1,
                 from /<<PKGBUILDDIR>>/util/qtxdg-iconfinder.cpp:21:
/usr/include/c++/13/bits/stl_uninitialized.h: In instantiation of ‘constexpr bool std::__check_constructible() [with _ValueType = unique_ptr<QIconLoaderEngineEntry>; _Tp = const unique_ptr<QIconLoaderEngineEntry>&]’:
/usr/include/c++/13/bits/stl_uninitialized.h:182:4:   required from ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = __gnu_cxx::__normal_iterator<const unique_ptr<QIconLoaderEngineEntry>*, vector<unique_ptr<QIconLoaderEngineEntry> > >; _ForwardIterator = unique_ptr<QIconLoaderEngineEntry>*]’
/usr/include/c++/13/bits/stl_uninitialized.h:373:37:   required from ‘_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, allocator<_Tp>&) [with _InputIterator = __gnu_cxx::__normal_iterator<const unique_ptr<QIconLoaderEngineEntry>*, vector<unique_ptr<QIconLoaderEngineEntry> > >; _ForwardIterator = unique_ptr<QIconLoaderEngineEntry>*; _Tp = unique_ptr<QIconLoaderEngineEntry>]’
/usr/include/c++/13/bits/stl_vector.h:603:31:   required from ‘std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = std::unique_ptr<QIconLoaderEngineEntry>; _Alloc = std::allocator<std::unique_ptr<QIconLoaderEngineEntry> >]’
/<<PKGBUILDDIR>>/util/qtxdg-iconfinder.cpp:56:35:   required from here
/usr/include/c++/13/bits/stl_uninitialized.h:90:56: error: static assertion failed: result type must be constructible from input type
   90 |       static_assert(is_constructible<_ValueType, _Tp>::value,
      |                                                        ^~~~~
/usr/include/c++/13/bits/stl_uninitialized.h:90:56: note: ‘std::integral_constant<bool, false>::value’ evaluates to false
make[3]: *** [util/CMakeFiles/qtxdg-iconfinder.dir/build.make:93: util/CMakeFiles/qtxdg-iconfinder.dir/qtxdg-iconfinder.cpp.o] Error 1
make[3]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
make[2]: *** [CMakeFiles/Makefile2:363: util/CMakeFiles/qtxdg-iconfinder.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
tsujan commented 1 year ago

@tsimonq2, thanks for reversing the change!

These questions come to mind:

If the answer to the last question is negative, we might need to bump the minimum required version — actually, we should do it sooner or later, but, sadly, Qt 6.5.2 has a serious regression about Wayland.

tsujan commented 5 months ago

Any objection to merging? If there's a need to further changes, they could be made more consistently after merging it.

stefonarch commented 5 months ago

Do we need to create a build_with_qt5 branch for the compiling scripts here and in the other 2 coexisting ones?

tsujan commented 5 months ago

I'm not an expert in the script, but I think it may not be usable until we finish the Qt6 port.

stefonarch commented 5 months ago

It should be still usable with my PR, but it will build only qt6 for the merged branches, so no qt5 support anymore. Unfortunately my connection times out often with downloads, so I can't really test, but will try in the VM.