Skip to content

Commit 09c624b

Browse files
committed
Revert "Release 2019.10.06 (#1998)"
This reverts commit b1f6064.
1 parent 52abfe9 commit 09c624b

File tree

119 files changed

+1579
-2753
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+1579
-2753
lines changed

.travis.yml

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ before_install:
1616
- git remote set-branches --add origin develop
1717
- git fetch
1818

19+
env:
20+
global:
21+
- ANDROID_SDK_HOME=/opt/android/android-sdk
22+
- ANDROID_NDK_HOME=/opt/android/android-ndk
23+
1924
jobs:
2025
include:
2126
- &linting
@@ -60,41 +65,19 @@ jobs:
6065
# case that the travis log doesn't produce any output for more than 10 minutes
6166
- while sleep 540; do echo "==== Still running (travis, don't kill me) ===="; done &
6267
script:
63-
- >
64-
docker run
65-
-e CI
66-
-e TRAVIS_JOB_ID
67-
-e TRAVIS_BRANCH
68-
-e ANDROID_SDK_HOME="/home/user/.android/android-sdk"
69-
-e ANDROID_NDK_HOME="/home/user/.android/android-ndk"
70-
p4a /bin/sh -c "$COMMAND"
68+
- docker run -e CI -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" -e TRAVIS_BRANCH="$TRAVIS_BRANCH" p4a /bin/sh -c "$COMMAND"
7169
after_script:
7270
# kill the background process started before run docker
7371
- kill %1
74-
name: Python 3 arm64-v8a
72+
name: Python 3 armeabi-v7a
7573
# overrides requirements to skip `peewee` pure python module, see:
7674
# https://github.com/kivy/python-for-android/issues/1263#issuecomment-390421054
77-
env:
78-
COMMAND='. venv/bin/activate && cd testapps/ && python setup_testapp_python3_sqlite_openssl.py apk --sdk-dir $ANDROID_SDK_HOME --ndk-dir $ANDROID_NDK_HOME --requirements libffi,sdl2,pyjnius,kivy,python3,openssl,requests,sqlite3,setuptools --arch=arm64-v8a'
75+
env: COMMAND='. venv/bin/activate && cd testapps/ && python setup_testapp_python3_sqlite_openssl.py apk --sdk-dir $ANDROID_SDK_HOME --ndk-dir $ANDROID_NDK_HOME --requirements libffi,sdl2,pyjnius,kivy,python3,openssl,requests,sqlite3,setuptools' --arch=armeabi-v7a
7976
- <<: *testing
80-
name: Python 3 armeabi-v7a
81-
os: osx
82-
osx_image: xcode11 # since xcode1.3, python3 is the default interpreter
83-
before_script:
84-
# installs java 1.8, android's SDK/NDK and p4a
85-
- make -f ci/makefiles/osx.mk
86-
- export JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
87-
# Run a background process (like we do with linux tests)
88-
- while sleep 540; do echo "==== Still running (travis, don't kill me) ===="; done &
89-
script:
90-
- >
91-
cd testapps && python3 setup_testapp_python3_sqlite_openssl.py apk
92-
--sdk-dir $HOME/.android/android-sdk
93-
--ndk-dir $HOME/.android/android-ndk
94-
--requirements libffi,sdl2,pyjnius,kivy,python3,openssl,requests,sqlite3,setuptools
95-
--arch=armeabi-v7a
77+
name: Python 3 arm64-v8a
78+
env: COMMAND='. venv/bin/activate && cd testapps/ && python setup_testapp_python3_sqlite_openssl.py apk --sdk-dir $ANDROID_SDK_HOME --ndk-dir $ANDROID_NDK_HOME --requirements libffi,sdl2,pyjnius,kivy,python3,openssl,requests,sqlite3,setuptools' --arch=arm64-v8a
9679
- <<: *testing
97-
name: Python 2 armeabi-v7a (with numpy)
80+
name: Python 2 basic
9881
env: COMMAND='. venv/bin/activate && cd testapps/ && python setup_testapp_python2_sqlite_openssl.py apk --sdk-dir $ANDROID_SDK_HOME --ndk-dir $ANDROID_NDK_HOME --requirements sdl2,pyjnius,kivy,python2,openssl,requests,sqlite3,setuptools,numpy'
9982
- <<: *testing
10083
name: Rebuild updated recipes

Dockerfile.py2

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,64 @@ ENV RETRY="retry -t 3 --"
3737
RUN curl https://raw.githubusercontent.com/kadwanev/retry/1.0.1/retry \
3838
--output /usr/local/bin/retry && chmod +x /usr/local/bin/retry
3939

