aboutsummaryrefslogtreecommitdiffstats
path: root/build_scripts/platforms/linux.py
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2022-11-30 13:54:51 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2022-12-01 15:51:28 +0100
commitb32a791ea2c66ae9ef2896ea445d4752e4773f96 (patch)
treee88bb78786e996119f4409e0e169c6ac3d02e181 /build_scripts/platforms/linux.py
parentc2b73dfc245b48cd6de7a6461d56b73f84654bf1 (diff)
Build system: Introduce variables for the target Qt directories
It simplifies the code and paves the way for using identical directories on the various platforms. Pick-to: 6.4 Change-Id: Id50d06f100f13c83ea40b475dcf1a05a08ffa3bd Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'build_scripts/platforms/linux.py')
-rw-r--r--build_scripts/platforms/linux.py31
1 files changed, 16 insertions, 15 deletions
diff --git a/build_scripts/platforms/linux.py b/build_scripts/platforms/linux.py
index d1de03730..9ea1993c6 100644
--- a/build_scripts/platforms/linux.py
+++ b/build_scripts/platforms/linux.py
@@ -30,22 +30,23 @@ def prepare_standalone_package_linux(pyside_build, _vars, cross_build=False):
should_copy_icu_libs = False
# <qt>/lib/* -> <setup>/{st_package_name}/Qt/lib
- destination_lib_dir = "{st_build_dir}/{st_package_name}/Qt/lib"
+ destination_dir = "{st_build_dir}/{st_package_name}".format(**_vars)
+ destination_qt_dir = f"{destination_dir}/Qt"
+ destination_qt_lib_dir = f"{destination_qt_dir}/lib"
accepted_modules = ['libQt6*.so.?']
if constrain_modules:
accepted_modules = [f"libQt6{module}*.so.?" for module in constrain_modules]
accepted_modules.append("libicu*.so.??")
- copydir("{qt_lib_dir}", destination_lib_dir,
+ copydir("{qt_lib_dir}", destination_qt_lib_dir,
_filter=accepted_modules,
recursive=False, _vars=_vars, force_copy_symlinks=True)
if should_copy_icu_libs:
# Check if ICU libraries were copied over to the destination
# Qt libdir.
- resolved_destination_lib_dir = destination_lib_dir.format(**_vars)
- maybe_icu_libs = find_files_using_glob(resolved_destination_lib_dir, "libicu*")
+ maybe_icu_libs = find_files_using_glob(destination_qt_lib_dir, "libicu*")
# If no ICU libraries are present in the Qt libdir (like when
# Qt is built against system ICU, or in the Coin CI where ICU
@@ -56,21 +57,21 @@ def prepare_standalone_package_linux(pyside_build, _vars, cross_build=False):
# We choose the QtCore lib to inspect, by
# checking which QtCore library the shiboken6 executable uses.
if not maybe_icu_libs and not cross_build:
- copy_icu_libs(pyside_build._patchelf_path, resolved_destination_lib_dir)
+ copy_icu_libs(pyside_build._patchelf_path, destination_qt_lib_dir)
# Set RPATH for Qt libs.
- pyside_build.update_rpath_for_linux_qt_libraries(destination_lib_dir.format(**_vars))
+ pyside_build.update_rpath_for_linux_qt_libraries(destination_qt_lib_dir)
# Patching designer to use the Qt libraries provided in the wheel
if config.is_internal_pyside_build() and not OPTION['NO_QT_TOOLS']:
- assistant_path = "{st_build_dir}/{st_package_name}/assistant".format(**_vars)
+ assistant_path = f"{destination_dir}/assistant"
linux_patch_executable(pyside_build._patchelf_path, assistant_path)
- designer_path = "{st_build_dir}/{st_package_name}/designer".format(**_vars)
+ designer_path = f"{destination_dir}/designer"
linux_patch_executable(pyside_build._patchelf_path, designer_path)
if pyside_build.is_webengine_built(built_modules):
copydir("{qt_data_dir}/resources",
- "{st_build_dir}/{st_package_name}/Qt/resources",
+ f"{destination_qt_dir}/resources",
_filter=None,
recursive=False,
_vars=_vars)
@@ -78,7 +79,7 @@ def prepare_standalone_package_linux(pyside_build, _vars, cross_build=False):
if copy_plugins:
is_pypy = "pypy" in pyside_build.build_classifiers
# <qt>/plugins/* -> <setup>/{st_package_name}/Qt/plugins
- plugins_target = "{st_build_dir}/{st_package_name}/Qt/plugins"
+ plugins_target = f"{destination_qt_dir}/plugins"
copydir("{qt_plugins_dir}", plugins_target,
_filter=["*.so"],
recursive=True,
@@ -96,7 +97,7 @@ def prepare_standalone_package_linux(pyside_build, _vars, cross_build=False):
if copy_qml:
# <qt>/qml/* -> <setup>/{st_package_name}/Qt/qml
- qml_plugins_target = "{st_build_dir}/{st_package_name}/Qt/qml"
+ qml_plugins_target = f"{destination_qt_dir}/qml"
copydir("{qt_qml_dir}",
qml_plugins_target,
_filter=None,
@@ -105,24 +106,24 @@ def prepare_standalone_package_linux(pyside_build, _vars, cross_build=False):
ignore=["*.debug"],
_vars=_vars)
copied_plugins = pyside_build.get_shared_libraries_in_path_recursively(
- qml_plugins_target.format(**_vars))
+ qml_plugins_target)
pyside_build.update_rpath_for_linux_plugins(
copied_plugins,
- qt_lib_dir=destination_lib_dir.format(**_vars),
+ qt_lib_dir=destination_qt_lib_dir,
is_qml_plugin=True)
if copy_translations:
# <qt>/translations/* ->
# <setup>/{st_package_name}/Qt/translations
copydir("{qt_translations_dir}",
- "{st_build_dir}/{st_package_name}/Qt/translations",
+ f"{destination_qt_dir}/translations",
_filter=["*.qm", "*.pak"],
force=False,
_vars=_vars)
if copy_qt_conf:
# Copy the qt.conf file to libexec.
- qt_libexec_path = Path("{st_build_dir}/{st_package_name}/Qt/libexec".format(**_vars))
+ qt_libexec_path = Path(destination_qt_dir) / "libexec"
if not qt_libexec_path.is_dir():
os.makedirs(qt_libexec_path)
copyfile(f"{{build_dir}}/{PYSIDE}/{{st_package_name}}/qt.conf",