Skip to content

Commit

Permalink
qt: bring back QML import patch in 5.14 (#95772)
Browse files Browse the repository at this point in the history
This was missed in the 5.12 -> 5.14 update process.

Resolves #95636
  • Loading branch information
JJJollyjim committed Aug 19, 2020
1 parent e5a097a commit 4cb5383
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pkgs/development/libraries/qt-5/5.14/qtdeclarative.patch
@@ -1,3 +1,23 @@
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index 005db4248..685c5b1b2 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -1760,6 +1760,15 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e)
QString installImportsPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
addImportPath(installImportsPath);

+ // Add import paths derived from PATH
+ const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(':');
+ const QString qmldir = QStringLiteral("../" NIXPKGS_QML2_IMPORT_PREFIX);
+ for (const QString &path: paths) {
+ if (!path.isEmpty()) {
+ addImportPath(QDir::cleanPath(path + QDir::separator() + qmldir));
+ }
+ }
+
// env import paths
if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty("QML2_IMPORT_PATH"))) {
const QString envImportPath = qEnvironmentVariable("QML2_IMPORT_PATH");
diff --git a/tools/qmlcachegen/qmlcache.prf b/tools/qmlcachegen/qmlcache.prf
index 537eaf62e..e21de58f6 100644
--- a/tools/qmlcachegen/qmlcache.prf
Expand Down

0 comments on commit 4cb5383

Please sign in to comment.