8000 Merge pull request #1281 from AndreMiras/feature/ticket1263_setup_tes… · crylearner/python-for-android@f71d8d7 · GitHub
[go: up one dir, main page]

Skip to content

Commit f71d8d7

Browse files
authored
Merge pull request kivy#1281 from AndreMiras/feature/ticket1263_setup_testapp_python3
Feature/ticket1263 setup testapp python3
2 parents f47e35e + d013a86 commit f71d8d7

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ env:
1515
# overrides requirements to skip `peewee` pure python module, see:
1616
# https://github.com/kivy/python-for-android/issues/1263#issuecomment-390421054
1717
- COMMAND='. venv/bin/activate && cd testapps/ && python setup_testapp_python2_sqlite_openssl.py apk --sdk-dir /opt/android/android-sdk --ndk-dir /opt/android/android-ndk --requirements sdl2,pyjnius,kivy,python2,openssl,requests,sqlite3'
18+
- COMMAND='. venv/bin/activate && cd testapps/ && python setup_testapp_python3.py apk --sdk-dir /opt/android/android-sdk --ndk-dir /opt/android/crystax-ndk'
1819

1920
script:
2021
- docker run p4a /bin/sh -c "$COMMAND"

Dockerfile

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,27 @@ FROM ubuntu:16.04
1616

1717
# get the latest version from https://developer.android.com/ndk/downloads/index.html
1818
ENV ANDROID_NDK_VERSION="16b"
19+
# get the latest version from https://www.crystax.net/en/download
20+
ENV CRYSTAX_NDK_VERSION="10.3.2"
1921
# get the latest version from https://developer.android.com/studio/index.html
2022
ENV ANDROID_SDK_TOOLS_VERSION="3859397"
2123

2224
ENV ANDROID_HOME="/opt/android"
2325
ENV ANDROID_NDK_HOME="${ANDROID_HOME}/android-ndk" \
26+
CRYSTAX_NDK_HOME="${ANDROID_HOME}/crystax-ndk" \
2427
ANDROID_SDK_HOME="${ANDROID_HOME}/android-sdk"
25-
ENV ANDROID_NDK_HOME_V="${ANDROID_NDK_HOME}-r${ANDROID_NDK_VERSION}"
28+
ENV ANDROID_NDK_HOME_V="${ANDROID_NDK_HOME}-r${ANDROID_NDK_VERSION}" \
29+
CRYSTAX_NDK_HOME_V="${CRYSTAX_NDK_HOME}-${CRYSTAX_NDK_VERSION}"
2630
ENV ANDROID_NDK_ARCHIVE="android-ndk-r${ANDROID_NDK_VERSION}-linux-x86_64.zip" \
31+
CRYSTAX_NDK_ARCHIVE="crystax-ndk-${CRYSTAX_NDK_VERSION}-linux-x86.tar.xz" \
2732
ANDROID_SDK_TOOLS_ARCHIVE="sdk-tools-linux-${ANDROID_SDK_TOOLS_VERSION}.zip"
2833
ENV ANDROID_NDK_DL_URL="https://dl.google.com/android/repository/${ANDROID_NDK_ARCHIVE}" \
34+
CRYSTAX_NDK_DL_URL="https://eu.crystax.net/download/${CRYSTAX_NDK_ARCHIVE}" \
2935
ANDROID_SDK_TOOLS_DL_URL="https://dl.google.com/android/repository/${ANDROID_SDK_TOOLS_ARCHIVE}"
3036

3137
# install system dependencies
3238
RUN apt update -qq && apt install -qq --yes --no-install-recommends \
33-
python virtualenv python-pip wget curl lbzip2 patch
39+
python virtualenv python-pip wget curl lbzip2 patch bsdtar
3440

3541
# build dependencies
3642
# https://buildozer.readthedocs.io/en/latest/installation.html#android-on-ubuntu-16-04-64bit
@@ -41,13 +47,27 @@ RUN dpkg --add-architecture i386 && apt update -qq && apt install -qq --yes --n
4147
RUN pip install --quiet --upgrade cython==0.21
4248

4349
# download and install Android NDK
44-
RUN curl --progress-bar "${ANDROID_NDK_DL_URL}" --output "${ANDROID_NDK_ARCHIVE}" && \
50+
RUN curl --location --progress-bar "${ANDROID_NDK_DL_URL}" --output "${ANDROID_NDK_ARCHIVE}" && \
4551
mkdir --parents "${ANDROID_NDK_HOME_V}" && \
4652
unzip -q "${ANDROID_NDK_ARCHIVE}" -d "${ANDROID_HOME}" && \
4753
ln -sfn "${ANDROID_NDK_HOME_V}" "${ANDROID_NDK_HOME}"
4854

55+
# download and install CrystaX NDK
56+
# added `gnutls_handshake` flag to workaround random `gnutls_handshake()` issues
57+
RUN curl --location --progress-bar "${CRYSTAX_NDK_DL_URL}" --output "${CRYSTAX_NDK_ARCHIVE}" --insecure && \
58+
bsdtar -xf "${CRYSTAX_NDK_ARCHIVE}" --directory "${ANDROID_HOME}" \
59+
--exclude=crystax-ndk-${CRYSTAX_NDK_VERSION}/docs \
60+
--exclude=crystax-ndk-${CRYSTAX_NDK_VERSION}/samples \
61+
--exclude=crystax-ndk-${CRYSTAX_NDK_VERSION}/tests \
62+
--exclude=crystax-ndk-${CRYSTAX_NDK_VERSION}/toolchains/renderscript \
63+
--exclude=crystax-ndk-${CRYSTAX_NDK_VERSION}/toolchains/x86_64-* \
64+
--exclude=crystax-ndk-${CRYSTAX_NDK_VERSION}/toolchains/llvm-* \
65+
--exclude=crystax-ndk-${CRYSTAX_NDK_VERSION}/toolchains/aarch64-* \
66+
--exclude=crystax-nd 63D4 k-${CRYSTAX_NDK_VERSION}/toolchains/mips64el-* && \
67+
ln -sfn "${CRYSTAX_NDK_HOME_V}" "${CRYSTAX_NDK_HOME}"
68+
4969
# download and install Android SDK
50-
RUN curl --progress-bar "${ANDROID_SDK_TOOLS_DL_URL}" --output "${ANDROID_SDK_TOOLS_ARCHIVE}" && \
70+
RUN curl --location --progress-bar "${ANDROID_SDK_TOOLS_DL_URL}" --output "${ANDROID_SDK_TOOLS_ARCHIVE}" && \
5171
mkdir --parents "${ANDROID_SDK_HOME}" && \
5272
unzip -q "${ANDROID_SDK_TOOLS_ARCHIVE}" -d "${ANDROID_SDK_HOME}"
5373

0 commit comments

Comments
 (0)
0