From e44cf032bc2c516e41a41cb58dbd6575bf85a221 Mon Sep 17 00:00:00 2001 From: K900 Date: Fri, 19 Jan 2024 12:52:59 +0300 Subject: [PATCH] qt5, qt6: fix QML path search order QQmlImportDatabase::addImportPath _prepends_ to the search path, so our version specific search paths need to be added in last. --- .../libraries/qt-5/5.15/qtdeclarative-qml-paths.patch | 4 ++-- .../qt-6/patches/qtdeclarative-qml-paths.patch | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/development/libraries/qt-5/5.15/qtdeclarative-qml-paths.patch b/pkgs/development/libraries/qt-5/5.15/qtdeclarative-qml-paths.patch index 2ea3554df7d2..e207fa4df3bd 100644 --- a/pkgs/development/libraries/qt-5/5.15/qtdeclarative-qml-paths.patch +++ b/pkgs/development/libraries/qt-5/5.15/qtdeclarative-qml-paths.patch @@ -1,5 +1,5 @@ diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp -index 289f11d006..80c422403c 100644 +index 289f11d006..9b0a48c6c7 100644 --- a/src/qml/qml/qqmlimport.cpp +++ b/src/qml/qml/qqmlimport.cpp @@ -1897,17 +1897,22 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e) @@ -26,8 +26,8 @@ index 289f11d006..80c422403c 100644 + } + }; + -+ addEnvImportPath("NIXPKGS_QT5_QML_IMPORT_PATH"); + addEnvImportPath("QML2_IMPORT_PATH"); ++ addEnvImportPath("NIXPKGS_QT5_QML_IMPORT_PATH"); addImportPath(QStringLiteral("qrc:/qt-project.org/imports")); addImportPath(QCoreApplication::applicationDirPath()); diff --git a/pkgs/development/libraries/qt-6/patches/qtdeclarative-qml-paths.patch b/pkgs/development/libraries/qt-6/patches/qtdeclarative-qml-paths.patch index 7c6694eb48a3..39b7a30892cf 100644 --- a/pkgs/development/libraries/qt-6/patches/qtdeclarative-qml-paths.patch +++ b/pkgs/development/libraries/qt-6/patches/qtdeclarative-qml-paths.patch @@ -1,12 +1,12 @@ diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp -index a7d1a3f77f..aac7392d4f 100644 +index 2e482c220d..4873809bec 100644 --- a/src/qml/qml/qqmlimport.cpp +++ b/src/qml/qml/qqmlimport.cpp -@@ -1515,6 +1515,7 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e) - }; - +@@ -1517,6 +1517,7 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e) // env import paths -+ addEnvImportPath("NIXPKGS_QT6_QML_IMPORT_PATH"); addEnvImportPath("QML_IMPORT_PATH"); addEnvImportPath("QML2_IMPORT_PATH"); ++ addEnvImportPath("NIXPKGS_QT6_QML_IMPORT_PATH"); + addImportPath(QStringLiteral("qrc:/qt/qml")); + addImportPath(QStringLiteral("qrc:/qt-project.org/imports"));