Skip to content

Commit cee74cf

Browse files
committed
Merge branch 'master' of ssh://github.com/kivy/python-for-android
2 parents cfda3e6 + 4ebd3b9 commit cee74cf

File tree

34 files changed

+126
-51
lines changed

34 files changed

+126
-51
lines changed

distribute.sh

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#------------------------------------------------------------------------------
88

99
# Modules
10-
MODULES=$MODULES
10+
MODULES=
1111

1212
# Resolve Python path
1313
PYTHON="$(which python2.7)"
@@ -152,15 +152,16 @@ function push_arm() {
152152
PYPLATFORM="linux"
153153
fi
154154

155-
if [ "X$ANDROIDNDKVER" == "Xr5b" ]; then
156-
export TOOLCHAIN_PREFIX=arm-eabi
157-
export TOOLCHAIN_VERSION=4.4.0
158-
else
159-
#if [ "X${ANDROIDNDKVER:0:2}" == "Xr7" ] || [ "X$ANDROIDNDKVER" == "Xr8" ]; then
160-
# assume this toolchain is the same for all the next ndk... until a new one is out.
161-
export TOOLCHAIN_PREFIX=arm-linux-androideabi
162-
export TOOLCHAIN_VERSION=4.4.3
163-
fi
155+
if [ "X$ANDROIDNDKVER" == "Xr5b" ]; then
156+
export TOOLCHAIN_PREFIX=arm-eabi
157+
export TOOLCHAIN_VERSION=4.4.0
158+
elif [ "X${ANDROIDNDKVER:0:2}" == "Xr7" ] || [ "X${ANDROIDNDKVER:0:2}" == "Xr8" ]; then
159+
export TOOLCHAIN_PREFIX=arm-linux-androideabi
160+
export TOOLCHAIN_VERSION=4.4.3
161+
elif [ "X${ANDROIDNDKVER}" == "Xr9" ]; then
162+
export TOOLCHAIN_PREFIX=arm-linux-androideabi
163+
export TOOLCHAIN_VERSION=4.8
164+
fi
164165

165166
export PATH="$ANDROIDNDK/toolchains/$TOOLCHAIN_PREFIX-$TOOLCHAIN_VERSION/prebuilt/$PYPLATFORM-x86/bin/:$ANDROIDNDK/toolchains/$TOOLCHAIN_PREFIX-$TOOLCHAIN_VERSION/prebuilt/$PYPLATFORM-x86_64/bin/:$ANDROIDNDK:$ANDROIDSDK/tools:$PATH"
166167

@@ -358,6 +359,26 @@ function in_array() {
358359
}
359360

360361
function run_source_modules() {
362+
# preprocess version modules
363+
needed=($MODULES)
364+
while [ ${#needed[*]} -ne 0 ]; do
365+
366+
# pop module from the needed list
367+
module=${needed[0]}
368+
unset needed[0]
369+
needed=( ${needed[@]} )
370+
371+
# is a version is specified ?
372+
items=( ${module//==/ } )
373+
module=${items[0]}
374+
version=${items[1]}
375+
if [ ! -z "$version" ]; then
376+
info "Specific version detected for $module: $version"
377+
eval "VERSION_$module=$version"
378+
fi
379+
done
380+
381+
361382
needed=($MODULES)
362383
declare -a processed
363384

@@ -374,6 +395,11 @@ function run_source_modules() {
374395
unset needed[0]
375396
needed=( ${needed[@]} )
376397

398+
# split the version if exist
399+
items=( ${module//==/ } )
400+
module=${items[0]}
401+
version=${items[1]}
402+
377403
# check if the module have already been declared
378404
in_array $module "${processed[@]}"
379405
if [ $? -ne 255 ]; then
@@ -393,6 +419,13 @@ function run_source_modules() {
393419
fi
394420
source $RECIPES_PATH/$module/recipe.sh
395421

422+
# if a version has been specified by the user, the md5 will not
423+
# correspond at all. so deactivate it.
424+
if [ ! -z "$version" ]; then
425+
debug "Deactivate MD5 test for $module, due to specific version"
426+
eval "MD5_$module="
427+
fi
428+
396429
# append current module deps to the needed
397430
deps=$(echo \$"{DEPS_$module[@]}")
398431
eval deps=($deps)

docs/source/usage.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ You can include other modules (or "recipes") to compile using `-m`::
1717
./distribute.sh -m "openssl kivy"
1818
./distribute.sh -m "pil ffmpeg kivy"
1919

20+
You can also specify a specific version for each package. Please note that the
21+
compilation might **break** if you don't use the default version. Most recipes
22+
have patch to fixes android issues, and might not apply if you specify a
23+
version. We also recommand to clean build/ before changing version.::
24+
25+
./distribute.sh -m "openssl kivy==master"
2026

2127
The list of available recipes is available at:
2228
https://github.com/kivy/python-for-android/tree/master/recipes

recipes/audiostream/recipe.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

3-
VERSION_audiostream=
4-
URL_audiostream=https://github.com/kivy/audiostream/zipball/master/audiostream.zip
3+
VERSION_audiostream=${VERSION_audiostream:-master}
4+
URL_audiostream=https://github.com/kivy/audiostream/zipball/$VERSION_audiostream/audiostream.zip
55
DEPS_audiostream=(python sdl pyjnius)
66
MD5_audiostream=
77
BUILD_audiostream=$BUILD_PATH/audiostream/audiostream

recipes/cymunk/recipe.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

3-
VERSION_cymunk=
4-
URL_cymunk=http://github.com/tito/cymunk/zipball/master/cymunk.zip
3+
VERSION_cymunk=${VERSION_cymunk:-master}
4+
URL_cymunk=http://github.com/tito/cymunk/zipball/$VERSION_cymunk/cymunk.zip
55
DEPS_cymunk=(python)
66
MD5_cymunk=
77
BUILD_cymunk=$BUILD_PATH/cymunk/$(get_directory $URL_cymunk)

recipes/docutils/recipe.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

3-
VERSION_docutils=
4-
URL_docutils=http://prdownloads.sourceforge.net/docutils/docutils-0.9.1.tar.gz
3+
VERSION_docutils=${VERSION_docutils:-0.9.1}
4+
URL_docutils=http://prdownloads.sourceforge.net/docutils/docutils-$VERSION_docutils.tar.gz
55
DEPS_docutils=(pil)
66
MD5_docutils=
77
BUILD_docutils=$BUILD_PATH/docutils/$(get_directory $URL_docutils)

recipes/ffmpeg/recipe.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# Recent change made ffmpeg not compatible with python-for-android yet.
33
# Only h264+aac build are working.
44

5-
VERSION_ffmpeg=
6-
URL_ffmpeg=https://github.com/tito/ffmpeg-android/zipball/master/ffmpeg-android.zip
5+
VERSION_ffmpeg=${VERSION_ffmpeg:-master}
6+
URL_ffmpeg=https://github.com/tito/ffmpeg-android/zipball/$VERSION_ffmpeg/ffmpeg-android.zip
77
DEPS_ffmpeg=(python sdl)
88
MD5_ffmpeg=
99
BUILD_ffmpeg=$BUILD_PATH/ffmpeg/ffmpeg-android

recipes/gevent/recipe.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
VERSION_gevent=0.13.8
3+
VERSION_gevent=${VERSION_gevent:-0.13.8}
44
URL_gevent=https://pypi.python.org/packages/source/g/gevent/gevent-$VERSION_gevent.tar.gz
55
DEPS_gevent=(libevent greenlet)
66
MD5_gevent=ca9dcaa7880762d8ebbc266b11252960

recipes/greenlet/recipe.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
VERSION_greenlet=0.4.1
3+
VERSION_greenlet=${VERSION_greenlet:-0.4.1}
44
URL_greenlet=https://pypi.python.org/packages/source/g/greenlet/greenlet-$VERSION_greenlet.zip
55
https://github.com/downloads/greenlet/greenlet/greenlet-$VERSION_greenlet.tar.gz
66
DEPS_greenlet=(python)

recipes/kivy/recipe.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

3-
VERSION_kivy=
4-
URL_kivy=https://github.com/kivy/kivy/zipball/stable/kivy-stable.zip
3+
VERSION_kivy=${VERSION_kivy:-stable}
4+
URL_kivy=https://github.com/kivy/kivy/zipball/$VERSION_kivy/kivy-$VERSION_kivy.zip
55
DEPS_kivy=(pygame pyjnius android)
66
MD5_kivy=
77
BUILD_kivy=$BUILD_PATH/kivy/$(get_directory $URL_kivy)

recipes/libevent/recipe.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
VERSION_libevent=2.0.21-stable
3+
VERSION_libevent=${VERSION_libevent:-2.0.21-stable}
44
URL_libevent=https://github.com/downloads/libevent/libevent/libevent-$VERSION_libevent.tar.gz
55
DEPS_libevent=(python)
66
MD5_libevent=b2405cc9ebf264aa47ff615d9de527a2

0 commit comments

Comments
 (0)