40+
ENV ANDROID_NDK_HOME="${ANDROID_HOME}/android-ndk"
41+
ENV ANDROID_NDK_VERSION="17c"
42+
ENV ANDROID_NDK_HOME_V="${ANDROID_NDK_HOME}-r${ANDROID_NDK_VERSION}"
43+
44+
# get the latest version from https://developer.android.com/ndk/downloads/index.html
45+
ENV ANDROID_NDK_ARCHIVE="android-ndk-r${ANDROID_NDK_VERSION}-linux-x86_64.zip"
46+
ENV ANDROID_NDK_DL_URL="https://dl.google.com/android/repository/${ANDROID_NDK_ARCHIVE}"
47+
48+
# download and install Android NDK
49+
RUN ${RETRY} curl --location --progress-bar --insecure \
50+
"${ANDROID_NDK_DL_URL}" \
51+
--output "${ANDROID_NDK_ARCHIVE}" \
52+
&& mkdir --parents "${ANDROID_NDK_HOME_V}" \
53+
&& unzip -q "${ANDROID_NDK_ARCHIVE}" -d "${ANDROID_HOME}" \
54+
&& ln -sfn "${ANDROID_NDK_HOME_V}" "${ANDROID_NDK_HOME}" \
55+
&& rm -rf "${ANDROID_NDK_ARCHIVE}"
56+
57+
58+
ENV ANDROID_SDK_HOME="${ANDROID_HOME}/android-sdk"
59+
60+
# get the latest version from https://developer.android.com/studio/index.html
61+
ENV ANDROID_SDK_TOOLS_VERSION="4333796"
62+
ENV ANDROID_SDK_BUILD_TOOLS_VERSION="28.0.2"
63+
ENV ANDROID_SDK_TOOLS_ARCHIVE="sdk-tools-linux-${ANDROID_SDK_TOOLS_VERSION}.zip"
64+
ENV ANDROID_SDK_TOOLS_DL_URL="https://dl.google.com/android/repository/${ANDROID_SDK_TOOLS_ARCHIVE}"
65+
66+
# download and install Android SDK
67+
RUN ${RETRY} curl --location --progress-bar --insecure \
68+
"${ANDROID_SDK_TOOLS_DL_URL}" \
69+
--output "${ANDROID_SDK_TOOLS_ARCHIVE}" \
70+
&& mkdir --parents "${ANDROID_SDK_HOME}" \
71+
&& unzip -q "${ANDROID_SDK_TOOLS_ARCHIVE}" -d "${ANDROID_SDK_HOME}" \
72+
&& rm -rf "${ANDROID_SDK_TOOLS_ARCHIVE}"
73+
74+
# update Android SDK, install Android API, Build Tools...
75+
RUN mkdir --parents "${ANDROID_SDK_HOME}/.android/" \
76+
&& echo '### User Sources for Android SDK Manager' \
77+
> "${ANDROID_SDK_HOME}/.android/repositories.cfg"
78+
79+
# Download and accept Android licenses (JDK necessary!)
80+
RUN ${RETRY} apt -y install -qq --no-install-recommends openjdk-8-jdk \
81+
&& apt -y autoremove
82+
RUN yes | "${ANDROID_SDK_HOME}/tools/bin/sdkmanager" "build-tools;${ANDROID_SDK_BUILD_TOOLS_VERSION}" > /dev/null
83+
RUN yes | "${ANDROID_SDK_HOME}/tools/bin/sdkmanager" "platforms;android-27" > /dev/null
84+
85+
# Set avdmanager permissions (executable)
86+
RUN chmod +x "${ANDROID_SDK_HOME}/tools/bin/avdmanager"
87+
88+
4089
ENV USER="user"
4190
ENV HOME_DIR="/home/${USER}"
42-
ENV ANDROID_HOME="${HOME_DIR}/.android"
4391
ENV WORK_DIR="${HOME_DIR}" \
4492
PATH="${HOME_DIR}/.local/bin:${PATH}"
4593

4694
# install system dependencies
4795
RUN ${RETRY} apt -y install -qq --no-install-recommends \
4896
python virtualenv python-pip wget lbzip2 patch sudo \
49-
&& apt -y autoremove \
50-
&& apt -y clean
97+
&& apt -y autoremove
5198

5299
# build dependencies
53100
# https://buildozer.readthedocs.io/en/latest/installation.html#android-on-ubuntu-16-04-64bit
@@ -66,10 +113,6 @@ RUN ${RETRY} apt -y install -qq --no-install-recommends \
66113
&& apt -y autoremove \
67114
&& apt -y clean
68115

69-
# Install Java, set JAVA_HOME (to accept android's SDK licenses) and clean
70-
RUN ${RETRY} apt -y install -qq --no-install-recommends openjdk-8-jdk \
71-
&& apt -y autoremove && apt -y clean
72-
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
73116

