aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build_scripts/__init__.py35
-rw-r--r--build_scripts/utils.py16
2 files changed, 33 insertions, 18 deletions
diff --git a/build_scripts/__init__.py b/build_scripts/__init__.py
index ba7888bdb..939e83d3f 100644
--- a/build_scripts/__init__.py
+++ b/build_scripts/__init__.py
@@ -12,20 +12,29 @@ PYSIDE_PYTHON_TOOLS = ["metaobjectdump",
"qml",
"qtpy2cpp",
"genpyi"]
-PYSIDE_LINUX_BIN_TOOLS = ["lupdate",
- "lrelease",
- "qmllint",
- "qmlformat",
- "qmlls",
- "assistant",
- "designer",
- "linguist"]
-PYSIDE_LINUX_LIBEXEC_TOOLS = ["uic",
- "rcc",
- "qmltyperegistrar",
- "qmlimportscanner"]
+PYSIDE_UNIX_BIN_TOOLS = ["lupdate",
+ "lrelease",
+ "qmllint",
+ "qmlformat",
+ "qmlls"]
+
+# tools that are bundled as .app in macOS
+# keys represent tool name
+# value represents the path to the tool in the macOS app bundle
+PYSIDE_UNIX_BUNDLED_TOOLS = {name: f"{name.capitalize()}.app/Contents/MacOS/{name.capitalize()}"
+ for name in ["assistant",
+ "designer",
+ "linguist"]}
+
+PYSIDE_LINUX_BIN_TOOLS = PYSIDE_UNIX_BIN_TOOLS + [name for name in PYSIDE_UNIX_BUNDLED_TOOLS.keys()]
+
+PYSIDE_UNIX_LIBEXEC_TOOLS = ["uic",
+ "rcc",
+ "qmltyperegistrar",
+ "qmlimportscanner"]
+
# all Qt tools are in 'bin' folder in Windows
-PYSIDE_WINDOWS_BIN_TOOLS = PYSIDE_LINUX_LIBEXEC_TOOLS + PYSIDE_LINUX_BIN_TOOLS
+PYSIDE_WINDOWS_BIN_TOOLS = PYSIDE_UNIX_LIBEXEC_TOOLS + PYSIDE_LINUX_BIN_TOOLS
ANDROID_ESSENTIALS = ["Core", "Gui", "Widgets", "Network", "OpenGL", "Qml", "Quick",
"QuickControls2"]
diff --git a/build_scripts/utils.py b/build_scripts/utils.py
index 633e413d0..53cb5961e 100644
--- a/build_scripts/utils.py
+++ b/build_scripts/utils.py
@@ -18,8 +18,8 @@ from pathlib import Path
from textwrap import dedent, indent
from .log import log
-from . import (PYSIDE_PYTHON_TOOLS, PYSIDE_LINUX_BIN_TOOLS, PYSIDE_LINUX_LIBEXEC_TOOLS,
- PYSIDE_WINDOWS_BIN_TOOLS)
+from . import (PYSIDE_PYTHON_TOOLS, PYSIDE_LINUX_BIN_TOOLS, PYSIDE_UNIX_LIBEXEC_TOOLS,
+ PYSIDE_WINDOWS_BIN_TOOLS, PYSIDE_UNIX_BIN_TOOLS, PYSIDE_UNIX_BUNDLED_TOOLS)
try:
# Using the distutils implementation within setuptools
@@ -1144,10 +1144,16 @@ def available_pyside_tools(qt_tools_path: Path, package_for_wheels: bool = False
else:
lib_exec_path = qt_tools_path / "Qt" / "libexec" if package_for_wheels \
else qt_tools_path / "libexec"
- pyside_tools.extend([tool for tool in PYSIDE_LINUX_LIBEXEC_TOOLS
+ pyside_tools.extend([tool for tool in PYSIDE_UNIX_LIBEXEC_TOOLS
if tool_exist(lib_exec_path / tool)])
- pyside_tools.extend([tool for tool in PYSIDE_LINUX_BIN_TOOLS
- if tool_exist(bin_path / tool)])
+ if sys.platform == 'darwin':
+ pyside_tools.extend([tool for tool in PYSIDE_UNIX_BIN_TOOLS
+ if tool_exist(bin_path / tool)])
+ pyside_tools.extend([tool_name for tool_name, tool_path in PYSIDE_UNIX_BUNDLED_TOOLS.items()
+ if tool_exist(bin_path / tool_path)])
+ else:
+ pyside_tools.extend([tool for tool in PYSIDE_LINUX_BIN_TOOLS
+ if tool_exist(bin_path / tool)])
return pyside_tools