nixpkgs/pkgs/development/libraries/qt-5/5.11/qtdeclarative.patch

47 lines
1.9 KiB
Diff
Raw Normal View History

2018-01-01 20:50:26 +00:00
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index 005db4248..685c5b1b2 100644
2018-01-01 20:50:26 +00:00
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -1760,6 +1760,15 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e)
2018-01-01 20:50:26 +00:00
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 QString envImportPath = qEnvironmentVariable("QML2_IMPORT_PATH");
diff --git a/tools/qmlcachegen/Qt5QuickCompilerConfig.cmake b/tools/qmlcachegen/Qt5QuickCompilerConfig.cmake
index 56cb3fb55..74509d601 100644
--- a/tools/qmlcachegen/Qt5QuickCompilerConfig.cmake
+++ b/tools/qmlcachegen/Qt5QuickCompilerConfig.cmake
@@ -17,7 +17,7 @@ function(QTQUICK_COMPILER_ADD_RESOURCES outfiles)
find_package(Qt5 COMPONENTS Qml Core)
- set(compiler_path "${_qt5Core_install_prefix}/bin/qmlcachegen")
+ set(compiler_path "qmlcachegen")
get_target_property(rcc_path ${Qt5Core_RCC_EXECUTABLE} IMPORTED_LOCATION)
2018-01-01 20:50:26 +00:00
diff --git a/tools/qmlcachegen/qmlcache.prf b/tools/qmlcachegen/qmlcache.prf
index 537eaf62e..e21de58f6 100644
2018-01-01 20:50:26 +00:00
--- a/tools/qmlcachegen/qmlcache.prf
+++ b/tools/qmlcachegen/qmlcache.prf
@@ -26,7 +26,7 @@ defineReplace(qmlCacheOutputFileName) {
2018-01-01 20:50:26 +00:00
}
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