diff options
| author | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2022-10-28 16:45:30 +0200 |
|---|---|---|
| committer | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2022-10-31 12:17:46 +0200 |
| commit | e52b2c9ed9bb86042811b36a910f79dd94fbe0cc (patch) | |
| tree | 11e2a3aa9ad065f6fb7c5b1a09992910c8918613 | |
| parent | d40bb5edc0ca96159ac026a65235306c513b3143 (diff) | |
build scripts: use proper variable name instead of self
- Remnants of 6fe563b2aa15c2c23369acce353be69f6ea84c77
Pick-to: 6.4 6.3
Change-Id: I664b960324d49db08f7a8ec6cf5244fbcda970d0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| -rw-r--r-- | build_scripts/platforms/linux.py | 22 | ||||
| -rw-r--r-- | build_scripts/platforms/macos.py | 18 | ||||
| -rw-r--r-- | build_scripts/platforms/unix.py | 22 | ||||
| -rw-r--r-- | build_scripts/platforms/windows_desktop.py | 28 |
4 files changed, 45 insertions, 45 deletions
diff --git a/build_scripts/platforms/linux.py b/build_scripts/platforms/linux.py index 4629d456c..ab4acc274 100644 --- a/build_scripts/platforms/linux.py +++ b/build_scripts/platforms/linux.py @@ -11,7 +11,7 @@ from ..utils import (copy_icu_libs, copydir, copyfile, find_files_using_glob, from ..versions import PYSIDE -def prepare_standalone_package_linux(self, _vars, cross_build=False): +def prepare_standalone_package_linux(pyside_build, _vars, cross_build=False): built_modules = _vars['built_modules'] constrain_modules = None @@ -56,19 +56,19 @@ def prepare_standalone_package_linux(self, _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(self._patchelf_path, resolved_destination_lib_dir) + copy_icu_libs(pyside_build._patchelf_path, resolved_destination_lib_dir) # Set RPATH for Qt libs. - self.update_rpath_for_linux_qt_libraries(destination_lib_dir.format(**_vars)) + pyside_build.update_rpath_for_linux_qt_libraries(destination_lib_dir.format(**_vars)) # 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) - linux_patch_executable(self._patchelf_path, assistant_path) + linux_patch_executable(pyside_build._patchelf_path, assistant_path) designer_path = "{st_build_dir}/{st_package_name}/designer".format(**_vars) - linux_patch_executable(self._patchelf_path, designer_path) + linux_patch_executable(pyside_build._patchelf_path, designer_path) - if self.is_webengine_built(built_modules): + if pyside_build.is_webengine_built(built_modules): copydir("{qt_data_dir}/resources", "{st_build_dir}/{st_package_name}/Qt/resources", _filter=None, @@ -76,7 +76,7 @@ def prepare_standalone_package_linux(self, _vars, cross_build=False): _vars=_vars) if copy_plugins: - is_pypy = "pypy" in self.build_classifiers + 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" copydir("{qt_plugins_dir}", plugins_target, @@ -90,9 +90,9 @@ def prepare_standalone_package_linux(self, _vars, cross_build=False): recursive=False, _vars=_vars) - copied_plugins = self.get_shared_libraries_in_path_recursively( + copied_plugins = pyside_build.get_shared_libraries_in_path_recursively( plugins_target.format(**_vars)) - self.update_rpath_for_linux_plugins(copied_plugins) + pyside_build.update_rpath_for_linux_plugins(copied_plugins) if copy_qml: # <qt>/qml/* -> <setup>/{st_package_name}/Qt/qml @@ -104,9 +104,9 @@ def prepare_standalone_package_linux(self, _vars, cross_build=False): recursive=True, ignore=["*.debug"], _vars=_vars) - copied_plugins = self.get_shared_libraries_in_path_recursively( + copied_plugins = pyside_build.get_shared_libraries_in_path_recursively( qml_plugins_target.format(**_vars)) - self.update_rpath_for_linux_plugins( + pyside_build.update_rpath_for_linux_plugins( copied_plugins, qt_lib_dir=destination_lib_dir.format(**_vars), is_qml_plugin=True) diff --git a/build_scripts/platforms/macos.py b/build_scripts/platforms/macos.py index ffb2070b7..a6423e1c1 100644 --- a/build_scripts/platforms/macos.py +++ b/build_scripts/platforms/macos.py @@ -21,7 +21,7 @@ def _macos_patch_executable(name, _vars=None): macos_add_rpath(rpath, binary) -def prepare_standalone_package_macos(self, _vars): +def prepare_standalone_package_macos(pyside_build, _vars): built_modules = _vars['built_modules'] constrain_modules = None @@ -49,7 +49,7 @@ def prepare_standalone_package_macos(self, _vars): no_copy_debug = True def file_variant_filter(file_name, file_full_path): - if self.qtinfo.build_type != 'debug_and_release': + if pyside_build.qtinfo.build_type != 'debug_and_release': return True if file_name.endswith('_debug.dylib') and no_copy_debug: return False @@ -62,11 +62,11 @@ def prepare_standalone_package_macos(self, _vars): _macos_patch_executable('linguist', _vars) # <qt>/lib/* -> <setup>/{st_package_name}/Qt/lib - if self.qt_is_framework_build(): + if pyside_build.qt_is_framework_build(): def framework_dir_filter(dir_name, parent_full_path, dir_full_path): if '.framework' in dir_name: if (dir_name.startswith('QtWebEngine') - and not self.is_webengine_built(built_modules)): + and not pyside_build.is_webengine_built(built_modules)): return False if constrain_modules and dir_name not in constrain_frameworks: return False @@ -86,7 +86,7 @@ def prepare_standalone_package_macos(self, _vars): no_copy_debug = True def framework_variant_filter(file_name, file_full_path): - if self.qtinfo.build_type != 'debug_and_release': + if pyside_build.qtinfo.build_type != 'debug_and_release': return True dir_path = Path(file_full_path).parent in_framework = dir_path.endswith("Versions/5") @@ -104,7 +104,7 @@ def prepare_standalone_package_macos(self, _vars): # present rpath does not work because it assumes a symlink # from Versions/5/Helpers, thus adding two more levels of # directory hierarchy. - if self.is_webengine_built(built_modules): + if pyside_build.is_webengine_built(built_modules): qt_lib_path = Path("{st_build_dir}/{st_package_name}/Qt/lib".format(**_vars)) bundle = Path("QtWebEngineCore.framework/Helpers/") / "QtWebEngineProcess.app" binary = "Contents/MacOS/QtWebEngineProcess" @@ -114,7 +114,7 @@ def prepare_standalone_package_macos(self, _vars): macos_fix_rpaths_for_library(final_path, rpath) else: ignored_modules = [] - if not self.is_webengine_built(built_modules): + if not pyside_build.is_webengine_built(built_modules): ignored_modules.extend(['libQt6WebEngine*.dylib']) accepted_modules = ['libQt6*.6.dylib'] if constrain_modules: @@ -127,7 +127,7 @@ def prepare_standalone_package_macos(self, _vars): file_filter_function=file_variant_filter, recursive=True, _vars=_vars, force_copy_symlinks=True) - if self.is_webengine_built(built_modules): + if pyside_build.is_webengine_built(built_modules): copydir("{qt_data_dir}/resources", "{st_build_dir}/{st_package_name}/Qt/resources", _filter=None, @@ -150,7 +150,7 @@ def prepare_standalone_package_macos(self, _vars): qt_libexec_path, _vars=_vars) if copy_plugins: - is_pypy = "pypy" in self.build_classifiers + 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" filters = ["*.dylib"] diff --git a/build_scripts/platforms/unix.py b/build_scripts/platforms/unix.py index e7bdb7a70..f1bc5d2bc 100644 --- a/build_scripts/platforms/unix.py +++ b/build_scripts/platforms/unix.py @@ -38,7 +38,7 @@ def _copy_gui_executable(name, _vars=None): return _unix_copy_gui_executable(name, _vars) -def prepare_packages_posix(self, _vars, cross_build=False): +def prepare_packages_posix(pyside_build, _vars, cross_build=False): executables = [] libexec_executables = [] @@ -51,7 +51,7 @@ def prepare_packages_posix(self, _vars, cross_build=False): "{st_build_dir}/{st_package_name}", _vars=_vars) - generated_config = self.get_built_pyside_config(_vars) + generated_config = pyside_build.get_built_pyside_config(_vars) def adjusted_lib_name(name, version): postfix = '' @@ -150,8 +150,8 @@ def prepare_packages_posix(self, _vars, cross_build=False): recursive=False, _vars=_vars, force_copy_symlinks=True) # Copy libexec - built_modules = self.get_built_pyside_config(_vars)['built_modules'] - if self.is_webengine_built(built_modules): + built_modules = pyside_build.get_built_pyside_config(_vars)['built_modules'] + if pyside_build.is_webengine_built(built_modules): lib_exec_filters.append('QtWebEngineProcess') if lib_exec_filters: libexec_executables.extend(copydir("{qt_lib_execs_dir}", @@ -205,7 +205,7 @@ def prepare_packages_posix(self, _vars, cross_build=False): return False return True # examples/* -> <setup>/{st_package_name}/examples - copydir(str(self.script_dir / "examples"), + copydir(str(pyside_build.script_dir / "examples"), "{st_build_dir}/{st_package_name}/examples", force=False, _vars=_vars, dir_filter_function=pycache_dir_filter) @@ -214,18 +214,18 @@ def prepare_packages_posix(self, _vars, cross_build=False): if config.is_internal_pyside_build() or config.is_internal_shiboken_generator_build(): _vars['built_modules'] = generated_config['built_modules'] if sys.platform == 'darwin': - prepare_standalone_package_macos(self, _vars) + prepare_standalone_package_macos(pyside_build, _vars) else: - prepare_standalone_package_linux(self, _vars, cross_build) + prepare_standalone_package_linux(pyside_build, _vars, cross_build) if config.is_internal_shiboken_generator_build(): # Copy over clang before rpath patching. - self.prepare_standalone_clang(is_win=False) + pyside_build.prepare_standalone_clang(is_win=False) # Update rpath to $ORIGIN if sys.platform.startswith('linux') or sys.platform.startswith('darwin'): rpath_path = "{st_build_dir}/{st_package_name}".format(**_vars) - self.update_rpath(rpath_path, executables) - self.update_rpath(rpath_path, self.package_libraries(rpath_path)) + pyside_build.update_rpath(rpath_path, executables) + pyside_build.update_rpath(rpath_path, pyside_build.package_libraries(rpath_path)) if libexec_executables: - self.update_rpath(rpath_path, libexec_executables, libexec=True) + pyside_build.update_rpath(rpath_path, libexec_executables, libexec=True) diff --git a/build_scripts/platforms/windows_desktop.py b/build_scripts/platforms/windows_desktop.py index d9392a79a..4b5e15335 100644 --- a/build_scripts/platforms/windows_desktop.py +++ b/build_scripts/platforms/windows_desktop.py @@ -14,11 +14,11 @@ from ..utils import (copydir, copyfile, download_and_extract_7z, filter_match, from ..versions import PYSIDE, SHIBOKEN -def prepare_packages_win32(self, _vars): +def prepare_packages_win32(pyside_build, _vars): # For now, debug symbols will not be shipped into the package. copy_pdbs = False pdbs = [] - if (self.debug or self.build_type == 'RelWithDebInfo') and copy_pdbs: + if (pyside_build.debug or pyside_build.build_type == 'RelWithDebInfo') and copy_pdbs: pdbs = ['*.pdb'] # <install>/lib/site-packages/{st_package_name}/* -> @@ -196,7 +196,7 @@ def prepare_packages_win32(self, _vars): return False return True # examples/* -> <setup>/{st_package_name}/examples - copydir(self.script_dir / "examples", + copydir(pyside_build.script_dir / "examples", "{st_build_dir}/{st_package_name}/examples", force=False, _vars=_vars, dir_filter_function=pycache_dir_filter) @@ -214,7 +214,7 @@ def prepare_packages_win32(self, _vars): copy_msvc_redist_files(_vars, Path("{build_dir}/msvc_redist".format(**_vars))) if config.is_internal_pyside_build() or config.is_internal_shiboken_generator_build(): - copy_qt_artifacts(self, copy_pdbs, _vars) + copy_qt_artifacts(pyside_build, copy_pdbs, _vars) copy_msvc_redist_files(_vars, Path("{build_dir}/msvc_redist".format(**_vars))) @@ -260,8 +260,8 @@ def copy_msvc_redist_files(_vars, redist_target_path): _filter=msvc_redist, recursive=False, _vars=_vars) -def copy_qt_artifacts(self, copy_pdbs, _vars): - built_modules = self.get_built_pyside_config(_vars)['built_modules'] +def copy_qt_artifacts(pyside_build, copy_pdbs, _vars): + built_modules = pyside_build.get_built_pyside_config(_vars)['built_modules'] constrain_modules = None copy_plugins = True @@ -299,9 +299,9 @@ def copy_qt_artifacts(self, copy_pdbs, _vars): "libEGL{}.dll", "libGLESv2{}.dll" ] - if self.qtinfo.build_type != 'debug_and_release': + if pyside_build.qtinfo.build_type != 'debug_and_release': egl_suffix = '*' - elif self.debug: + elif pyside_build.debug: egl_suffix = 'd' else: egl_suffix = '' @@ -342,7 +342,7 @@ def copy_qt_artifacts(self, copy_pdbs, _vars): # If qt is not a debug_and_release build, that means there # is only one set of shared libraries, so we can just copy # them. - if self.qtinfo.build_type != 'debug_and_release': + if pyside_build.qtinfo.build_type != 'debug_and_release': if filter_match(file_name, release): return True return False @@ -371,7 +371,7 @@ def copy_qt_artifacts(self, copy_pdbs, _vars): file_path_dir_name = file_full_path.parent # e.g. "Qt6Coredd" maybe_debug_name = f"{file_base_name}d" - if self.debug: + if pyside_build.debug: _filter = debug def predicate(path): @@ -396,7 +396,7 @@ def copy_qt_artifacts(self, copy_pdbs, _vars): recursive=False, _vars=_vars) if copy_plugins: - is_pypy = "pypy" in self.build_classifiers + is_pypy = "pypy" in pyside_build.build_classifiers # <qt>/plugins/* -> <setup>/{st_package_name}/plugins plugins_target = "{st_build_dir}/{st_package_name}/plugins" plugin_dll_patterns = ["*{}.dll"] @@ -446,14 +446,14 @@ def copy_qt_artifacts(self, copy_pdbs, _vars): recursive=True, _vars=_vars) - if self.is_webengine_built(built_modules): + if pyside_build.is_webengine_built(built_modules): copydir("{qt_data_dir}/resources", "{st_build_dir}/{st_package_name}/resources", _filter=None, recursive=False, _vars=_vars) - _ext = "d" if self.debug else "" + _ext = "d" if pyside_build.debug else "" _filter = [f"QtWebEngineProcess{_ext}.exe"] copydir("{qt_bin_dir}", "{st_build_dir}/{st_package_name}", @@ -467,4 +467,4 @@ def copy_qt_artifacts(self, copy_pdbs, _vars): _vars=_vars) if copy_clang: - self.prepare_standalone_clang(is_win=True) + pyside_build.prepare_standalone_clang(is_win=True) |
