nixpkgs/pkgs/development/libraries/qt-5/5.8/qtdeclarative/nix-profiles-import-paths.patch

21 lines
1020 B
Diff
Raw Normal View History

Index: qtdeclarative-opensource-src-5.8.0/src/qml/qml/qqmlimport.cpp
===================================================================
--- qtdeclarative-opensource-src-5.8.0.orig/src/qml/qml/qqmlimport.cpp
+++ qtdeclarative-opensource-src-5.8.0/src/qml/qml/qqmlimport.cpp
@@ -1630,6 +1630,15 @@ QQmlImportDatabase::QQmlImportDatabase(Q
QString installImportsPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
addImportPath(installImportsPath);
+ // Add library paths derived from NIX_PROFILES.
+ const QStringList profiles = QFile::decodeName(qgetenv("NIX_PROFILES")).split(' ');
+ const QString qmldir = QStringLiteral(NIXPKGS_QML2_IMPORT_PREFIX);
+ for (const QString &profile: profiles) {
+ if (!profile.isEmpty()) {
+ addImportPath(profile + QDir::separator() + qmldir);
+ }
+ }
+
// env import paths
if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty("QML2_IMPORT_PATH"))) {
const QByteArray envImportPath = qgetenv("QML2_IMPORT_PATH");