mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-24 22:53:42 +00:00
e6cf9b9df0
Plugin and QML import paths were previously determined by NIX_PROFILES. Using PATH instead allows Qt applications to work under nix-shell without further modification.
21 lines
1010 B
Diff
21 lines
1010 B
Diff
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");
|