qttools: patch qmlimportscanner for darwin builds

This needs to be the full path for qtmacdeploy to work. We add
${qt5.qttools.dev}/bin/qmlimportscanner as the default.

Fixes #63093
This commit is contained in:
Matthew Bauer 2019-06-22 22:20:35 -04:00
parent 6f40e5d9a2
commit 79c0e740a7
4 changed files with 35 additions and 1 deletions

View file

@ -69,3 +69,18 @@ index 4318b16f..d60db4ff 100644
_qt5_LinguistTools_check_file_exists(${imported_location})
set_target_properties(Qt5::lconvert PROPERTIES
--- a/src/macdeployqt/shared/shared.cpp
+++ b/src/macdeployqt/shared/shared.cpp
@@ -1241,6 +1241,12 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
if (!QFile(qmlImportScannerPath).exists())
qmlImportScannerPath = QCoreApplication::applicationDirPath() + "/qmlimportscanner";
+#ifdef NIXPKGS_QMLIMPORTSCANNER
+ // Fallback: Nixpkgs hardcoded path
+ if (!QFile(qmlImportScannerPath).exists())
+ qmlImportScannerPath = NIXPKGS_QMLIMPORTSCANNER;
+#endif
+
// Verify that we found a qmlimportscanner binary
if (!QFile(qmlImportScannerPath).exists()) {
LogError() << "qmlimportscanner not found at" << qmlImportScannerPath;

View file

@ -66,6 +66,7 @@ let
./qtwebkit-darwin-no-readline.patch
./qtwebkit-darwin-no-qos-classes.patch
];
qttools = [ ./qttools.patch ];
};
mkDerivation =

View file

@ -0,0 +1,15 @@
--- a/src/macdeployqt/shared/shared.cpp
+++ b/src/macdeployqt/shared/shared.cpp
@@ -1241,6 +1241,12 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
if (!QFile(qmlImportScannerPath).exists())
qmlImportScannerPath = QCoreApplication::applicationDirPath() + "/qmlimportscanner";
+#ifdef NIXPKGS_QMLIMPORTSCANNER
+ // Fallback: Nixpkgs hardcoded path
+ if (!QFile(qmlImportScannerPath).exists())
+ qmlImportScannerPath = NIXPKGS_QMLIMPORTSCANNER;
+#endif
+
// Verify that we found a qmlimportscanner binary
if (!QFile(qmlImportScannerPath).exists()) {
LogError() << "qmlimportscanner not found at" << qmlImportScannerPath;

View file

@ -1,4 +1,4 @@
{ qtModule, stdenv, lib, qtbase }:
{ qtModule, stdenv, lib, qtbase, qtdeclarative }:
with lib;
@ -32,5 +32,8 @@ qtModule {
"bin/macdeployqt"
];
NIX_CFLAGS_COMPILE =
lib.optional stdenv.isDarwin ''-DNIXPKGS_QMLIMPORTSCANNER="${qtdeclarative.dev}/bin/qmlimportscanner"'';
setupHook = ../hooks/qttools-setup-hook.sh;
}