nixpkgs-suyu/pkgs/development/libraries/qt-5/5.9/qtdeclarative.patch
Thomas Tuegel fe0ab944db
qt5: factor out common definitions and remove symlink farm
The module definitions are factored out and shared between qt56 and qt59. The
symlink farm which was created during builds is no longer needed.
2017-11-07 07:18:46 -06:00

33 lines
1.4 KiB
Diff

diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index ee5b38717..bbccef8c4 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -1678,6 +1678,15 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e)
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");
diff --git a/tools/qmlcachegen/qmlcache.prf b/tools/qmlcachegen/qmlcache.prf
index 330da358b..cdf570205 100644
--- a/tools/qmlcachegen/qmlcache.prf
+++ b/tools/qmlcachegen/qmlcache.prf
@@ -44,7 +44,7 @@ defineReplace(qmlCacheOutputFileName) {
}
qmlcacheinst.base = $$QMLCACHE_DESTDIR
-qmlcacheinst.path = $$[QT_INSTALL_QML]/$$TARGETPATH
+qmlcacheinst.path = $$NIX_OUTPUT_QML/$$TARGETPATH
qmlcacheinst.CONFIG = no_check_exist
qmlcachegen.input = CACHEGEN_FILES