Conversation
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/attempting-to-build-qt6/10551/8 |
|
@milahu are there any merge blockers? I'd be glad to merge this before the feature freeze window closes if possible. |
|
Qt 6.3 was released y'day: https://www.qt.io/blog/qt-6.3-released |
|
@ttuegel , do you have time to take a look at this? |
|
And just to add this - I understand that 6.2 is an LTS release, but KDE as eventually the main downstream consumer of Qt6 is presumably going to be requiring the latest and thus 6.3 is likely to be a requirement for that. Of course, there is nothing preventing us from carrying both the latest LTS as well as the latest and greatest. |
| , qtbase | ||
| , qtx11extras | ||
| , qtx11extras ? null # qt5 | ||
| , qt5compat ? null # qt6 |
| taglib | ||
| qtbase | ||
| qtx11extras | ||
| ] ++ lib.optionals (lib.versions.major qtbase.version == "5") [ |
There was a problem hiding this comment.
I wondering if we should introduce isQt5 and isQt6 helpers like what we have for Python as this check (or a variation of it) is most likely going to be littered all over the place.
| @@ -0,0 +1,81 @@ | |||
| # Qt 5 Maintainer's Notes | |||
There was a problem hiding this comment.
There's a few references to Qt 5 that should Qt 6.
"someone" (sorry, i have no energy for this) would need to squash all the qt6 commits apart from that ... not that i know of. it's "basically working"
yepp. better than "death by perfectionism" |
|
Adding qt6 isn't a breaking change so it can be merged anytime and backported |
| ## Minor Updates | ||
|
|
||
| Let `$major` be the major version number, e.g. `5.9`. | ||
|
|
||
| 1. Change the version number in the `$major/fetch.sh`. | ||
| 2. Run `./maintainers/scripts/fetch-kde-qt.sh pkgs/development/libraries/qt-5/$major` | ||
| from the top of the Nixpkgs tree. | ||
|
|
||
| See below if it is necessary to update any patches. | ||
|
|
||
| ## Major Updates | ||
|
|
||
| Let `$major` be the new major version number, e.g. `5.10`. | ||
|
|
||
| 1. Copy the subdirectory from the previous major version to `$major`. | ||
| 2. Change the version number in `$major/fetch.sh`. | ||
| 3. Run `./maintainers/scripts/fetch-kde-qt.sh pkgs/development/libraries/qt-5/$major` | ||
| from the top of the Nixpkgs tree. | ||
| 4. Add a top-level attribute in `pkgs/top-level/all-packages.nix` for the new | ||
| major version. | ||
| 5. Change the `qt5` top-level attribute to point to the new major version. | ||
| 6. If the previous major version is _not_ a long-term support release, | ||
| remove it from Nixpkgs. | ||
|
|
||
| See below if it is necessary to update any patches. |
There was a problem hiding this comment.
All of this should change with Qt 6 because there are not LTS releases anymore. We should only track the latest version in Nixpkgs. (Aside from that, having multiple Qt 5 versions in Nixpkgs never worked correctly anyway.)
|
|
||
| See below if it is necessary to update any patches. | ||
|
|
||
| ## Patches |
There was a problem hiding this comment.
None of this is applicable anymore.
| , qtbase | ||
| , qtdeclarative | ||
| , libiconv | ||
| # FIXME Configure summary: qt5compat is not using libiconv. bug in qt6? |
There was a problem hiding this comment.
To use libiconv in some module like qt5compat, we probably need to enable the corresponding feature in the qtbase build.
| in | ||
|
|
||
| qtModule { | ||
| pname = "qtwebkit"; |
There was a problem hiding this comment.
I really think we should drop qtwebkit from Qt 6.
| qt5 used `configure`. for example `./configure -system-ffmpeg` | ||
|
|
||
| qt6 uses cmake, so we need ... |
There was a problem hiding this comment.
Does this mean that all configureFlags should be removed from (for example) the qtbase build?
There was a problem hiding this comment.
iirc, some options go to configure, other options go to cmake
ive added a script to the readme to list the available cmake options
|
Note: |
|
Anything holding this back still? tdesktop 3.7.0 also requires Qt6 now, and the current version requires some jank to keep going (see #169180). |
|
I think the biggest blocker is whether it builds. |
|
Just picked this up https://github.com/NickCao/nixpkgs/tree/qt6 and bumped it to qt 6.3.0, surprisingly most of the things builds with minor fixes (with qtwebengine as the only exception). tdesktop 3.7.0 builds and works fine with this. |
|
|
I also tested tdesktop 3.7.0 from your branch, works fine. |
|
@NickCao thx : ) im curious how 8b2eed21b7ecdb8f788810f21ea927c0cabea8c5 works ... Detailsiirc, my goal was to make the qt libs usable in cmake projects before the line in the generated so, in my remote diagnosis, your version should break the tdesktop build, but apparently it works? maybe this was fixed between qt 6.2 and 6.3 |
This patch caused a lot of headaches for Qt 5 and in the strongest way possible, I would encourage us not to make that mistake again. Maintainers should set up the correct wrappers for their applications. |
Me myself don't know how either, I removed that line simply because it was patching too much, breaking unrelated cmake files specifically the one for libdrm vendoered in qtbase. And somehow, it just works. |
|
Still needs lots of cleanup and resyncing the improvements to the qt5 packaging made during the time this pr has been open The |
|
Tinkered a little bit around the cmake patching hacks, found that it seems all the patched files are named SomeQtComponentTargets{,-release}.cmake and is generated by cmake. Can we just patch the template from which the cmake files are generated and solve this once and for all? |
|
By applying a questionable and overfitting patch atop cmake, I managed to cut the hacky list of regex by half. |
|
By further neglecting support for qmake, the final approach is now clean and clear: |
|
Just noticed that the qt plugins depends on the main output in their rpaths, so what's the point of splitting them into another output? |
|
Also as the coexisting multiple minor qt versions approach has never really worked out, dropping that also looks like a nice choice for me. |
what's the issue with qtwebengine? |
|
|
|
oh .. stupid patchShebangs is confused by the nixpkgs/pkgs/build-support/setup-hooks/patch-shebangs.sh Lines 64 to 71 in bf27ea9 you could try {
postPatch = ''
sed -i.bak 's|^#!/usr/bin/env -S deno|#! ${deno}/bin/deno|' ./third_party/webgpu-cts/src/tools/deno
diff -u ./third_party/webgpu-cts/src/tools/deno{.bak,} || true; exit 1 # debug
''; |
closed in favor of #169296
Motivation for this change
add latest version of qt, compile from source
Status
all builds are passing
libraries are usable in cmake projects
qmake support is not implemented, but has low priority (qmake is deprecated, qmake2cmake)
estimated build times on 4x2.4GHz
build
qt6 apps
https://github.com/milahu/awesome-qt6
contributing
feel free to help me with this beast ...
common problems (and solutions) with packaging qt6 for nixos: packaging-qt6.md
related
todo
qtvirtualkeyboardis currently disabled inqt-6/6.2/default.nixcmake2qmake(in old versions this was calledpro2cmake.py)cmake2qmakecurrently? qtbase? qtbase.dev?qimgvwith qt6. qimgv needs qtbase, qtdeclarative, qtsvgexport TERM=dumbCMake Warning at CMakeLists.txt:536 (message): The Qt sqlite driver test failed.cmake/PySideHelpers.cmaketo detect qt modules inQT_ADDITIONAL_PACKAGES_PREFIX_PATH, which is set inqtModule.nixsetupHookQML2_IMPORT_PATHfor qml apps (qtdeclarative)pkgs/development/libraries/qt-6/hooks/wrap-qt-apps-hook.shqtbase.isQt6andqtbase.isQt5etcQT_PLUGIN_PATH, see qt6: init at 6.2.0 #141883 (comment)Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)