diff options
Diffstat (limited to 'sources/pyside-tools/deploy_lib/android')
3 files changed, 21 insertions, 2 deletions
diff --git a/sources/pyside-tools/deploy_lib/android/android_helper.py b/sources/pyside-tools/deploy_lib/android/android_helper.py index 514ac8b5d..3e74a7e79 100644 --- a/sources/pyside-tools/deploy_lib/android/android_helper.py +++ b/sources/pyside-tools/deploy_lib/android/android_helper.py @@ -5,7 +5,7 @@ import logging import zipfile from zipfile import ZipFile from dataclasses import dataclass -from typing import Set +from typing import Set, List from pathlib import Path from jinja2 import Environment, FileSystemLoader @@ -24,7 +24,8 @@ class AndroidData: sdk_path: Path -def create_recipe(version: str, component: str, wheel_path: str, generated_files_path: Path): +def create_recipe(version: str, component: str, wheel_path: str, generated_files_path: Path, + qt_modules: List[str] = None): ''' Create python_for_android recipe for PySide6 and shiboken6 ''' @@ -34,6 +35,7 @@ def create_recipe(version: str, component: str, wheel_path: str, generated_files content = template.render( version=version, wheel_path=wheel_path, + qt_modules=qt_modules ) recipe_path = generated_files_path / "recipes" / f"{component}" diff --git a/sources/pyside-tools/deploy_lib/android/recipes/PySide6/__init__.tmpl.py b/sources/pyside-tools/deploy_lib/android/recipes/PySide6/__init__.tmpl.py index 289f2d62b..76d79710e 100644 --- a/sources/pyside-tools/deploy_lib/android/recipes/PySide6/__init__.tmpl.py +++ b/sources/pyside-tools/deploy_lib/android/recipes/PySide6/__init__.tmpl.py @@ -26,6 +26,17 @@ class PySideRecipe(PythonRecipe): lib_dir = Path(f"{self.ctx.get_python_install_dir(arch.arch)}/PySide6/Qt/lib") info("Copying Qt libraries to be loaded on startup") shutil.copytree(lib_dir, self.ctx.get_libs_dir(arch.arch), dirs_exist_ok=True) + shutil.copyfile(lib_dir.parent.parent / "libpyside6.abi3.so", + Path(self.ctx.get_libs_dir(arch.arch)) / "libpyside6.abi3.so") + + {%- for module in qt_modules %} + shutil.copyfile(lib_dir.parent.parent / f"Qt{{ module }}.abi3.so", + Path(self.ctx.get_libs_dir(arch.arch)) / f"Qt{{ module }}.abi3.so") + {% if module == "Qml" -%} + shutil.copyfile(lib_dir.parent.parent / "libpyside6qml.abi3.so", + Path(self.ctx.get_libs_dir(arch.arch)) / "libpyside6qml.abi3.so") + {% endif %} + {%- endfor -%} info("Copying libc++_shared.so from SDK to be loaded on startup") libcpp_path = f"{self.ctx.ndk.sysroot_lib_dir}/{arch.command_prefix}/libc++_shared.so" diff --git a/sources/pyside-tools/deploy_lib/android/recipes/shiboken6/__init__.tmpl.py b/sources/pyside-tools/deploy_lib/android/recipes/shiboken6/__init__.tmpl.py index afe094cbd..c1cc14967 100644 --- a/sources/pyside-tools/deploy_lib/android/recipes/shiboken6/__init__.tmpl.py +++ b/sources/pyside-tools/deploy_lib/android/recipes/shiboken6/__init__.tmpl.py @@ -4,6 +4,8 @@ from pythonforandroid.recipe import PythonRecipe from pythonforandroid.logger import info import zipfile +import shutil +from pathlib import Path class ShibokenRecipe(PythonRecipe): @@ -20,5 +22,9 @@ class ShibokenRecipe(PythonRecipe): info('Unzip wheels and copy into {}'.format(self.ctx.get_python_install_dir(arch.arch))) zip_ref.extractall(self.ctx.get_python_install_dir(arch.arch)) + lib_dir = Path(f"{self.ctx.get_python_install_dir(arch.arch)}/shiboken6") + shutil.copyfile(lib_dir / "libshiboken6.abi3.so", + Path(self.ctx.get_libs_dir(arch.arch)) / "libshiboken6.abi3.so") + recipe = ShibokenRecipe() |
