about summary refs log tree commit diff
path: root/pkgs/development/libraries/qt-5/5.7/qtdeclarative/nix-profiles-import-paths.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/qt-5/5.7/qtdeclarative/nix-profiles-import-paths.patch')
-rw-r--r--pkgs/development/libraries/qt-5/5.7/qtdeclarative/nix-profiles-import-paths.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/pkgs/development/libraries/qt-5/5.7/qtdeclarative/nix-profiles-import-paths.patch b/pkgs/development/libraries/qt-5/5.7/qtdeclarative/nix-profiles-import-paths.patch
new file mode 100644
index 000000000000..06b244b974ff
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.7/qtdeclarative/nix-profiles-import-paths.patch
@@ -0,0 +1,20 @@
+Index: qtdeclarative-opensource-src-5.5.1/src/qml/qml/qqmlimport.cpp
+===================================================================
+--- qtdeclarative-opensource-src-5.5.1.orig/src/qml/qml/qqmlimport.cpp
++++ qtdeclarative-opensource-src-5.5.1/src/qml/qml/qqmlimport.cpp
+@@ -1549,6 +1549,15 @@ QQmlImportDatabase::QQmlImportDatabase(Q
+     QString installImportsPath =  QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
+     addImportPath(installImportsPath);
+ 
++    // Add library paths derived from NIX_PROFILES.
++    const QByteArrayList profiles = qgetenv("NIX_PROFILES").split(' ');
++    const QString qmldir = QString::fromLatin1("/lib/qt5/qml");
++    Q_FOREACH (const QByteArray &profile, profiles) {
++        if (!profile.isEmpty()) {
++            addImportPath(QFile::decodeName(profile) + qmldir);
++        }
++    }
++
+     // env import paths
+     QByteArray envImportPath = qgetenv("QML2_IMPORT_PATH");
+     if (!envImportPath.isEmpty()) {