qt6.qtbase: refresh patches for qt 6.6.0

This commit is contained in:
Nick Cao 2023-10-10 10:09:14 -04:00
parent 6b0b44ae8e
commit 5f3c3c43a8
No known key found for this signature in database
12 changed files with 73 additions and 64 deletions

View file

@ -49,11 +49,11 @@ let
./patches/0004-qtbase-fix-locating-tzdir-on-NixOS.patch
./patches/0005-qtbase-deal-with-a-font-face-at-index-0-as-Regular-f.patch
./patches/0006-qtbase-qt-cmake-always-use-cmake-from-path.patch
./patches/0007-qtbase-find-qt-tools-in-QTTOOLSPATH.patch
./patches/0008-qtbase-allow-translations-outside-prefix.patch
./patches/0008-qtbase-find-qmlimportscanner-in-macdeployqt-via-environment.patch
./patches/0009-qtbase-check-in-the-QML-folder-of-this-library-does-actuall.patch
./patches/0010-qtbase-pass-to-qmlimportscanner-the-QML2_IMPORT_PATH.patch
./patches/0007-qtbase-find-tools-in-PATH.patch
./patches/0008-qtbase-pass-to-qmlimportscanner-the-QML2_IMPORT_PATH.patch
./patches/0009-qtbase-allow-translations-outside-prefix.patch
./patches/0010-qtbase-find-qmlimportscanner-in-macdeployqt-via-envi.patch
./patches/0011-qtbase-check-in-the-QML-folder-of-this-library-does-.patch
];
};
env = callPackage ./qt-env.nix { };

View file

@ -1,7 +1,7 @@
From 69d9faa9e4420d3cb0d1466c1b95ceadb2cd75f3 Mon Sep 17 00:00:00 2001
From afbe4002948e60ee3b27cb9be9e549ae416373f8 Mon Sep 17 00:00:00 2001
From: Nick Cao <nickcao@nichi.co>
Date: Thu, 13 Apr 2023 23:42:29 +0800
Subject: [PATCH 1/6] qtbase: qmake: always use libname instead of absolute
Subject: [PATCH 01/11] qtbase: qmake: always use libname instead of absolute
path in qmake files
In generated qmake files, absolute paths to qt libraries are embedded
@ -46,5 +46,5 @@ index 3ffe354fd8d..441332d4582 100644
else()
list(APPEND out_list "${library_path}")
--
2.39.2
2.42.0

View file

