Skip to content

Commit 4cb5383

Browse files
authored
qt: bring back QML import patch in 5.14 (NixOS#95772)
This was missed in the 5.12 -> 5.14 update process. Resolves NixOS#95636
1 parent e5a097a commit 4cb5383

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

pkgs/development/libraries/qt-5/5.14/qtdeclarative.patch

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
2+
index 005db4248..685c5b1b2 100644
3+
--- a/src/qml/qml/qqmlimport.cpp
4+
+++ b/src/qml/qml/qqmlimport.cpp
5+
@@ -1760,6 +1760,15 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e)
6+
QString installImportsPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
7+
addImportPath(installImportsPath);
8+
9+
+ // Add import paths derived from PATH
10+
+ const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(':');
11+
+ const QString qmldir = QStringLiteral("../" NIXPKGS_QML2_IMPORT_PREFIX);
12+
+ for (const QString &path: paths) {
13+
+ if (!path.isEmpty()) {
14+
+ addImportPath(QDir::cleanPath(path + QDir::separator() + qmldir));
15+
+ }
16+
+ }
17+
+
18+
// env import paths
19+
if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty("QML2_IMPORT_PATH"))) {
20+
const QString envImportPath = qEnvironmentVariable("QML2_IMPORT_PATH");
121
diff --git a/tools/qmlcachegen/qmlcache.prf b/tools/qmlcachegen/qmlcache.prf
222
index 537eaf62e..e21de58f6 100644
323
--- a/tools/qmlcachegen/qmlcache.prf

0 commit comments

Comments
 (0)