aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside-tools/deploy_lib/android/recipes/PySide6
diff options
context:
space:
mode:
authorShyamnath Premnadh <Shyamnath.Premnadh@qt.io>2023-09-01 16:13:35 +0200
committerShyamnath Premnadh <Shyamnath.Premnadh@qt.io>2023-09-08 19:17:25 +0200
commit7f4245a4cf3cdad151f0f6677fe92cbef3bb9be5 (patch)
tree963f432bdd2dd828f3ac532f311ab6b5f692fcad /sources/pyside-tools/deploy_lib/android/recipes/PySide6
parentb6abfbedef444ab15f5340c5edfef7acfa06dc7f (diff)
Android Deployment: Load required PySide6 modules on startup
- This is required for having callbacks from C++/CPython back to Python. One example of this is when shiboken class="native" methods are called . There are also other cases where we call back to a Python callable through a callback from the wrapper code generated by Shiboken. - The identified Qt modules are loaded by the python-for-android recipe for PySide6. Task-number: PYSIDE-1612 Change-Id: I5881ac2351fc0afb87367b4149f0f668ac1a8d37 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside-tools/deploy_lib/android/recipes/PySide6')
-rw-r--r--sources/pyside-tools/deploy_lib/android/recipes/PySide6/__init__.tmpl.py11
1 files changed, 11 insertions, 0 deletions
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"