@ -1,7 +1,7 @@
From 41e32c41f781261726722628122c924abb532575 Mon Sep 17 00:00:00 2001
From 8d3f5ee63ed29fe41927b904aa1e2b40f90c8ef4 Mon Sep 17 00:00:00 2001
From: Nick Cao <nickcao@nichi.co>
Date: Fri, 14 Apr 2023 21:43:04 +0800
Subject: [PATCH 2/6] qtbase: qmake: fix mkspecs for darwin
Subject: [PATCH 02/11] qtbase: qmake: fix mkspecs for darwin
---
mkspecs/common/mac.conf | 2 +-
@ -26,7 +26,7 @@ index 61bea952b22..9909dae7260 100644
QMAKE_LFLAGS_REL_RPATH =
diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
index 4acf3b19d5c..aadfce875e2 100644
index f364716717c..3b40328304d 100644
--- a/mkspecs/features/mac/default_post.prf
+++ b/mkspecs/features/mac/default_post.prf
@@ -1,9 +1,5 @@
@ -39,7 +39,7 @@ index 4acf3b19d5c..aadfce875e2 100644
contains(TEMPLATE, .*app) {
!macx-xcode:if(isEmpty(BUILDS)|build_pass) {
# Detect changes to the platform SDK
@@ -15,37 +11,6 @@ contains(TEMPLATE, .*app) {
@@ -15,269 +11,10 @@ contains(TEMPLATE, .*app) {
QMAKE_EXTRA_INCLUDES += $$shell_quote($$PWD/sdk.mk)
}
@ -77,9 +77,6 @@ index 4acf3b19d5c..aadfce875e2 100644
}
!no_objective_c:CONFIG += objective_c
@@ -73,234 +38,6 @@ qt {
}
}
-# Add the same default rpaths as Xcode does for new projects.
-# This is especially important for iOS/tvOS/watchOS where no other option is possible.
@ -486,5 +483,5 @@ index df191eb13c4..e69de29bb2d 100644
-
-load(toolchain)
--
2.39.2
2.42.0

View file

@ -1,17 +1,17 @@
From f52f3c2cb1703592eaeb43e80f585a24ce8402d7 Mon Sep 17 00:00:00 2001
From 8ce66fca339d9daf6bd132771c2ea582a461f31c Mon Sep 17 00:00:00 2001
From: Nick Cao <nickcao@nichi.co>
Date: Fri, 14 Apr 2023 09:34:46 +0800
Subject: [PATCH 3/6] qtbase: qmake: fix includedir in generated pkg-config
Subject: [PATCH 03/11] 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 cc985a878b4..4e3b383d812 100644
index 11d2f0ff7df..c78ed0d3485 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -3403,8 +3403,7 @@ MakefileGenerator::writePkgConfigFile()
@@ -3412,8 +3412,7 @@ MakefileGenerator::writePkgConfigFile()
<< varGlue("QMAKE_PKGCONFIG_CFLAGS", "", " ", " ")
// << varGlue("DEFINES","-D"," -D"," ")
;
@ -22,5 +22,5 @@ index cc985a878b4..4e3b383d812 100644
&& libDir != QLatin1String("/Library/Frameworks")) {
t << " -F${libdir}";
--
2.39.2
2.42.0

View file

@ -1,18 +1,18 @@
From dd0dfc9cf87966f5d7493a943ec04c665be83cb6 Mon Sep 17 00:00:00 2001
From b1533ac42718835499ec633ffb3b1bed0d040719 Mon Sep 17 00:00:00 2001
From: Nick Cao <nickcao@nichi.co>
Date: Fri, 14 Apr 2023 09:35:25 +0800
Subject: [PATCH 4/6] qtbase: fix locating tzdir on NixOS
Subject: [PATCH 04/11] qtbase: fix locating tzdir on NixOS
---
src/corelib/time/qtimezoneprivate_tz.cpp | 27 +++++++++++++++---------
1 file changed, 17 insertions(+), 10 deletions(-)
diff --git a/src/corelib/time/qtimezoneprivate_tz.cpp b/src/corelib/time/qtimezoneprivate_tz.cpp
index 960a0944185..a5186acbd91 100644
index e702a5d6b43..2ac88c1cd10 100644
--- a/src/corelib/time/qtimezoneprivate_tz.cpp
+++ b/src/corelib/time/qtimezoneprivate_tz.cpp
@@ -51,7 +51,11 @@ typedef QHash<QByteArray, QTzTimeZone> QTzTimeZoneHash;
// Parse zone.tab table, assume lists all installed zones, if not will need to read directories
@@ -56,7 +56,11 @@ static bool isTzFile(const QString &name);
// zone1970.tab).
static QTzTimeZoneHash loadTzTimeZones()
{
- QString path = QStringLiteral("/usr/share/zoneinfo/zone.tab");
@ -24,7 +24,7 @@ index 960a0944185..a5186acbd91 100644
if (!QFile::exists(path))
path = QStringLiteral("/usr/lib/zoneinfo/zone.tab");
@@ -730,18 +734,21 @@ QTzTimeZoneCacheEntry QTzTimeZoneCache::findEntry(const QByteArray &ianaId)
@@ -773,18 +777,21 @@ QTzTimeZoneCacheEntry QTzTimeZoneCache::findEntry(const QByteArray &ianaId)
if (!tzif.open(QIODevice::ReadOnly))
return ret;
} else {
@ -56,5 +56,5 @@ index 960a0944185..a5186acbd91 100644
}
}
--
2.39.2
2.42.0

View file

@ -1,7 +1,7 @@
From 4e8c14f1af9c332826e0454f4fd63e541edbaf5c Mon Sep 17 00:00:00 2001
From 880fe5653a86d8091f3f577977f8af93552c48fd Mon Sep 17 00:00:00 2001
From: Nick Cao <nickcao@nichi.co>
Date: Tue, 21 Mar 2023 15:48:49 +0800
Subject: [PATCH 5/6] qtbase: deal with a font face at index 0 as Regular for
Subject: [PATCH 05/11] qtbase: deal with a font face at index 0 as Regular for
Variable fonts
Reference: https://bugreports.qt.io/browse/QTBUG-111994
@ -22,5 +22,5 @@ index 474644b871f..c7a117fd134 100644
FcObjectSetDestroy(os);
FcPatternDestroy(pattern);
--
2.39.2
2.42.0

View file

