diff --git a/pkgs/development/libraries/qt-5/5.11/qttools.patch b/pkgs/development/libraries/qt-5/5.11/qttools.patch index fbba439ef7a..622efc35b6b 100644 --- a/pkgs/development/libraries/qt-5/5.11/qttools.patch +++ b/pkgs/development/libraries/qt-5/5.11/qttools.patch @@ -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; diff --git a/pkgs/development/libraries/qt-5/5.12/default.nix b/pkgs/development/libraries/qt-5/5.12/default.nix index ef0cf97a428..2aa7d0f71ee 100644 --- a/pkgs/development/libraries/qt-5/5.12/default.nix +++ b/pkgs/development/libraries/qt-5/5.12/default.nix @@ -66,6 +66,7 @@ let ./qtwebkit-darwin-no-readline.patch ./qtwebkit-darwin-no-qos-classes.patch ]; + qttools = [ ./qttools.patch ]; }; mkDerivation = diff --git a/pkgs/development/libraries/qt-5/5.12/qttools.patch b/pkgs/development/libraries/qt-5/5.12/qttools.patch new file mode 100644 index 00000000000..8ae12198ca2 --- /dev/null +++ b/pkgs/development/libraries/qt-5/5.12/qttools.patch @@ -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; diff --git a/pkgs/development/libraries/qt-5/modules/qttools.nix b/pkgs/development/libraries/qt-5/modules/qttools.nix index 622d841b405..573472a8b5a 100644 --- a/pkgs/development/libraries/qt-5/modules/qttools.nix +++ b/pkgs/development/libraries/qt-5/modules/qttools.nix @@ -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; }