diff --git a/backport-qttools-Update-FindWrapLibClang.patch b/backport-qttools-Update-FindWrapLibClang.patch new file mode 100644 index 0000000000000000000000000000000000000000..bb7f9969bff4a7242da0b5f9e5704a7364f5907e --- /dev/null +++ b/backport-qttools-Update-FindWrapLibClang.patch @@ -0,0 +1,67 @@ +From 4ea3f090fc7facd71d5525ffc8407859d3948448 Mon Sep 17 00:00:00 2001 +From: Joerg Bornemann +Date: Fri, 15 Aug 2025 11:03:15 +0200 +Subject: CMake: Fix llvm / zstd find_package conflict + +If llvm is built from sources or installed via llvm-provided packages +then it comes with a Findzstd.cmake which is most likely inconsistent +with your system-provided zstdConfig.cmake. Linux distro packagers tend +to remove that file for that reason. + +When configuring qttools, the following happened: +- find_package(llvm) calls find_package(zstd) +- llvm has modified CMAKE_MODULE_PATH to load its own find modules +- llvm's Findzstd.cmake creates the targets zstd::libzstd_shared and + zstd::libzstd_static +- later, in the designer subdir, find_package(WrapZSTD) is called +- that calls find_package(zstd) +- CMAKE_MODULE_PATH has been reset in the meantime, and we don't load + llvm's Findzstd.cmake but the system's zstdConfig.cmake +- that package expects three targets: + - zstd::libzstd_shared + - zstd::libzstd_static + - zstd::libzstd (an alias for one of the two others) +- configuration error, because zstd::libzstd is missing + +We now work around this issue by calling find_package(WrapZSTD) before +find_package(llvm) and disabling the finding of zstd within llvm. + +Fixes: QTBUG-139199 +Change-Id: I4e31eb0a3bef196a235becd2fd9d9d80e6bf548c +Reviewed-by: Alexey Edelev +Reviewed-by: Paul Wicking +(cherry picked from commit b676278a24eb880eeeed35bbf203a76950a9ab4e) +Reviewed-by: Qt Cherry-pick Bot +--- + cmake/FindWrapLibClang.cmake | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/cmake/FindWrapLibClang.cmake b/cmake/FindWrapLibClang.cmake +index 20faa99..92fbe36 100644 +--- a/cmake/FindWrapLibClang.cmake ++++ b/cmake/FindWrapLibClang.cmake +@@ -14,7 +14,24 @@ elseif(DEFINED CACHE{LLVM_INSTALL_DIR}) + list(PREPEND CMAKE_PREFIX_PATH "${LLVM_INSTALL_DIR}") + endif() + ++# Find the zstd package before llvm gets a chance to plant its Findzstd.cmake on us. That find ++# module is most likely inconsistent with your system-provided llvmConfig.cmake, leading to ++# configuration errors. Disable find_package(zstd) within llvm if FindWrapZSTD.cmake was successful. ++# Upstream issue: https://github.com/llvm/llvm-project/issues/139666 ++if(QT_FEATURE_zstd) ++ find_package(WrapZSTD QUIET) ++ set(__qt_wraplibclang_CMAKE_DISABLE_FIND_PACKAGE_zstd ${CMAKE_DISABLE_FIND_PACKAGE_zstd}) ++ if(WrapZSTD_FOUND) ++ set(CMAKE_DISABLE_FIND_PACKAGE_zstd TRUE) ++ endif() ++endif() ++ + find_package(Clang CONFIG) ++ ++if(QT_FEATURE_zstd) ++ set(CMAKE_DISABLE_FIND_PACKAGE_zstd ${__qt_wraplibclang_CMAKE_DISABLE_FIND_PACKAGE_zstd}) ++endif() ++ + # LLVM versions >= 16 come with Findzstd.cmake that creates a target for libzstd. + # Disable its global promotion to prevent interference with FindWrapZSTD.cmake. + if(TARGET zstd::libzstd) diff --git a/qt6-qttools.spec b/qt6-qttools.spec index b5b7122f5d08bd8f5844478819a148731fc9e579..8d9a8d4a86d2ec2ee4fe6a890bb77d459a05acc6 100644 --- a/qt6-qttools.spec +++ b/qt6-qttools.spec @@ -7,7 +7,7 @@ Summary: Qt6 - QtTool components Name: qt6-qttools Version: 6.8.3 -Release: 2 +Release: 3 License: LGPL-3.0-only OR GPL-3.0-only WITH Qt-GPL-exception-1.0 Url: https://www.qt.io @@ -23,6 +23,7 @@ Patch1: qttools-run-qttools-with-qt6-suffix.patch Patch2: qttools-add-libatomic.patch ## upstream patches +Patch6001: backport-qttools-Update-FindWrapLibClang.patch Source20: assistant.desktop Source21: designer.desktop @@ -148,6 +149,7 @@ Documentation for %{qt_module}. %ifarch %{mips32} %patch -P2 -p1 -b .libatomic %endif +%patch -P6001 -p1 -b .zstd %build %cmake_qt6 \ @@ -372,6 +374,9 @@ popd %endif %changelog +* Wed Nov 12 2025 Funda Wang - 6.8.3-3 +- Update FindWrapLibClang.cmake for new zstd + * Mon Jul 07 2025 Funda Wang - 6.8.3-2 - build documentation