@ -1,7 +1,7 @@
From 61ae6e04388dd40e11c214d56f22f8f2007bf35f Mon Sep 17 00:00:00 2001
From 7f573f00fb850a08017d9f1e3c73b4d7efeb84f2 Mon Sep 17 00:00:00 2001
From: Nick Cao <nickcao@nichi.co>
Date: Wed, 12 Apr 2023 10:13:50 +0800
Subject: [PATCH 6/6] qtbase: qt-cmake: always use cmake from path
Subject: [PATCH 06/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.
@ -28,5 +28,5 @@ index f719257f602..571ffe788fa 100755
toolchain_path="$script_dir_path/@__GlobalConfig_relative_path_from_bin_dir_to_cmake_config_dir@/qt.toolchain.cmake"
--
2.39.2
2.42.0

View file

@ -1,7 +1,7 @@
From 31d808a7b0d52a01c3f2875202cd29410a94b39a Mon Sep 17 00:00:00 2001
From 95b6bc2a414d381fdeab0899a3b02499c43695e7 Mon Sep 17 00:00:00 2001
From: rewine <luhongxu@deepin.org>
Date: Wed, 29 Mar 2023 11:51:33 +0800
Subject: [PATCH] qtbase-find-tools-in-PATH
Subject: [PATCH 07/11] qtbase-find-tools-in-PATH
1. find qt's tools in `QTTOOLSPATH` env
qt assumes that all components use the same install prefix
@ -14,13 +14,12 @@ Subject: [PATCH] qtbase-find-tools-in-PATH
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 48ed5a32..9409d22d 100644
index 48ed5a324bf..91d8d41fb1f 100644
--- a/cmake/QtDocsHelpers.cmake
+++ b/cmake/QtDocsHelpers.cmake
@@ -47,9 +47,14 @@ function(qt_internal_add_docs)
@ -42,5 +41,5 @@ index 48ed5a32..9409d22d 100644
get_target_property(target_type ${target} TYPE)
if (NOT target_type STREQUAL "INTERFACE_LIBRARY")
--
2.38.1
2.42.0

View file

@ -1,19 +1,19 @@
From 39eb99dcd66f8ffb632fed6308a49896fe5ad2d3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juan=20Pedro=20Bol=C3=ADvar=20Puente?= <raskolnikov@gnu.org>
Date: Thu, 10 Aug 2023 14:17:03 +0200
Subject: [PATCH 3/3] Pass to qmlimportscanner the QML2_IMPORT_PATH
From a5cbfb30fc53b3290578af4a87fe4c0463df4247 Mon Sep 17 00:00:00 2001
From: Nick Cao <nickcao@nichi.co>
Date: Tue, 10 Oct 2023 10:12:56 -0400
Subject: [PATCH 08/11] 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 676d34d545..7908b07b3c 100644
index f637416cf22..77749506ccb 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
argumentList.append(qmlImportsPath);
}
@@ -1293,6 +1293,13 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
argumentList.append( "-importPath");
argumentList.append(qmlImportsPath);
+ // 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
@ -26,5 +26,5 @@ index 676d34d545..7908b07b3c 100644
QProcess qmlImportScanner;
qmlImportScanner.start(qmlImportScannerPath, argumentList);
--
2.26.2
2.42.0

View file

@ -1,5 +1,14 @@
From 28220453d157c0825669145c94ab86e9603265fa Mon Sep 17 00:00:00 2001
From: Nick Cao <nickcao@nichi.co>
Date: Tue, 10 Oct 2023 10:14:40 -0400
Subject: [PATCH 09/11] qtbase: allow translations outside prefix
---
cmake/QtBuild.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index b45ec1d208..05f69c131b 100644
index 1dc576d27af..4348eb97c37 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -30,7 +30,7 @@ function(qt_configure_process_path name default docstring)
@ -11,3 +20,6 @@ index b45ec1d208..05f69c131b 100644
message(FATAL_ERROR
"Path component '${name}' is outside computed install prefix: ${rel_path} ")
return()
--
2.42.0

View file

@ -1,7 +1,8 @@
From 505391a31aa353b8f1cc5d3feb9861582554d9f1 Mon Sep 17 00:00:00 2001
From bbd9cf61b686f68d5e5eb78fb0b96a74a8921cef 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 1/3] Find qmlimportscanner in macdeployqt via environment
Subject: [PATCH 10/11] 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
@ -16,10 +17,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 643fe5390a..b8fcc9c9bd 100644
index 77749506ccb..48979195f40 100644
--- a/src/tools/macdeployqt/shared/shared.cpp
+++ b/src/tools/macdeployqt/shared/shared.cpp
@@ -1270,6 +1270,10 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
@@ -1273,6 +1273,10 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
if (!QFile::exists(qmlImportScannerPath))
qmlImportScannerPath = QCoreApplication::applicationDirPath() + "/qmlimportscanner";
@ -31,5 +32,5 @@ index 643fe5390a..b8fcc9c9bd 100644
if (!QFile::exists(qmlImportScannerPath)) {
LogError() << "qmlimportscanner not found at" << qmlImportScannerPath;
--
2.26.2
2.42.0

View file

@ -1,8 +1,8 @@
From 32df59bea18bebc18d6d308750e88be325522d2e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juan=20Pedro=20Bol=C3=ADvar=20Puente?= <raskolnikov@gnu.org>
Date: Thu, 10 Aug 2023 14:15:34 +0200
Subject: [PATCH 2/3] Check in the QML folder of this library does actually
exist
From 617d27ee91aaa59c59c4f3a2cca7bab8167d9f5f Mon Sep 17 00:00:00 2001
From: Nick Cao <nickcao@nichi.co>
Date: Tue, 10 Oct 2023 10:17:00 -0400
Subject: [PATCH 11/11] 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 b8fcc9c9bd..676d34d545 100644
index 48979195f40..8415680ecda 100644
--- a/src/tools/macdeployqt/shared/shared.cpp
+++ b/src/tools/macdeployqt/shared/shared.cpp
@@ -1290,9 +1290,12 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
@@ -1293,9 +1293,12 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
}
for (const QString &importPath : qmlImportPaths)
argumentList << "-importPath" << importPath;
@ -28,8 +28,8 @@ index b8fcc9c9bd..676d34d545 100644
+ argumentList.append(qmlImportsPath);
+ }
// run qmlimportscanner
QProcess qmlImportScanner;
// 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.26.2
2.42.0