nixpkgs/pkgs/development/libraries/qt-6/patches/0009-qtbase-find-qmlimportscanner-in-macdeployqt-via-envi.patch
2023-11-27 10:37:13 -05:00

36 lines
1.6 KiB
Diff

From d503be89320f0b89b80acb19769971e855be6ae1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juan=20Pedro=20Bol=C3=ADvar=20Puente?= <raskolnikov@gnu.org>
Date: Wed, 9 Aug 2023 16:16:21 +0200
Subject: [PATCH 09/11] qtbase: find qmlimportscanner in macdeployqt via
environment
The qmlimportscanner tool is provided by qtdeclarative. Because of the
modularized installation in Nix, it can not be found via the usual
mechanisms. Also, hard-coding it like we do for Qt5 would also not
work, as it would require making qtbase depend on qtdeclarative.
Here we add an option to provide its location via the environment.
While this means macdeployqt does not work out of the box, it provides
a workaround for users.
---
src/tools/macdeployqt/shared/shared.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/tools/macdeployqt/shared/shared.cpp b/src/tools/macdeployqt/shared/shared.cpp
index ba10ae02bcd..320095a972d 100644
--- a/src/tools/macdeployqt/shared/shared.cpp
+++ b/src/tools/macdeployqt/shared/shared.cpp
@@ -1277,6 +1277,10 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
if (!QFile::exists(qmlImportScannerPath))
qmlImportScannerPath = QCoreApplication::applicationDirPath() + "/qmlimportscanner";
+ // Fallback: Pass qml import scanner via environment variable
+ if (!QFile::exists(qmlImportScannerPath))
+ qmlImportScannerPath = ::qgetenv("NIX_QMLIMPORTSCANNER");
+
// Verify that we found a qmlimportscanner binary
if (!QFile::exists(qmlImportScannerPath)) {
LogError() << "qmlimportscanner not found at" << qmlImportScannerPath;
--
2.42.0