aboutsummaryrefslogtreecommitdiffstats
path: root/build_scripts
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-06-16 10:24:56 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-06-16 22:41:18 +0200
commit08671510ace90d74cb0eaaa0a22cc14e3fb17c98 (patch)
tree599ecd103b7a34f9e801a2e51d23faaff524be5d /build_scripts
parent63144841ee813bf2cdddb90702cb3490ee4228f1 (diff)
Build scripts/UNIX: Extract helper function to copy GUI executables
Prepare for adding more binaries. Task-number: PYSIDE-1378 Change-Id: I0156556503b2379a738175491300057e3d7b132c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'build_scripts')
-rw-r--r--build_scripts/platforms/unix.py38
1 files changed, 26 insertions, 12 deletions
diff --git a/build_scripts/platforms/unix.py b/build_scripts/platforms/unix.py
index 6698cdc13..00f42e73f 100644
--- a/build_scripts/platforms/unix.py
+++ b/build_scripts/platforms/unix.py
@@ -51,6 +51,31 @@ from ..utils import regenerate_qt_resources
from ..versions import PYSIDE, SHIBOKEN
+def _macos_copy_gui_executable(name, vars=None):
+ """macOS helper: Copy a GUI executable from the .app folder and return the
+ files"""
+ app_name = name[:1].upper() + name[1:] + '.app'
+ return copydir(f"{{install_dir}}/bin/{app_name}",
+ f"{{st_build_dir}}/{{st_package_name}}/{app_name}",
+ filter=None, recursive=True,
+ force=False, vars=vars)
+
+
+def _unix_copy_gui_executable(name, vars=None):
+ """UNIX helper: Copy a GUI executable and return the files"""
+ return copydir("{install_dir}/bin/",
+ "{st_build_dir}/{st_package_name}/",
+ filter=[name],
+ force=False, vars=vars)
+
+
+def _copy_gui_executable(name, vars=None):
+ """Copy a GUI executable and return the files"""
+ if sys.platform == 'darwin':
+ return _macos_copy_gui_executable(name, vars)
+ return _unix_copy_gui_executable(name, vars)
+
+
def prepare_packages_posix(self, vars):
executables = []
@@ -143,18 +168,7 @@ def prepare_packages_posix(self, vars):
recursive=False, vars=vars))
# Copying designer
- if sys.platform == "darwin":
- executables.extend(copydir(
- "{install_dir}/bin/Designer.app",
- "{st_build_dir}/{st_package_name}/Designer.app",
- filter=None, recursive=True,
- force=False, vars=vars))
- else:
- executables.extend(copydir(
- "{install_dir}/bin/",
- "{st_build_dir}/{st_package_name}/",
- filter=["designer"],
- force=False, vars=vars))
+ executables.extend(_copy_gui_executable('designer', vars=vars))
# <install>/lib/lib* -> {st_package_name}/
copydir(