This repository has been archived by the owner on Feb 24, 2023. It is now read-only.
forked from rave-engine/python3-android
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Misc improvements for building scripts
* Switch to a tagged version. Preparation for stable versions (#29) * Switches to official Python docker images * Fixes for cross-distro compatibility (#30) * Update OpenSSL to 1.1.1g
- Loading branch information
Showing
6 changed files
with
39 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env python | ||
#!/usr/bin/env python3 | ||
import os | ||
|
||
from util import ARCHITECTURES, env_vars, parse_args | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,30 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
set -e | ||
set -x | ||
|
||
THIS_DIR="$PWD" | ||
|
||
PYVER=3.9.0a6 | ||
PYVER_SHORT=3.9.0 | ||
SRCDIR=src/Python-$PYVER | ||
|
||
COMMON_ARGS="--arch ${ARCH:-arm} --api ${ANDROID_API:-21}" | ||
|
||
[ -d src/cpython ] || git clone https://github.com/python/cpython src/cpython | ||
if [ ! -d $SRCDIR ]; then | ||
mkdir -p src | ||
pushd src | ||
curl -vLO https://www.python.org/ftp/python/$PYVER_SHORT/Python-$PYVER.tar.xz | ||
tar xf Python-$PYVER.tar.xz | ||
popd | ||
fi | ||
|
||
cp -r Android src/cpython/ | ||
pushd src/cpython | ||
cp -r Android $SRCDIR | ||
pushd $SRCDIR | ||
./Android/build_deps.py $COMMON_ARGS | ||
./Android/configure.py $COMMON_ARGS --prefix=/usr | ||
make | ||
make install DESTDIR="$THIS_DIR/build" | ||
popd | ||
cp -r src/cpython/Android/sysroot/usr/share/terminfo build/usr/share/ | ||
cp -r $SRCDIR/Android/sysroot/usr/share/terminfo build/usr/share/ | ||
cp devscripts/env.sh build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
#!/bin/sh | ||
[ -d src/cpython ] && pushd src/cpython && git clean -dfx && git checkout && popd | ||
rm -rf build | ||
#!/bin/bash | ||
rm -rf src/* build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
FROM archlinux/base | ||
FROM python:3.9.0a6-buster | ||
|
||
# Need to reinitialize pacman keyring; see https://github.com/archlinux/archlinux-docker/issues/18 | ||
RUN echo 'Server = https://mirror.pkgbuild.com/$repo/os/$arch' > /etc/pacman.d/mirrorlist && \ | ||
echo $'[archlinuxcn]\nServer = https://repo.archlinuxcn.org/$arch' >> /etc/pacman.conf && \ | ||
pacman-key --init && pacman-key --populate archlinux && \ | ||
pacman -Syu --noconfirm && \ | ||
pacman -S --noconfirm archlinuxcn-keyring && \ | ||
pacman -S --noconfirm --needed android-ndk autoconf automake cmake gawk gettext git gcc make patch pkgconf python python-git which | ||
ARG NDK_VER=r21b | ||
|
||
RUN apt-get update -y && \ | ||
apt-get install -y autoconf automake cmake gawk gettext git gcc make patch pkg-config | ||
|
||
ADD https://dl.google.com/android/repository/android-ndk-${NDK_VER}-linux-x86_64.zip / | ||
|
||
RUN unzip android-ndk-${NDK_VER}-linux-x86_64.zip | ||
|
||
WORKDIR /python3-android | ||
# Set $ANDROID_NDK manually as /etc/profile.d/*.sh are not sourced by CMD | ||
ENV ANDROID_NDK=/opt/android-ndk | ||
ENV ANDROID_NDK=/android-ndk-${NDK_VER} | ||
|
||
CMD ["bash", "/python3-android/build.sh"] | ||
CMD ["/python3-android/build.sh"] |