74117
# prepare non root env
75118
RUN useradd --create-home --shell /bin/bash ${USER}
@@ -81,12 +124,9 @@ RUN echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
81124

82125
WORKDIR ${WORK_DIR}
83126
COPY --chown=user:user . ${WORK_DIR}
84-
RUN mkdir ${ANDROID_HOME} && chown --recursive ${USER} ${ANDROID_HOME}
127+
RUN chown --recursive ${USER} ${ANDROID_SDK_HOME}
85128
USER ${USER}
86129

87-
# Download and install android's NDK/SDK
88-
RUN make -f ci/makefiles/android.mk target_os=linux
89-
90130
# install python-for-android from current branch
91131
RUN virtualenv --python=python venv \
92132
&& . venv/bin/activate \

Dockerfile.py3

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
FROM ubuntu:18.04
1919

20+
ENV ANDROID_HOME="/opt/android"
21+
2022
# configure locale
2123
RUN apt update -qq > /dev/null && apt install -qq --yes --no-install-recommends \
2224
locales && \
@@ -35,9 +37,57 @@ ENV RETRY="retry -t 3 --"
3537
RUN curl https://raw.githubusercontent.com/kadwanev/retry/1.0.1/retry \
3638
--output /usr/local/bin/retry && chmod +x /usr/local/bin/retry
3739

40+
ENV ANDROID_NDK_HOME="${ANDROID_HOME}/android-ndk"
41+
ENV ANDROID_NDK_VERSION="17c"
42+
ENV ANDROID_NDK_HOME_V="${ANDROID_NDK_HOME}-r${ANDROID_NDK_VERSION}"
43+
44+
# get the latest version from https://developer.android.com/ndk/downloads/index.html
45+
ENV ANDROID_NDK_ARCHIVE="android-ndk-r${ANDROID_NDK_VERSION}-linux-x86_64.zip"
46+
ENV ANDROID_NDK_DL_URL="https://dl.google.com/android/repository/${ANDROID_NDK_ARCHIVE}"
47+
48+
# download and install Android NDK
49+
RUN ${RETRY} curl --location --progress-bar --insecure \
50+
"${ANDROID_NDK_DL_URL}" \
51+
--output "${ANDROID_NDK_ARCHIVE}" \
52+
&& mkdir --parents "${ANDROID_NDK_HOME_V}" \
53+
&& unzip -q "${ANDROID_NDK_ARCHIVE}" -d "${ANDROID_HOME}" \
54+
&& ln -sfn "${ANDROID_NDK_HOME_V}" "${ANDROID_NDK_HOME}" \
55+
&& rm -rf "${ANDROID_NDK_ARCHIVE}"
56+
57+
58+
ENV ANDROID_SDK_HOME="${ANDROID_HOME}/android-sdk"
59+
60+
# get the latest version from https://developer.android.com/studio/index.html
61+
ENV ANDROID_SDK_TOOLS_VERSION="4333796"
62+
ENV ANDROID_SDK_BUILD_TOOLS_VERSION="28.0.2"
63+
ENV ANDROID_SDK_TOOLS_ARCHIVE="sdk-tools-linux-${ANDROID_SDK_TOOLS_VERSION}.zip"
64+
ENV ANDROID_SDK_TOOLS_DL_URL="https://dl.google.com/android/repository/${ANDROID_SDK_TOOLS_ARCHIVE}"
65+
66+
# download and install Android SDK
67+
RUN ${RETRY} curl --location --progress-bar --insecure \
68+
"${ANDROID_SDK_TOOLS_DL_URL}" \
69+
--output "${ANDROID_SDK_TOOLS_ARCHIVE}" \
70+
&& mkdir --parents "${ANDROID_SDK_HOME}" \
71+
&& unzip -q "${ANDROID_SDK_TOOLS_ARCHIVE}" -d "${ANDROID_SDK_HOME}" \
72+
&& rm -rf "${ANDROID_SDK_TOOLS_ARCHIVE}"
73+
74+
# update Android SDK, install Android API, Build Tools...
75+
RUN mkdir --parents "${ANDROID_SDK_HOME}/.android/" \
76+
&& echo '### User Sources for Android SDK Manager' \
77+
> "${ANDROID_SDK_HOME}/.android/repositories.cfg"
78+
79+
# Download and accept Android licenses (JDK necessary!)
80+
RUN ${RETRY} apt -y install -qq --no-install-recommends openjdk-8-jdk \
81+
&& apt -y autoremove
82+
RUN yes | "${ANDROID_SDK_HOME}/tools/bin/sdkmanager" "build-tools;${ANDROID_SDK_BUILD_TOOLS_VERSION}" > /dev/null
83+
RUN yes | "${ANDROID_SDK_HOME}/tools/bin/sdkmanager" "platforms;android-27" > /dev/null
84+
85+
# Set avdmanager permissions (executable)
86+
RUN chmod +x "${ANDROID_SDK_HOME}/tools/bin/avdmanager"
87+
88+
3889
ENV USER="user"
3990
ENV HOME_DIR="/home/${USER}"
40-
ENV ANDROID_HOME="${HOME_DIR}/.android"
4191
ENV WORK_DIR="${HOME_DIR}" \
4292
PATH="${HOME_DIR}/.local/bin:${PATH}"
4393

