diff options
| author | Nick Cao <nickcao@nichi.co> | 2023-11-27 10:37:13 -0500 |
|---|---|---|
| committer | github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 2023-11-28 13:26:31 +0000 |
| commit | 17ce419a51c6024cfa502e2395da7f6a1be1bedc (patch) | |
| tree | 777ab891c99abfe6f6c6bf5349785cf7e03191f0 | |
| parent | qt6: 6.6.0 -> 6.6.1 (diff) | |
| download | nixpkgs-17ce419a51c6024cfa502e2395da7f6a1be1bedc.tar.gz | |
qt6.qtbase: refresh patches
(cherry picked from commit 53ad6fd1b4377b8cc591fd74a5a4b90ead42d6e3)
13 files changed, 64 insertions, 91 deletions
diff --git a/pkgs/development/libraries/qt-6/default.nix b/pkgs/development/libraries/qt-6/default.nix index bef3f7ef62e8..61642b482af3 100644 --- a/pkgs/development/libraries/qt-6/default.nix +++ b/pkgs/development/libraries/qt-6/default.nix @@ -47,14 +47,14 @@ 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-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-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 + ./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 ]; }; env = callPackage ./qt-env.nix { }; diff --git a/pkgs/development/libraries/qt-6/patches/0001-qtbase-qmake-always-use-libname-instead-of-absolute-.patch b/pkgs/development/libraries/qt-6/patches/0001-qtbase-qmake-always-use-libname-instead-of-absolute-.patch index a0ee1e11b068..de35178f7929 100644 --- a/pkgs/development/libraries/qt-6/patches/0001-qtbase-qmake-always-use-libname-instead-of-absolute-.patch +++ b/pkgs/development/libraries/qt-6/patches/0001-qtbase-qmake-always-use-libname-instead-of-absolute-.patch @@ -1,4 +1,4 @@ -From afbe4002948e60ee3b27cb9be9e549ae416373f8 Mon Sep 17 00:00:00 2001 +From 90734859d2f9e6b9a1754c3e694ceb1a3c870bce 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 diff --git a/pkgs/development/libraries/qt-6/patches/0002-qtbase-qmake-fix-mkspecs-for-darwin.patch b/pkgs/development/libraries/qt-6/patches/0002-qtbase-qmake-fix-mkspecs-for-darwin.patch index 8ffe0c936b72..d7b41691370e 100644 --- a/pkgs/development/libraries/qt-6/patches/0002-qtbase-qmake-fix-mkspecs-for-darwin.patch +++ b/pkgs/development/libraries/qt-6/patches/0002-qtbase-qmake-fix-mkspecs-for-darwin.patch @@ -1,4 +1,4 @@ -From 8d3f5ee63ed29fe41927b904aa1e2b40f90c8ef4 Mon Sep 17 00:00:00 2001 +From a804a9b1efdab0a71b9947e5c2bf9f6f5e316e0e 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 diff --git a/pkgs/development/libraries/qt-6/patches/0003-qtbase-qmake-fix-includedir-in-generated-pkg-config.patch b/pkgs/development/libraries/qt-6/patches/0003-qtbase-qmake-fix-includedir-in-generated-pkg-config.patch index 041960352b1f..53f226254a19 100644 --- a/pkgs/development/libraries/qt-6/patches/0003-qtbase-qmake-fix-includedir-in-generated-pkg-config.patch +++ b/pkgs/development/libraries/qt-6/patches/0003-qtbase-qmake-fix-includedir-in-generated-pkg-config.patch @@ -1,4 +1,4 @@ -From 8ce66fca339d9daf6bd132771c2ea582a461f31c Mon Sep 17 00:00:00 2001 +From 6088085d3074316dd74639fc6c1233e5862aff11 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 diff --git a/pkgs/development/libraries/qt-6/patches/0005-qtbase-deal-with-a-font-face-at-index-0-as-Regular-f.patch b/pkgs/development/libraries/qt-6/patches/0004-qtbase-deal-with-a-font-face-at-index-0-as-Regular-f.patch index 8e04bda13645..ccd0fb02fcd8 100644 --- a/pkgs/development/libraries/qt-6/patches/0005-qtbase-deal-with-a-font-face-at-index-0-as-Regular-f.patch +++ b/pkgs/development/libraries/qt-6/patches/0004-qtbase-deal-with-a-font-face-at-index-0-as-Regular-f.patch @@ -1,7 +1,7 @@ -From 880fe5653a86d8091f3f577977f8af93552c48fd Mon Sep 17 00:00:00 2001 +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 05/11] qtbase: deal with a font face at index 0 as Regular for +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 diff --git a/pkgs/development/libraries/qt-6/patches/0004-qtbase-fix-locating-tzdir-on-NixOS.patch b/pkgs/development/libraries/qt-6/patches/0004-qtbase-fix-locating-tzdir-on-NixOS.patch deleted file mode 100644 index 5ccc9346d6d9..000000000000 --- a/pkgs/development/libraries/qt-6/patches/0004-qtbase-fix-locating-tzdir-on-NixOS.patch +++ /dev/null @@ -1,60 +0,0 @@ -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 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 e702a5d6b43..2ac88c1cd10 100644 ---- a/src/corelib/time/qtimezoneprivate_tz.cpp -+++ b/src/corelib/time/qtimezoneprivate_tz.cpp -@@ -56,7 +56,11 @@ static bool isTzFile(const QString &name); - // zone1970.tab). - static QTzTimeZoneHash loadTzTimeZones() - { -- QString path = QStringLiteral("/usr/share/zoneinfo/zone.tab"); -+ // Try TZDIR first, in case we're running on NixOS. -+ QString path = QFile::decodeName(qgetenv("TZDIR")) + QStringLiteral("/zone.tab"); -+ // Fallback to traditional paths in case we are not on NixOS. -+ if (!QFile::exists(path)) -+ path = QStringLiteral("/usr/share/zoneinfo/zone.tab"); - if (!QFile::exists(path)) - path = QStringLiteral("/usr/lib/zoneinfo/zone.tab"); - -@@ -773,18 +777,21 @@ QTzTimeZoneCacheEntry QTzTimeZoneCache::findEntry(const QByteArray &ianaId) - if (!tzif.open(QIODevice::ReadOnly)) - return ret; - } else { -- // Open named tz, try modern path first, if fails try legacy path -- tzif.setFileName("/usr/share/zoneinfo/"_L1 + QString::fromLocal8Bit(ianaId)); -+ // Try TZDIR first, in case we're running on NixOS -+ tzif.setFileName(QFile::decodeName(qgetenv("TZDIR")) + QStringLiteral("/") + QString::fromLocal8Bit(ianaId)); - if (!tzif.open(QIODevice::ReadOnly)) { -- tzif.setFileName("/usr/lib/zoneinfo/"_L1 + QString::fromLocal8Bit(ianaId)); -+ tzif.setFileName(QLatin1String("/usr/share/zoneinfo/") + QString::fromLocal8Bit(ianaId)); - if (!tzif.open(QIODevice::ReadOnly)) { -- // ianaId may be a POSIX rule, taken from $TZ or /etc/TZ -- auto check = validatePosixRule(ianaId); -- if (check.isValid) { -- ret.m_hasDst = check.hasDst; -- ret.m_posixRule = ianaId; -+ tzif.setFileName("/usr/lib/zoneinfo/"_L1 + QString::fromLocal8Bit(ianaId)); -+ if (!tzif.open(QIODevice::ReadOnly)) { -+ // ianaId may be a POSIX rule, taken from $TZ or /etc/TZ -+ auto check = validatePosixRule(ianaId); -+ if (check.isValid) { -+ ret.m_hasDst = check.hasDst; -+ ret.m_posixRule = ianaId; -+ } -+ return ret; - } -- return ret; - } - } - } --- -2.42.0 - diff --git a/pkgs/development/libraries/qt-6/patches/0006-qtbase-qt-cmake-always-use-cmake-from-path.patch b/pkgs/development/libraries/qt-6/patches/0005-qtbase-qt-cmake-always-use-cmake-from-path.patch index bab52a38c00c..ad30ebc71413 100644 --- a/pkgs/development/libraries/qt-6/patches/0006-qtbase-qt-cmake-always-use-cmake-from-path.patch +++ b/pkgs/development/libraries/qt-6/patches/0005-qtbase-qt-cmake-always-use-cmake-from-path.patch @@ -1,7 +1,7 @@ -From 7f573f00fb850a08017d9f1e3c73b4d7efeb84f2 Mon Sep 17 00:00:00 2001 +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 06/11] qtbase: qt-cmake: always use cmake from path +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. diff --git a/pkgs/development/libraries/qt-6/patches/0007-qtbase-find-tools-in-PATH.patch b/pkgs/development/libraries/qt-6/patches/0006-qtbase-find-tools-in-PATH.patch index fc2f55c9b4ae..1d60684e0700 100644 --- a/pkgs/development/libraries/qt-6/patches/0007-qtbase-find-tools-in-PATH.patch +++ b/pkgs/development/libraries/qt-6/patches/0006-qtbase-find-tools-in-PATH.patch @@ -1,7 +1,7 @@ -From 95b6bc2a414d381fdeab0899a3b02499c43695e7 Mon Sep 17 00:00:00 2001 +From a8b9fae710a2bd5e743f5e16364eaa8c38dbd784 Mon Sep 17 00:00:00 2001 From: rewine <luhongxu@deepin.org> Date: Wed, 29 Mar 2023 11:51:33 +0800 -Subject: [PATCH 07/11] qtbase-find-tools-in-PATH +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 diff --git a/pkgs/development/libraries/qt-6/patches/0008-qtbase-pass-to-qmlimportscanner-the-QML2_IMPORT_PATH.patch b/pkgs/development/libraries/qt-6/patches/0007-qtbase-pass-to-qmlimportscanner-the-QML2_IMPORT_PATH.patch index d1139e0aecd1..7bf2193bc208 100644 --- a/pkgs/development/libraries/qt-6/patches/0008-qtbase-pass-to-qmlimportscanner-the-QML2_IMPORT_PATH.patch +++ b/pkgs/development/libraries/qt-6/patches/0007-qtbase-pass-to-qmlimportscanner-the-QML2_IMPORT_PATH.patch @@ -1,17 +1,17 @@ -From a5cbfb30fc53b3290578af4a87fe4c0463df4247 Mon Sep 17 00:00:00 2001 +From d7a9a3b0ecdbb1b5829f25954d763d767f1c8794 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 +Subject: [PATCH 07/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 f637416cf22..77749506ccb 100644 +index 2ae4f998944..ba10ae02bcd 100644 --- a/src/tools/macdeployqt/shared/shared.cpp +++ b/src/tools/macdeployqt/shared/shared.cpp -@@ -1293,6 +1293,13 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf +@@ -1297,6 +1297,13 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf argumentList.append( "-importPath"); argumentList.append(qmlImportsPath); diff --git a/pkgs/development/libraries/qt-6/patches/0009-qtbase-allow-translations-outside-prefix.patch b/pkgs/development/libraries/qt-6/patches/0008-qtbase-allow-translations-outside-prefix.patch index ee2e35f813fa..40812599bb99 100644 --- a/pkgs/development/libraries/qt-6/patches/0009-qtbase-allow-translations-outside-prefix.patch +++ b/pkgs/development/libraries/qt-6/patches/0008-qtbase-allow-translations-outside-prefix.patch @@ -1,7 +1,7 @@ -From 28220453d157c0825669145c94ab86e9603265fa Mon Sep 17 00:00:00 2001 +From 79da6bb6ff075e8cf972be8a462630f1ec86bf0a 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 +Subject: [PATCH 08/11] qtbase: allow translations outside prefix --- cmake/QtBuild.cmake | 2 +- diff --git a/pkgs/development/libraries/qt-6/patches/0010-qtbase-find-qmlimportscanner-in-macdeployqt-via-envi.patch b/pkgs/development/libraries/qt-6/patches/0009-qtbase-find-qmlimportscanner-in-macdeployqt-via-envi.patch index fbb74a055d4a..fb17a539f053 100644 --- a/pkgs/development/libraries/qt-6/patches/0010-qtbase-find-qmlimportscanner-in-macdeployqt-via-envi.patch +++ b/pkgs/development/libraries/qt-6/patches/0009-qtbase-find-qmlimportscanner-in-macdeployqt-via-envi.patch @@ -1,7 +1,7 @@ -From bbd9cf61b686f68d5e5eb78fb0b96a74a8921cef Mon Sep 17 00:00:00 2001 +From d503be89320f0b89b80acb19769971e855be6ae1 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 10/11] qtbase: find qmlimportscanner in macdeployqt via +Subject: [PATCH 09/11] qtbase: find qmlimportscanner in macdeployqt via environment The qmlimportscanner tool is provided by qtdeclarative. Because of the @@ -17,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 77749506ccb..48979195f40 100644 +index ba10ae02bcd..320095a972d 100644 --- a/src/tools/macdeployqt/shared/shared.cpp +++ b/src/tools/macdeployqt/shared/shared.cpp -@@ -1273,6 +1273,10 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf +@@ -1277,6 +1277,10 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf if (!QFile::exists(qmlImportScannerPath)) qmlImportScannerPath = QCoreApplication::applicationDirPath() + "/qmlimportscanner"; diff --git a/pkgs/development/libraries/qt-6/patches/0011-qtbase-check-in-the-QML-folder-of-this-library-does-.patch b/pkgs/development/libraries/qt-6/patches/0010-qtbase-check-in-the-QML-folder-of-this-library-does-.patch index ab3354d62b8c..ed749cb238a5 100644 --- a/pkgs/development/libraries/qt-6/patches/0011-qtbase-check-in-the-QML-folder-of-this-library-does-.patch +++ b/pkgs/development/libraries/qt-6/patches/0010-qtbase-check-in-the-QML-folder-of-this-library-does-.patch @@ -1,7 +1,7 @@ -From 617d27ee91aaa59c59c4f3a2cca7bab8167d9f5f Mon Sep 17 00:00:00 2001 +From c00e310092d9aeb48adf21dd22f1ee4dbdbf5ebb 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 +Subject: [PATCH 10/11] qtbase: check in the QML folder of this library does actually exist In a modularized installation, this folder will be the location where @@ -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 48979195f40..8415680ecda 100644 +index 320095a972d..87ba0d4e24b 100644 --- a/src/tools/macdeployqt/shared/shared.cpp +++ b/src/tools/macdeployqt/shared/shared.cpp -@@ -1293,9 +1293,12 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf +@@ -1297,9 +1297,12 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf } for (const QString &importPath : qmlImportPaths) argumentList << "-importPath" << importPath; diff --git a/pkgs/development/libraries/qt-6/patches/0011-qtbase-derive-plugin-load-path-from-PATH.patch b/pkgs/development/libraries/qt-6/patches/0011-qtbase-derive-plugin-load-path-from-PATH.patch new file mode 100644 index 000000000000..22530f453536 --- /dev/null +++ b/pkgs/development/libraries/qt-6/patches/0011-qtbase-derive-plugin-load-path-from-PATH.patch @@ -0,0 +1,33 @@ +From f0c4d3860b75cb064d066045907622d536044096 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 + +--- + src/corelib/kernel/qcoreapplication.cpp | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp +index a80efbb5622..8cf9e85da43 100644 +--- a/src/corelib/kernel/qcoreapplication.cpp ++++ b/src/corelib/kernel/qcoreapplication.cpp +@@ -2991,6 +2991,16 @@ QStringList QCoreApplication::libraryPathsLocked() + QStringList *app_libpaths = new QStringList; + coreappdata()->app_libpaths.reset(app_libpaths); + ++ // Add library paths derived from PATH ++ const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(QStringLiteral(":")); ++ const QString plugindir = QStringLiteral("../" NIXPKGS_QT_PLUGIN_PREFIX); ++ for (const QString &path: paths) { ++ if (!path.isEmpty()) { ++ app_libpaths->append(QDir::cleanPath(path + QDir::separator() + plugindir)); ++ } ++ } ++ ++ + auto setPathsFromEnv = [&](QString libPathEnv) { + if (!libPathEnv.isEmpty()) { + QStringList paths = libPathEnv.split(QDir::listSeparator(), Qt::SkipEmptyParts); +-- +2.42.0 + |
