about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/qt-6/patches/0008-qtbase-find-qmlimportscanner-in-macdeployqt-via-environment.patch
blob: 32e30679ec59527160e2dd82903a639ebfc9fa96 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 505391a31aa353b8f1cc5d3feb9861582554d9f1 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 1/3] 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 643fe5390a..b8fcc9c9bd 100644
--- a/src/tools/macdeployqt/shared/shared.cpp
+++ b/src/tools/macdeployqt/shared/shared.cpp
@@ -1270,6 +1270,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.26.2