nixpkgs-suyu/pkgs/development/libraries/qt-5/5.11/qttools.patch
Matthew Bauer 79c0e740a7 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
2019-06-22 22:21:38 -04:00

86 lines
3.6 KiB
Diff

diff --git a/src/assistant/help/Qt5HelpConfigExtras.cmake.in b/src/assistant/help/Qt5HelpConfigExtras.cmake.in
index 3b97923a..63336bd5 100644
--- a/src/assistant/help/Qt5HelpConfigExtras.cmake.in
+++ b/src/assistant/help/Qt5HelpConfigExtras.cmake.in
@@ -2,11 +2,10 @@
if (NOT TARGET Qt5::qcollectiongenerator)
add_executable(Qt5::qcollectiongenerator IMPORTED)
-!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
- set(imported_location \"${_qt5Help_install_prefix}/$${CMAKE_BIN_DIR}qcollectiongenerator$$CMAKE_BIN_SUFFIX\")
-!!ELSE
set(imported_location \"$${CMAKE_BIN_DIR}qcollectiongenerator$$CMAKE_BIN_SUFFIX\")
-!!ENDIF
+ if(NOT EXISTS \"${imported_location}\")
+ set(imported_location \"$${CMAKE_BIN_DIR}qcollectiongenerator$$CMAKE_BIN_SUFFIX\")
+ endif()
_qt5_Help_check_file_exists(${imported_location})
set_target_properties(Qt5::qcollectiongenerator PROPERTIES
@@ -17,11 +16,7 @@ endif()
if (NOT TARGET Qt5::qhelpgenerator)
add_executable(Qt5::qhelpgenerator IMPORTED)
-!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
- set(imported_location \"${_qt5Help_install_prefix}/$${CMAKE_BIN_DIR}qhelpgenerator$$CMAKE_BIN_SUFFIX\")
-!!ELSE
set(imported_location \"$${CMAKE_BIN_DIR}qhelpgenerator$$CMAKE_BIN_SUFFIX\")
-!!ENDIF
_qt5_Help_check_file_exists(${imported_location})
set_target_properties(Qt5::qhelpgenerator PROPERTIES
diff --git a/src/linguist/Qt5LinguistToolsConfig.cmake.in b/src/linguist/Qt5LinguistToolsConfig.cmake.in
index 4318b16f..d60db4ff 100644
--- a/src/linguist/Qt5LinguistToolsConfig.cmake.in
+++ b/src/linguist/Qt5LinguistToolsConfig.cmake.in
@@ -44,11 +44,7 @@ endmacro()
if (NOT TARGET Qt5::lrelease)
add_executable(Qt5::lrelease IMPORTED)
-!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
- set(imported_location \"${_qt5_linguisttools_install_prefix}/$${CMAKE_BIN_DIR}lrelease$$CMAKE_BIN_SUFFIX\")
-!!ELSE
set(imported_location \"$${CMAKE_BIN_DIR}lrelease$$CMAKE_BIN_SUFFIX\")
-!!ENDIF
_qt5_LinguistTools_check_file_exists(${imported_location})
set_target_properties(Qt5::lrelease PROPERTIES
@@ -59,11 +55,7 @@ endif()
if (NOT TARGET Qt5::lupdate)
add_executable(Qt5::lupdate IMPORTED)
-!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
- set(imported_location \"${_qt5_linguisttools_install_prefix}/$${CMAKE_BIN_DIR}lupdate$$CMAKE_BIN_SUFFIX\")
-!!ELSE
set(imported_location \"$${CMAKE_BIN_DIR}lupdate$$CMAKE_BIN_SUFFIX\")
-!!ENDIF
_qt5_LinguistTools_check_file_exists(${imported_location})
set_target_properties(Qt5::lupdate PROPERTIES
@@ -74,11 +66,7 @@ endif()
if (NOT TARGET Qt5::lconvert)
add_executable(Qt5::lconvert IMPORTED)
-!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
- set(imported_location \"${_qt5_linguisttools_install_prefix}/$${CMAKE_BIN_DIR}lconvert$$CMAKE_BIN_SUFFIX\")
-!!ELSE
set(imported_location \"$${CMAKE_BIN_DIR}lconvert$$CMAKE_BIN_SUFFIX\")
-!!ENDIF
_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;