iyzsong pushed a commit to branch qt-team
in repository guix.
commit 4c1756e701f7b23e80602e6887e148f3fdd190c9
Author: 宋文武 <[email protected]>
AuthorDate: Tue Feb 4 14:46:01 2025 +0800
gnu: qtbase: Update to 6.8.2.
* gnu/packages/patches/qtbase-find-tools-in-PATH.patch: Remove patch.
* gnu/local.mk (dist_patch_DATA): Remove it.
* gnu/packages/patches/qtbase-qmake-use-libname.patch: Adjust for 6.8.2.
* gnu/packages/qt.scm (qtbase): Update to 6.8.2.
[source]: Remove unused 'qtbase-find-tools-in-PATH.patch', instead we can
set
QT_OPTIONAL_TOOLS_PATH for cmake.
[native-inputs]: Add ninja.
[inputs]: Delete libxkbcommon-1.5.
[propagated-inputs]: Add libxkbcommon and vulkan-headers.
[arguments] <configure-flags>: Add "-GNinja".
<phases>: Replace build and instal phases for Ninja.
Update do-not-capture-python phase. Skip failing tests.
Fix QT_ADDITIONAL_PACKAGES_PREFIX_PATH, which needs to be semicolon
separated.
Change-Id: Ifa3464cfc025638affc73eca8c86f5123ba6064e
---
gnu/local.mk | 1 -
.../patches/qtbase-find-tools-in-PATH.patch | 49 ----------------------
.../patches/qtbase-qmake-use-libname.patch | 25 ++++-------
gnu/packages/qt.scm | 47 +++++++++++++++++----
4 files changed, 47 insertions(+), 75 deletions(-)
diff --git a/gnu/local.mk b/gnu/local.mk
index ac19734a3e..604ca7dc64 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2132,7 +2132,6 @@ dist_patch_DATA =
\
%D%/packages/patches/qemu-fix-agent-paths.patch \
%D%/packages/patches/qrcodegen-cpp-cmake.patch \
%D%/packages/patches/qtbase-absolute-runpath.patch \
- %D%/packages/patches/qtbase-find-tools-in-PATH.patch \
%D%/packages/patches/qtbase-qmake-fix-includedir.patch \
%D%/packages/patches/qtbase-qmlimportscanner-qml-import-path.patch \
%D%/packages/patches/qtbase-moc-ignore-gcc-macro.patch \
diff --git a/gnu/packages/patches/qtbase-find-tools-in-PATH.patch
b/gnu/packages/patches/qtbase-find-tools-in-PATH.patch
deleted file mode 100644
index d5e38b09be..0000000000
--- a/gnu/packages/patches/qtbase-find-tools-in-PATH.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-Patch retrieved from NixOS
-
-https://github.com/NixOS/nixpkgs/blob/93ecdaa1f34354c9476062dc4fe323b442c087d5/pkgs/development/libraries/qt-6/patches/0006-qtbase-find-tools-in-PATH.patch
-
-From a8b9fae710a2bd5e743f5e16364eaa8c38dbd784 Mon Sep 17 00:00:00 2001
-From: rewine <[email protected]>
-Date: Wed, 29 Mar 2023 11:51:33 +0800
-Subject: [PATCH 06/11] qtbase-find-tools-in-PATH
-
-1. find qt's tools in `QTTOOLSPATH` env
- qt assumes that all components use the same install prefix
- we can't get the real prefix for qttools when build qtbase
- we will add /libexec to `QTTOOLSPATH` in qtToolsHook
- find_path will also search in 'PATH' by default
- see `CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`
-
-2. disable tool_dependencies_enabled
- We can guarantee the build order of qt components in nixpkgs
- tools in qttools always build before qtdoc
- qdoc_bin is not a build target now, since we find it in `QTTOOLSPATH`
----
- cmake/QtDocsHelpers.cmake | 11 ++++++++---
- 1 file changed, 8 insertions(+), 3 deletions(-)
-
-diff --git a/cmake/QtDocsHelpers.cmake b/cmake/QtDocsHelpers.cmake
-index 48ed5a324bf..91d8d41fb1f 100644
---- a/cmake/QtDocsHelpers.cmake
-+++ b/cmake/QtDocsHelpers.cmake
-@@ -47,9 +47,14 @@ function(qt_internal_add_docs)
- set(doc_tools_libexec
"${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}/${INSTALL_LIBEXECDIR}")
- endif()
-
-- set(qdoc_bin "${doc_tools_bin}/qdoc${CMAKE_EXECUTABLE_SUFFIX}")
-- set(qtattributionsscanner_bin
"${doc_tools_libexec}/qtattributionsscanner${CMAKE_EXECUTABLE_SUFFIX}")
-- set(qhelpgenerator_bin
"${doc_tools_libexec}/qhelpgenerator${CMAKE_EXECUTABLE_SUFFIX}")
-+ set(tool_dependencies_enabled FALSE)
-+
-+ find_path(qdoc_path name qdoc PATHS ENV QTTOOLSPATH)
-+ find_path(qtattributionsscanner_path name qtattributionsscanner PATHS ENV
QTTOOLSPATH)
-+ find_path(qhelpgenerator_path name qhelpgenerator PATHS ENV QTTOOLSPATH)
-+ set(qdoc_bin "${qdoc_path}/qdoc${CMAKE_EXECUTABLE_SUFFIX}")
-+ set(qtattributionsscanner_bin
"${qtattributionsscanner_path}/qtattributionsscanner${CMAKE_EXECUTABLE_SUFFIX}")
-+ set(qhelpgenerator_bin
"${qhelpgenerator_path}/qhelpgenerator${CMAKE_EXECUTABLE_SUFFIX}")
-
- get_target_property(target_type ${target} TYPE)
- if (NOT target_type STREQUAL "INTERFACE_LIBRARY")
---
-2.42.0
-
diff --git a/gnu/packages/patches/qtbase-qmake-use-libname.patch
b/gnu/packages/patches/qtbase-qmake-use-libname.patch
index 0bc2094d86..385c688a65 100644
--- a/gnu/packages/patches/qtbase-qmake-use-libname.patch
+++ b/gnu/packages/patches/qtbase-qmake-use-libname.patch
@@ -12,15 +12,11 @@ and then used in linker flags. However as the libraries can
be provided
by qt modules other than the one currently being built, the ebedded
paths can be incorrect.
---
- cmake/QtFinishPrlFile.cmake | 7 ++++---
- cmake/QtGenerateLibHelpers.cmake | 3 ---
- 2 files changed, 4 insertions(+), 6 deletions(-)
-
diff --git a/cmake/QtFinishPrlFile.cmake b/cmake/QtFinishPrlFile.cmake
index 32169e418c..4e754af367 100644
--- a/cmake/QtFinishPrlFile.cmake
+++ b/cmake/QtFinishPrlFile.cmake
-@@ -61,9 +61,10 @@ foreach(line ${lines})
+@@ -69,9 +69,10 @@ foreach(line ${lines})
endif()
list(APPEND adjusted_libs "-framework"
"${CMAKE_MATCH_1}")
else()
@@ -38,16 +34,13 @@ diff --git a/cmake/QtGenerateLibHelpers.cmake
b/cmake/QtGenerateLibHelpers.cmake
index e3f4bbf881..f8bd26acc7 100644
--- a/cmake/QtGenerateLibHelpers.cmake
+++ b/cmake/QtGenerateLibHelpers.cmake
-@@ -70,9 +70,6 @@ function(qt_transform_absolute_library_paths_to_link_flags
out_var library_path_
- string(TOLOWER "${dir}" dir_lower)
- # If library_path isn't in default link directories, we should
add it to link flags.
- list(FIND IMPLICIT_LINK_DIRECTORIES_LOWER "${dir_lower}" index)
-- if(${index} EQUAL -1)
-- list(APPEND out_list "-L\"${dir}\"")
-- endif()
+@@ -82,9 +82,6 @@ function(qt_transform_absolute_library_paths_to_link_flags
out_var library_path_
+ # If library_path isn't in default link directories, we
should add it to link flags.
+ # But we shouldn't add it duplicately.
+ list(FIND IMPLICIT_LINK_DIRECTORIES_LOWER "${dir_lower}"
index)
+- if(index EQUAL -1 AND NOT "-L\"${dir}\"" IN_LIST out_list)
+- list(APPEND out_list "-L\"${dir}\"")
+- endif()
+ endif()
list(APPEND out_list "${lib_name_with_link_flag}")
else()
- list(APPEND out_list "${library_path}")
---
-2.39.2
-
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 430f0bb96d..66b43d7a78 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015, 2023 Andreas Enge <[email protected]>
-;;; Copyright © 2015 Sou Bunnbu <[email protected]>
+;;; Copyright © 2015, 2025 宋文武 <[email protected]>
;;; Copyright © 2015, 2018, 2019, 2020, 2021, 2023 Ludovic Courtès
<[email protected]>
;;; Copyright © 2015-2019, 2024 Efraim Flashner <[email protected]>
;;; Copyright © 2016, 2017 Nikita <[email protected]>
@@ -758,13 +758,13 @@ developers using C++ or QML, a CSS & JavaScript like
language.")
(package
(inherit qtbase-5)
(name "qtbase")
- (version "6.7.2")
+ (version "6.8.2")
(source (origin
(inherit (package-source qtbase-5))
(uri (qt-url name version))
(sha256
(base32
- "16bmfrjfxjajs6sqg1383ihhfwwf69ihkpnpvsajh5pv21g2mwn5"))
+ "01gy1p8zvxq8771x6iqkrc7s3kzdddgf1i7xj656w7j1dp746801"))
(modules '((guix build utils)))
(snippet
;; corelib uses bundled harfbuzz, md4, md5, sha3
@@ -778,14 +778,14 @@ developers using C++ or QML, a CSS & JavaScript like
language.")
"qtbase-absolute-runpath.patch"
"qtbase-qmake-use-libname.patch"
"qtbase-qmlimportscanner-qml-import-path.patch"
- "qtbase-find-tools-in-PATH.patch"
"qtbase-qmake-fix-includedir.patch"))))
(build-system cmake-build-system)
(arguments
(substitute-keyword-arguments (package-arguments qtbase-5)
((#:configure-flags _ ''())
`(let ((out (assoc-ref %outputs "out")))
- (list "-DQT_BUILD_TESTS=ON"
+ (list "-GNinja" ;officially supported
+ "-DQT_BUILD_TESTS=ON"
(string-append "-DINSTALL_ARCHDATADIR=" out "/lib/qt6")
(string-append "-DINSTALL_DATADIR=" out "/share/qt6")
(string-append "-DINSTALL_DOCDIR=" out "/share/doc/qt6")
@@ -818,6 +818,16 @@ developers using C++ or QML, a CSS & JavaScript like
language.")
"-DBUILD_WITH_PCH=OFF")))
((#:phases phases)
#~(modify-phases #$phases
+ (replace 'build
+ (lambda* (#:key parallel-build? #:allow-other-keys)
+ (apply invoke "cmake" "--build" "."
+ (if parallel-build?
+ `("--parallel" ,(number->string
+ (parallel-job-count)))
+ '()))))
+ (replace 'install
+ (lambda _
+ (invoke "cmake" "--install" ".")))
(add-after 'unpack 'honor-CMAKE_PREFIX_PATH
(lambda _
;; The configuration files for other Qt packages are searched
@@ -837,8 +847,12 @@ developers using C++ or QML, a CSS & JavaScript like
language.")
;; 'qmlimportscanner' from qtdeclarative work out of the
;; box.
(substitute* "cmake/QtConfig.cmake.in"
- (("(set\\(QT_ADDITIONAL_PACKAGES_PREFIX_PATH )\"\"" _ head)
- (string-append head "\"$ENV{CMAKE_PREFIX_PATH}\"")))))
+ (("set\\(QT_ADDITIONAL_HOST_PACKAGES_PREFIX_PATH" below)
+ (string-append "
+if(QT_ADDITIONAL_PACKAGES_PREFIX_PATH STREQUAL \"\")
+ cmake_path(CONVERT $ENV{CMAKE_PREFIX_PATH} TO_CMAKE_PATH_LIST
+ QT_ADDITIONAL_PACKAGES_PREFIX_PATH)
+endif()\n" below)))))
(delete 'patch-bin-sh)
(delete 'patch-xdg-open)
;; Some tests fail to build on i686-linux
@@ -877,7 +891,8 @@ tst_qt_cmake_create.cpp"
(delete 'do-not-capture-python) ;move after patch-source-shebangs
(add-after 'patch-source-shebangs 'do-not-capture-python
(lambda _
- (substitute* '("mkspecs/features/uikit/devices.py"
+ (substitute* '("libexec/qt-android-runner.py"
+ "mkspecs/features/uikit/devices.py"
"util/testrunner/qt-testrunner.py"
"util/testrunner/sanitizer-testrunner.py")
(((which "python3"))
@@ -1045,6 +1060,14 @@ tst_qt_cmake_create.cpp"
;; "/home", "/etc" or "/root" and fail.
"tst_qcompleter"
"tst_qfiledialog"
+ ;; The following tests fail with: "Generation of UI
+ ;; files were triggered in the second build", but could
+ ;; pass in `guix shell --container`.
+ "test_qt_add_ui_1"
+ "test_qt_add_ui_2"
+ "test_qt_add_ui_6"
+ "test_qt_add_ui_8"
+ "test_qt_add_ui_9"
;; This test is susceptible to the 600 ms timeout used:
"tst_qpauseanimation")
#$@(cond
@@ -1133,11 +1156,17 @@ tst_qt_cmake_create.cpp"
(string-append #$output "/tests"))))))))
(native-inputs
(modify-inputs (package-native-inputs qtbase-5)
- (prepend tzdata-for-tests
+ (prepend ninja ;CMake Generator, also used for tests
+ tzdata-for-tests
wayland-protocols
xvfb-run)))
+ (propagated-inputs
+ (modify-inputs (package-propagated-inputs qtbase-5)
+ ;; Required by Qt6GuiDependencies.cmake.
+ (prepend libxkbcommon vulkan-headers)))
(inputs
(modify-inputs (package-inputs qtbase-5)
+ (delete "libxkbcommon") ;qtbase-5 use libxkbcommon-1.5
(prepend at-spi2-core
bash-minimal
coreutils-minimal