summary refs log tree commit diff
path: root/pkgs/development/libraries/qt-5/5.6/qtdeclarative/import-paths.patch
blob: a942d837c30522bc30368321c9caf2b87a1f7053 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Index: qtdeclarative-opensource-src-5.6.2/src/qml/qml/qqmlimport.cpp
===================================================================
--- qtdeclarative-opensource-src-5.6.2.orig/src/qml/qml/qqmlimport.cpp
+++ qtdeclarative-opensource-src-5.6.2/src/qml/qml/qqmlimport.cpp
@@ -1568,6 +1568,15 @@ QQmlImportDatabase::QQmlImportDatabase(Q
     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 QByteArray envImportPath = qgetenv("QML2_IMPORT_PATH");