qt6.qtbase: refresh patches

This commit is contained in:
Nick Cao 2024-03-07 21:20:28 -05:00
parent 2c35581d1d
commit abf354c5e5
No known key found for this signature in database
13 changed files with 96 additions and 129 deletions

View File

@ -51,14 +51,13 @@ let
./patches/0001-qtbase-qmake-always-use-libname-instead-of-absolute-.patch
./patches/0002-qtbase-qmake-fix-mkspecs-for-darwin.patch
./patches/0003-qtbase-qmake-fix-includedir-in-generated-pkg-config.patch
./patches/0004-qtbase-deal-with-a-font-face-at-index-0-as-Regular-f.patch
./patches/0005-qtbase-qt-cmake-always-use-cmake-from-path.patch
./patches/0006-qtbase-find-tools-in-PATH.patch
./patches/0007-qtbase-pass-to-qmlimportscanner-the-QML2_IMPORT_PATH.patch
./patches/0008-qtbase-allow-translations-outside-prefix.patch
./patches/0009-qtbase-find-qmlimportscanner-in-macdeployqt-via-envi.patch
./patches/0010-qtbase-check-in-the-QML-folder-of-this-library-does-.patch
./patches/0011-qtbase-derive-plugin-load-path-from-PATH.patch
./patches/0004-qtbase-qt-cmake-always-use-cmake-from-path.patch
./patches/0005-qtbase-find-tools-in-PATH.patch
./patches/0006-qtbase-pass-to-qmlimportscanner-the-QML2_IMPORT_PATH.patch
./patches/0007-qtbase-allow-translations-outside-prefix.patch
./patches/0008-qtbase-find-qmlimportscanner-in-macdeployqt-via-envi.patch
./patches/0009-qtbase-check-in-the-QML-folder-of-this-library-does-.patch
./patches/0010-qtbase-derive-plugin-load-path-from-PATH.patch
# Revert "macOS: Silence warning about supporting secure state restoration"
# fix build with macOS sdk < 12.0
(fetchpatch2 {

View File

@ -1,8 +1,8 @@
From 90734859d2f9e6b9a1754c3e694ceb1a3c870bce Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nick Cao <nickcao@nichi.co>
Date: Thu, 13 Apr 2023 23:42:29 +0800
Subject: [PATCH 01/11] qtbase: qmake: always use libname instead of absolute
path in qmake files
Subject: [PATCH] qtbase: qmake: always use libname instead of absolute path in
qmake files
In generated qmake files, absolute paths to qt libraries are embedded
and then used in linker flags. However as the libraries can be provided
@ -45,6 +45,3 @@ index 3ffe354fd8d..441332d4582 100644
list(APPEND out_list "${lib_name_with_link_flag}")
else()
list(APPEND out_list "${library_path}")
--
2.42.0

View File

@ -1,19 +1,19 @@
From a804a9b1efdab0a71b9947e5c2bf9f6f5e316e0e Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nick Cao <nickcao@nichi.co>
Date: Fri, 14 Apr 2023 21:43:04 +0800
Subject: [PATCH 02/11] qtbase: qmake: fix mkspecs for darwin
Subject: [PATCH] qtbase: qmake: fix mkspecs for darwin
---
mkspecs/common/mac.conf | 2 +-
mkspecs/features/mac/default_post.prf | 263 --------------------------
mkspecs/features/mac/default_post.prf | 264 --------------------------
mkspecs/features/mac/default_pre.prf | 58 ------
mkspecs/features/mac/sdk.mk | 27 ---
mkspecs/features/mac/sdk.prf | 61 ------
mkspecs/features/mac/toolchain.prf | 5 -
6 files changed, 1 insertion(+), 415 deletions(-)
6 files changed, 1 insertion(+), 416 deletions(-)
diff --git a/mkspecs/common/mac.conf b/mkspecs/common/mac.conf
index 61bea952b2..9909dae726 100644
index 61bea952b22..9909dae7260 100644
--- a/mkspecs/common/mac.conf
+++ b/mkspecs/common/mac.conf
@@ -23,7 +23,7 @@ QMAKE_INCDIR_OPENGL = \
@ -26,7 +26,7 @@ index 61bea952b2..9909dae726 100644
QMAKE_LFLAGS_REL_RPATH =
diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
index 0b64a586b9..3b40328304 100644
index 0b64a586b93..3b40328304d 100644
--- a/mkspecs/features/mac/default_post.prf
+++ b/mkspecs/features/mac/default_post.prf
@@ -1,9 +1,5 @@
@ -311,7 +311,7 @@ index 0b64a586b9..3b40328304 100644
generate_xcode_project.commands = @$(QMAKE) -spec macx-xcode \"$(EXPORT__PRO_FILE_)\" $$QMAKE_ARGS
generate_xcode_project.target = xcodeproj
diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf
index e3534561a5..3b01424e67 100644
index e3534561a56..3b01424e67b 100644
--- a/mkspecs/features/mac/default_pre.prf
+++ b/mkspecs/features/mac/default_pre.prf
@@ -1,60 +1,2 @@
@ -376,7 +376,7 @@ index e3534561a5..3b01424e67 100644
-xcode_copy_phase_strip_setting.value = NO
-QMAKE_MAC_XCODE_SETTINGS += xcode_copy_phase_strip_setting
diff --git a/mkspecs/features/mac/sdk.mk b/mkspecs/features/mac/sdk.mk
index a32ceacb6c..e69de29bb2 100644
index a32ceacb6ce..e69de29bb2d 100644
--- a/mkspecs/features/mac/sdk.mk
+++ b/mkspecs/features/mac/sdk.mk
@@ -1,27 +0,0 @@
@ -408,7 +408,7 @@ index a32ceacb6c..e69de29bb2 100644
- endif
-endif
diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf
index 3a9c2778bb..e69de29bb2 100644
index 3a9c2778bbe..e69de29bb2d 100644
--- a/mkspecs/features/mac/sdk.prf
+++ b/mkspecs/features/mac/sdk.prf
@@ -1,61 +0,0 @@
@ -474,7 +474,7 @@ index 3a9c2778bb..e69de29bb2 100644
- cache($$tool_variable, set stash, $$tool)
-}
diff --git a/mkspecs/features/mac/toolchain.prf b/mkspecs/features/mac/toolchain.prf
index df191eb13c..e69de29bb2 100644
index df191eb13c4..e69de29bb2d 100644
--- a/mkspecs/features/mac/toolchain.prf
+++ b/mkspecs/features/mac/toolchain.prf
@@ -1,5 +0,0 @@

View File

@ -1,14 +1,14 @@
From 6088085d3074316dd74639fc6c1233e5862aff11 Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nick Cao <nickcao@nichi.co>
Date: Fri, 14 Apr 2023 09:34:46 +0800
Subject: [PATCH 03/11] qtbase: qmake: fix includedir in generated pkg-config
Subject: [PATCH] qtbase: qmake: fix includedir in generated pkg-config
---
qmake/generators/makefile.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 11d2f0ff7df..c78ed0d3485 100644
index 482ef2e2697..49217e62cda 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -3412,8 +3412,7 @@ MakefileGenerator::writePkgConfigFile()
@ -21,6 +21,3 @@ index 11d2f0ff7df..c78ed0d3485 100644
if (target_mode == TARG_MAC_MODE && project->isActiveConfig("lib_bundle")
&& libDir != QLatin1String("/Library/Frameworks")) {
t << " -F${libdir}";
--
2.42.0

View File

@ -1,26 +0,0 @@
From 82e243f326aea40e7f3da935d8166979b11e8063 Mon Sep 17 00:00:00 2001
From: Nick Cao <nickcao@nichi.co>
Date: Tue, 21 Mar 2023 15:48:49 +0800
Subject: [PATCH 04/11] qtbase: deal with a font face at index 0 as Regular for
Variable fonts
Reference: https://bugreports.qt.io/browse/QTBUG-111994
---
src/gui/text/unix/qfontconfigdatabase.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/gui/text/unix/qfontconfigdatabase.cpp b/src/gui/text/unix/qfontconfigdatabase.cpp
index 474644b871f..c7a117fd134 100644
--- a/src/gui/text/unix/qfontconfigdatabase.cpp
+++ b/src/gui/text/unix/qfontconfigdatabase.cpp
@@ -556,6 +556,7 @@ void QFontconfigDatabase::populateFontDatabase()
FcObjectSetAdd(os, *p);
++p;
}
+ FcPatternAddBool(pattern, FC_VARIABLE, FcFalse);
fonts = FcFontList(nullptr, pattern, os);
FcObjectSetDestroy(os);
FcPatternDestroy(pattern);
--
2.42.0

View File

@ -0,0 +1,48 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nick Cao <nickcao@nichi.co>
Date: Wed, 12 Apr 2023 10:13:50 +0800
Subject: [PATCH] qtbase: qt-cmake: always use cmake from path
The generated qt-cmake scripts embeds the absolute path of cmake used
during the build of qtbase, bloating the runtime closure of qtbase.
---
bin/qt-cmake-create.in | 7 +------
bin/qt-cmake.in | 7 +------
2 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/bin/qt-cmake-create.in b/bin/qt-cmake-create.in
index 7865d0fe91b..884dc4aba93 100755
--- a/bin/qt-cmake-create.in
+++ b/bin/qt-cmake-create.in
@@ -7,12 +7,7 @@ HELP_MESSAGE="Usage
script_dir_path=`dirname $0`
script_dir_path=`(cd "$script_dir_path"; /bin/pwd)`
-# Try to use original cmake, otherwise to make it relocatable, use any cmake found in PATH.
-original_cmake_path="@CMAKE_COMMAND@"
-cmake_path=$original_cmake_path
-if ! test -f "$cmake_path"; then
- cmake_path="cmake"
-fi
+cmake_path="cmake"
if [ "$#" -gt 1 ]; then
echo "Invalid number of arguments"
diff --git a/bin/qt-cmake.in b/bin/qt-cmake.in
index f719257f602..571ffe788fa 100755
--- a/bin/qt-cmake.in
+++ b/bin/qt-cmake.in
@@ -4,12 +4,7 @@
script_dir_path=`dirname $0`
script_dir_path=`(cd "$script_dir_path"; /bin/pwd)`
-# Try to use original cmake, otherwise to make it relocatable, use any cmake found in PATH.
-original_cmake_path="@CMAKE_COMMAND@"
-cmake_path=$original_cmake_path
-if ! test -f "$cmake_path"; then
- cmake_path="cmake"
-fi
+cmake_path="cmake"
toolchain_path="$script_dir_path/@__GlobalConfig_relative_path_from_bin_dir_to_cmake_config_dir@/qt.toolchain.cmake"

View File

@ -1,7 +1,7 @@
From a8b9fae710a2bd5e743f5e16364eaa8c38dbd784 Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: rewine <luhongxu@deepin.org>
Date: Wed, 29 Mar 2023 11:51:33 +0800
Subject: [PATCH 06/11] qtbase-find-tools-in-PATH
Subject: [PATCH] qtbase: find tools in PATH
1. find qt's tools in `QTTOOLSPATH` env
qt assumes that all components use the same install prefix
@ -19,10 +19,10 @@ Subject: [PATCH 06/11] qtbase-find-tools-in-PATH
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/cmake/QtDocsHelpers.cmake b/cmake/QtDocsHelpers.cmake
index 48ed5a324bf..91d8d41fb1f 100644
index 8b631e88ca5..922639a9985 100644
--- a/cmake/QtDocsHelpers.cmake
+++ b/cmake/QtDocsHelpers.cmake
@@ -47,9 +47,14 @@ function(qt_internal_add_docs)
@@ -72,9 +72,14 @@ function(qt_internal_add_docs)
set(doc_tools_libexec "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}/${INSTALL_LIBEXECDIR}")
endif()
@ -40,6 +40,3 @@ index 48ed5a324bf..91d8d41fb1f 100644
get_target_property(target_type ${target} TYPE)
if (NOT target_type STREQUAL "INTERFACE_LIBRARY")
--
2.42.0

View File

@ -1,32 +0,0 @@
From b480022b364b262d5ff63738c02318da925f5c79 Mon Sep 17 00:00:00 2001
From: Nick Cao <nickcao@nichi.co>
Date: Wed, 12 Apr 2023 10:13:50 +0800
Subject: [PATCH 05/11] qtbase: qt-cmake: always use cmake from path
The generated qt-cmake scripts embeds the absolute path of cmake used
during the build of qtbase, bloating the runtime closure of qtbase.
---
bin/qt-cmake.in | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/bin/qt-cmake.in b/bin/qt-cmake.in
index f719257f602..571ffe788fa 100755
--- a/bin/qt-cmake.in
+++ b/bin/qt-cmake.in
@@ -4,12 +4,7 @@
script_dir_path=`dirname $0`
script_dir_path=`(cd "$script_dir_path"; /bin/pwd)`
-# Try to use original cmake, otherwise to make it relocatable, use any cmake found in PATH.
-original_cmake_path="@CMAKE_COMMAND@"
-cmake_path=$original_cmake_path
-if ! test -f "$cmake_path"; then
- cmake_path="cmake"
-fi
+cmake_path="cmake"
toolchain_path="$script_dir_path/@__GlobalConfig_relative_path_from_bin_dir_to_cmake_config_dir@/qt.toolchain.cmake"
--
2.42.0

View File

@ -1,17 +1,17 @@
From d7a9a3b0ecdbb1b5829f25954d763d767f1c8794 Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nick Cao <nickcao@nichi.co>
Date: Tue, 10 Oct 2023 10:12:56 -0400
Subject: [PATCH 07/11] qtbase: pass to qmlimportscanner the QML2_IMPORT_PATH
Subject: [PATCH] qtbase: pass to qmlimportscanner the QML2_IMPORT_PATH
---
src/tools/macdeployqt/shared/shared.cpp | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/tools/macdeployqt/shared/shared.cpp b/src/tools/macdeployqt/shared/shared.cpp
index 2ae4f998944..ba10ae02bcd 100644
index b7ee93f6fc1..57b68627eba 100644
--- a/src/tools/macdeployqt/shared/shared.cpp
+++ b/src/tools/macdeployqt/shared/shared.cpp
@@ -1297,6 +1297,13 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
@@ -1300,6 +1300,13 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
argumentList.append( "-importPath");
argumentList.append(qmlImportsPath);
@ -25,6 +25,3 @@ index 2ae4f998944..ba10ae02bcd 100644
// run qmlimportscanner
QProcess qmlImportScanner;
qmlImportScanner.start(qmlImportScannerPath, argumentList);
--
2.42.0

View File

@ -1,14 +1,14 @@
From 79da6bb6ff075e8cf972be8a462630f1ec86bf0a Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nick Cao <nickcao@nichi.co>
Date: Tue, 10 Oct 2023 10:14:40 -0400
Subject: [PATCH 08/11] qtbase: allow translations outside prefix
Subject: [PATCH] qtbase: allow translations outside prefix
---
cmake/QtBuild.cmake | 2 +-
cmake/QtBuildPathsHelpers.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmake/QtBuildPathsHelpers.cmake b/cmake/QtBuildPathsHelpers.cmake
index edc43f2f14..78fa219515 100644
index 18082ac6a5f..e16aea7d7c6 100644
--- a/cmake/QtBuildPathsHelpers.cmake
+++ b/cmake/QtBuildPathsHelpers.cmake
@@ -134,7 +134,7 @@ function(qt_configure_process_path name default docstring)

View File

@ -1,8 +1,7 @@
From d503be89320f0b89b80acb19769971e855be6ae1 Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juan=20Pedro=20Bol=C3=ADvar=20Puente?= <raskolnikov@gnu.org>
Date: Wed, 9 Aug 2023 16:16:21 +0200
Subject: [PATCH 09/11] qtbase: find qmlimportscanner in macdeployqt via
environment
Subject: [PATCH] qtbase: find qmlimportscanner in macdeployqt via environment
The qmlimportscanner tool is provided by qtdeclarative. Because of the
modularized installation in Nix, it can not be found via the usual
@ -17,10 +16,10 @@ a workaround for users.
1 file changed, 4 insertions(+)
diff --git a/src/tools/macdeployqt/shared/shared.cpp b/src/tools/macdeployqt/shared/shared.cpp
index ba10ae02bcd..320095a972d 100644
index 57b68627eba..2b972a76c49 100644
--- a/src/tools/macdeployqt/shared/shared.cpp
+++ b/src/tools/macdeployqt/shared/shared.cpp
@@ -1277,6 +1277,10 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
@@ -1280,6 +1280,10 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
if (!QFile::exists(qmlImportScannerPath))
qmlImportScannerPath = QCoreApplication::applicationDirPath() + "/qmlimportscanner";
@ -31,6 +30,3 @@ index ba10ae02bcd..320095a972d 100644
// Verify that we found a qmlimportscanner binary
if (!QFile::exists(qmlImportScannerPath)) {
LogError() << "qmlimportscanner not found at" << qmlImportScannerPath;
--
2.42.0

View File

@ -1,8 +1,8 @@
From c00e310092d9aeb48adf21dd22f1ee4dbdbf5ebb Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nick Cao <nickcao@nichi.co>
Date: Tue, 10 Oct 2023 10:17:00 -0400
Subject: [PATCH 10/11] qtbase: check in the QML folder of this library does
actually exist
Subject: [PATCH] qtbase: check in the QML folder of this library does actually
exist
In a modularized installation, this folder will be the location where
`qtbase` itself is installed, but `qtbase` does not have any QML
@ -12,10 +12,10 @@ code, and `qmlimportscanner` will complain that it does not exist.
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/tools/macdeployqt/shared/shared.cpp b/src/tools/macdeployqt/shared/shared.cpp
index 320095a972d..87ba0d4e24b 100644
index 2b972a76c49..96c61b3824a 100644
--- a/src/tools/macdeployqt/shared/shared.cpp
+++ b/src/tools/macdeployqt/shared/shared.cpp
@@ -1297,9 +1297,12 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
@@ -1300,9 +1300,12 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
}
for (const QString &importPath : qmlImportPaths)
argumentList << "-importPath" << importPath;
@ -30,6 +30,3 @@ index 320095a972d..87ba0d4e24b 100644
// In a modularized installation of qt as we have in Nix, instead, we will
// read the paths from the environment, as they are spread in multiple
--
2.42.0

View File

@ -1,17 +1,17 @@
From 6f0e6fe1e13ca5844a93d3b97111b7ece7e60f0f Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Milan=20P=C3=A4ssler?= <me@pbb.lc>
Date: Sun, 10 May 2020 12:47:28 +0200
Subject: [PATCH 11/11] qtbase: derive plugin load path from PATH
Subject: [PATCH] qtbase: derive plugin load path from PATH
---
src/corelib/kernel/qcoreapplication.cpp | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index a80efbb5622..0d41dabeed3 100644
index 1ce2642cf2d..48fd91a0d7f 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -3032,6 +3032,15 @@ QStringList QCoreApplication::libraryPathsLocked()
@@ -3038,6 +3038,15 @@ QStringList QCoreApplication::libraryPathsLocked()
app_libpaths->append(installPathPlugins);
}
@ -27,6 +27,3 @@ index a80efbb5622..0d41dabeed3 100644
// If QCoreApplication is not yet instantiated,
// make sure we add the application path when we construct the QCoreApplication
if (self) self->d_func()->appendApplicationPathToLibraryPaths();
--
2.43.1