Skip to content

Commit 3003083

Browse files
committed
DWE-4580 changes for Python 3.13
updated dependencies and build scripts
1 parent f1a32c5 commit 3003083

File tree

4 files changed

+16
-17
lines changed

4 files changed

+16
-17
lines changed

Android/build_deps.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,26 @@ def make_install(self):
6666
self.run(['install', '-Dm644', 'bzlib.h', '-t', str(SYSROOT / 'usr' / 'include')])
6767

6868
class GDBM(Package):
69-
source = 'https://ftp.gnu.org/gnu/gdbm/gdbm-1.23.tar.gz'
69+
source = 'https://ftp.gnu.org/gnu/gdbm/gdbm-1.24.tar.gz'
7070
configure_args = ['--enable-libgdbm-compat']
7171

7272
class LibFFI(Package):
73-
source = 'https://github.com/libffi/libffi/releases/download/v3.4.4/libffi-3.4.4.tar.gz'
73+
source = 'https://github.com/libffi/libffi/releases/download/v3.4.7/libffi-3.4.7.tar.gz'
7474
# libffi may fail to configure with Docker on WSL2 (#33)
7575
configure_args = ['--disable-builddir']
7676

7777
class LibUUID(Package):
78-
source = 'https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/util-linux-2.39.2.tar.xz'
78+
source = 'https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.40/util-linux-2.40.4.tar.xz'
7979
configure_args = ['--disable-all-programs', '--enable-libuuid']
8080

8181
class NCurses(Package):
82-
source = 'https://ftp.gnu.org/gnu/ncurses/ncurses-6.4.tar.gz'
82+
source = 'https://ftp.gnu.org/gnu/ncurses/ncurses-6.5.tar.gz'
8383
# Not stripping the binaries as there is no easy way to specify the strip program for Android
8484
configure_args = ['--without-ada', '--enable-widec', '--without-debug', '--without-cxx-binding', '--disable-stripping']
8585

8686
class OpenSSL(Package):
87-
source = 'https://www.openssl.org/source/openssl-3.0.12.tar.gz'
87+
# was 3.0.12
88+
source = 'https://www.openssl.org/source/openssl-3.4.0.tar.gz'
8889

8990
def configure(self):
9091
# OpenSSL handles NDK internal paths by itself
@@ -119,7 +120,7 @@ class SQLite(Package):
119120
source = 'https://sqlite.org/2024/sqlite-autoconf-3460000.tar.gz'
120121

121122
class XZ(Package):
122-
source = 'https://tukaani.org/xz/xz-5.6.2.tar.xz'
123+
source = 'https://tukaani.org/xz/xz-5.6.4.tar.xz'
123124

124125
def make(self):
125126
print('******************** About to run make')

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
Python 3 Android
22
================
33

4-
This is an experimental set of build scripts that will cross-compile Python 3.12.4 for an Android device.
4+
This is an experimental set of build scripts that will cross-compile Python 3.13.0 for an Android device.
55

66
Building requires:
77
-----
88

99
1. Linux. This project might work on other systems supported by NDK but no guarantee.
10-
2. Android NDK r26d installed and environment variable ``$ANDROID_NDK`` points to its root directory. Older NDK may not work and NDK <= r18 is known to be incompatible.
11-
<br>An example of how to set the environment variable would be ``export ANDROID_NDK="/home/myuser/android-ndk-r26d-linux" >> $HOME/.bashrc``
10+
2. Android NDK r28 installed and environment variable ``$ANDROID_NDK`` points to its root directory. Older NDK may not work and NDK <= r18 is known to be incompatible.
11+
<br>An example of how to set the environment variable would be ``export ANDROID_NDK="/home/myuser/android-ndk-r30-linux" >> $HOME/.bashrc``
1212

1313
<br>
1414
Running requires:
@@ -24,9 +24,9 @@ Build
2424
1. Run `sudo ./clean.sh` for good measure, and after each build.
2525
2. You will need a separate build run for every API Level/architecture combination you wish to run on:
2626
<br>Here are a couple of examples to build a static version of the library with docker.
27-
* Build 64 bit `sudo docker run --rm -it -v $(pwd):/python3-android -v /mnt/c/SPE/android-ndk-r26d --env ARCH=arm64 --env ANDROID_API=30 python:3.12.4-slim /python3-android/docker-build.sh --enable-shared --without-ensurepip --disable-ipv6 --with-build-python`
28-
* Build 32 bit `sudo docker run --rm -it -v $(pwd):/python3-android -v /mnt/c/SPE/android-ndk-r26d --env ARCH=arm --env ANDROID_API=30 python:3.12.4-slim /python3-android/docker-build.sh --enable-shared --without-ensurepip --disable-ipv6 --with-build-python`
29-
* Build x86_64 `sudo docker run --rm -it -v $(pwd):/python3-android -v /mnt/c/SPE/android-ndk-r26d --env ARCH=x86_64 --env ANDROID_API=30 python:3.12.4-slim /python3-android/docker-build.sh --enable-shared --without-ensurepip --disable-ipv6 --with-build-python`
27+
* Build 64 bit `sudo docker run --rm -it -v $(pwd):/python3-android -v /mnt/c/SPE/android-ndk-r30 --env ARCH=arm64 --env ANDROID_API=30 python:3.13.0-slim /python3-android/docker-build.sh --enable-shared --without-ensurepip --disable-ipv6 --with-build-python`
28+
* Build 32 bit `sudo docker run --rm -it -v $(pwd):/python3-android -v /mnt/c/SPE/android-ndk-r30 --env ARCH=arm --env ANDROID_API=30 python:3.13.0-slim /python3-android/docker-build.sh --enable-shared --without-ensurepip --disable-ipv6 --with-build-python`
29+
* Build x86_64 `sudo docker run --rm -it -v $(pwd):/python3-android -v /mnt/c/SPE/android-ndk-r30 --env ARCH=x86_64 --env ANDROID_API=30 python:3.13.0-slim /python3-android/docker-build.sh --enable-shared --without-ensurepip --disable-ipv6 --with-build-python`
3030

3131

3232
Installation & Running

build.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -x
55

66
THIS_DIR="$PWD"
77

8-
PYVER=3.12.4
8+
PYVER=3.13.0
99
SRCDIR=src/Python-$PYVER
1010

1111
COMMON_ARGS="--arch ${ARCH:-arm} --api ${ANDROID_API:-30}"
@@ -25,9 +25,7 @@ fi
2525

2626
cp -r Android $SRCDIR
2727
pushd $SRCDIR
28-
patch -Np1 -i ./Android/unversioned-libpython.patch
2928
autoreconf -ifv
30-
patch -Np1 -i ./Android/bldlibrary.patch
3129
./Android/build_deps.py $COMMON_ARGS
3230
./Android/configure.py $COMMON_ARGS --prefix=/usr "$@"
3331
make

docker-build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ set -x
66
apt-get update -y
77
apt-get install -y autoconf-archive autoconf automake cmake gawk gettext git gcc make patch pkg-config xz-utils
88

9-
export ANDROID_NDK=/android-ndk
9+
# export ANDROID_NDK=/android-ndk
1010

1111
if [ ! -d "$ANDROID_NDK" ] ; then
1212
# In general we don't want download NDK for every build, but it is simpler to do it here
1313
# for CI builds
14-
NDK_VER=r26d
14+
NDK_VER=r28
1515
apt-get install -y wget zip
1616
wget --no-verbose https://dl.google.com/android/repository/android-ndk-$NDK_VER-linux.zip
1717
unzip android-ndk-${NDK_VER}-linux.zip

0 commit comments

Comments
 (0)