@@ -64,10 +114,6 @@ RUN ${RETRY} apt -y install -qq --no-install-recommends \
64114
&& apt -y autoremove \
65115
&& apt -y clean
66116

67-
# Install Java and set JAVA_HOME (to accept android's SDK licenses)
68-
RUN ${RETRY} apt -y install -qq --no-install-recommends openjdk-8-jdk \
69-
&& apt -y autoremove && apt -y clean
70-
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
71117

72118
# prepare non root env
73119
RUN useradd --create-home --shell /bin/bash ${USER}
@@ -81,12 +127,9 @@ RUN pip2 install --upgrade Cython==0.28.6
81127

82128
WORKDIR ${WORK_DIR}
83129
COPY --chown=user:user . ${WORK_DIR}
84-
RUN mkdir ${ANDROID_HOME} && chown --recursive ${USER} ${ANDROID_HOME}
130+
RUN chown --recursive ${USER} ${ANDROID_SDK_HOME}
85131
USER ${USER}
86132

87-
# Download and install android's NDK/SDK
88-
RUN make -f ci/makefiles/android.mk target_os=linux
89-
90133
# install python-for-android from current branch
91134
RUN virtualenv --python=python3 venv \
92135
&& . venv/bin/activate \

README.md

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -92,33 +92,29 @@ Please refer to the LICENSE file.
9292

9393
## History
9494

95-
In 2015 these tools were rewritten to provide a new, easier-to-use and
96-
easier-to-extend interface. If you'd like to browse the old toolchain, its
95+
In 2015 these tools were rewritten to provide a new, easier to use and
96+
extend interface. If you'd like to browse the old toolchain, its
9797
status is recorded for posterity at at
9898
https://github.com/kivy/python-for-android/tree/old_toolchain.
9999

100-
In the last quarter of 2018 the python recipes were changed. The
101-
new recipe for python3 (3.7.1) had a new build system which was
100+
In the last quarter of 2018 the python recipes has been changed, the
101+
new recipe for python3 (3.7.1) has a new build system which has been
102102
applied to the ancient python recipe, allowing us to bump the python2
103-
version number to 2.7.15. This change unified the build process for
104-
both python recipes, and probably solved various issues detected over the
105-
years. It should also be mentioned that these **unified python recipes**
106-
require a **minimum target api level of 21**,
107-
*Android 5.0 - Lollipop*, so in the case that you need to build targeting an
108-
api level below 21, you should use an older version of python-for-android
109-
(<=0.7.1).
110-
111-
Be aware that this project is in constant development so, as per time of writing,
112-
you should use a minimum on Android's NDK r19, and ``we recommend using NDK r19b``.
113-
This is because the toolchains installed by
114-
default with the NDK can be used *in-place* and the python-for-android project
115-
has been adapted for that feature. Also be aware that more recent versions of the
116-
Android's NDK may not work.
103+
version number to 2.7.15. This change, unifies the build process for
104+
both python recipes, and probably solve some issues detected over the
105+
years. Also should be mentioned that this **unified python recipes**
106+
require to target to a **minimum api level of 21**,
107+
*Android 5.0 - Lollipop*, so in case the you need to build targeting an
108+
api level below 21, you must use an old version of python-for-android
109+
(<=0.7.1). All this work has been done using android ndk version r17c,
110+
and your build should success with that version...but be aware that the
111+
project is in constant development so...the ndk version will change at
112+
some time.
117113

118114
Those mentioned changes has been done this way to make easier the transition
119115
between python3 and python2. We will slowly phase out python2 support
120116
towards 2020...so...if you are using python2 in your projects you should
121-
consider migrating it into python3.
117+
consider to migrate it into python3.
122118

123119
## Contributors
124120

ci/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@ class TargetPython(Enum):
6565
# IndexError: list index out of range
6666
'secp256k1',
6767
'ffpyplayer',
68+
'icu',
6869
# requires `libpq-dev` system dependency e.g. for `pg_config` binary
6970
'psycopg2',
71+
'protobuf_cpp',
7072
# most likely some setup in the Docker container, because it works in host
7173
'pyjnius', 'pyopenal',
7274
# SyntaxError: invalid syntax (Python2)

ci/makefiles/android.mk

Lines changed: 0 additions & 68 deletions
This file was deleted.

ci/makefiles/osx.mk

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)