qt55.qtdeclarative: get import paths from NIX_PROFILES

This commit is contained in:
Thomas Tuegel 2016-04-15 06:57:06 -05:00
parent e6c91d586c
commit e0a87ce931

View file

@ -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()) {