Skip to content

Commit 722cba9

Browse files
committed
Android Wheels: Update Python version to 3.11
- python-for-android target python is now upgrade to 3.11 - kivy/python-for-android#2850. This constrains us to update to 3.11 to resolve linker issues for shiboken and PySide binaries. - The also helps for CI wheel creation since the Python version in our CI system is 3.11. - As a drive-by remove designer plugins from Android wheels. Task-number: PYSIDE-1612 Change-Id: I8c75d4d4567b6830e26a2d9a24db90592f6dc03d Reviewed-by: Adrian Herrmann <[email protected]>
1 parent 0632cab commit 722cba9

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

build_scripts/platforms/linux.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def prepare_standalone_package_linux(pyside_build, _vars, cross_build=False, is_
9595
_filter=["*.so"],
9696
recursive=True,
9797
_vars=_vars)
98-
if not is_pypy:
98+
if not is_pypy and not is_android:
9999
copydir("{install_dir}/plugins/designer",
100100
plugins_target / "designer",
101101
_filter=["*.so"],

sources/shiboken6/cmake/ShibokenHelpers.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ macro(get_python_extension_suffix)
206206
# it is unable to set Python_CONFIG i.e. find `python3-config` script
207207
# This workaround sets the Python_SOABI manually for this platform.
208208
if(CMAKE_SYSTEM_NAME STREQUAL "Android" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a")
209-
set(Python_SOABI "cpython-310}")
209+
set(Python_SOABI "cpython-311}")
210210
endif()
211211
if(NOT Python_SOABI)
212212
message(FATAL_ERROR "Python_SOABI variable is empty.")

tools/cross_compile_android/main.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
download_android_ndk, install_android_packages)
1919

2020
# Note: Does not work with PyEnv. Your Host Python should contain openssl.
21-
PYTHON_VERSION = "3.10"
21+
PYTHON_VERSION = "3.11"
2222

2323
SKIP_UPDATE_HELP = ("skip the updation of SDK packages build-tools, platform-tools to"
2424
" latest version")
@@ -86,7 +86,7 @@ def update(self, op_code, cur_count, max_count=None, message=""):
8686

8787
parser.add_argument("-v", "--verbose", help="run in verbose mode", action="store_const",
8888
dest="loglevel", const=logging.INFO)
89-
parser.add_argument("--api-level", type=str, default="31", help="Android API level to use")
89+
parser.add_argument("--api-level", type=str, default="33", help="Android API level to use")
9090
parser.add_argument("--ndk-path", type=str, help="Path to Android NDK (Preferred r25c)")
9191
# sdk path is needed to compile all the Qt Java Acitivity files into Qt6AndroidBindings.jar
9292
parser.add_argument("--sdk-path", type=str, help="Path to Android SDK")
@@ -221,6 +221,7 @@ def update(self, op_code, cur_count, max_count=None, message=""):
221221
ndk_path=ndk_path,
222222
api_level=platform_data.api_level,
223223
android_py_install_path_prefix=pyside6_deploy_cache,
224+
host_python_path=sys.executable
224225
)
225226

226227
logging.info(f"Writing Python cross compile script into {python_ccompile_script}")
@@ -295,5 +296,5 @@ def update(self, op_code, cur_count, max_count=None, message=""):
295296
f"--python-target-path={python_path}",
296297
(f"--qt-target-path={qt_install_path}/"
297298
f"android_{platform_data.qt_plat_name}"),
298-
"--no-qt-tools", "--unity"]
299+
"--no-qt-tools", "--unity", "--module-subset=Core,Gui,Widgets"]
299300
run_command(qfp_ccompile_cmd, cwd=pyside_setup_dir, dry_run=dry_run, show_stdout=True)

tools/cross_compile_android/templates/cross_compile.tmpl.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ export RANLIB=$TOOLCHAIN/llvm-ranlib
2020
export LD=$TOOLCHAIN/ld
2121
export READELF=$TOOLCHAIN/llvm-readelf
2222
export CFLAGS='-fPIC -DANDROID'
23-
./configure --host=$HOST_ARCH --target=$HOST_ARCH --build=x86_64-pc-linux-gnu --enable-shared \
23+
./configure --host=$HOST_ARCH --target=$HOST_ARCH --build=x86_64-pc-linux-gnu \
24+
--with-build-python={{ host_python_path }} --enable-shared \
2425
--enable-ipv6 ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no --without-ensurepip \
2526
ac_cv_little_endian_double=yes
2627
make BLDSHARED="$CC -shared" CROSS-COMPILE=$TOOL_PREFIX- CROSS_COMPILE_TARGET=yes

0 commit comments

Comments
 (0)