Skip to content

Commit e9f0e0d

Browse files
committed
allow usage of == to specify version. For example: ./distribute.sh -m "kivy==master"
1 parent 6681363 commit e9f0e0d

File tree

32 files changed

+79
-40
lines changed

32 files changed

+79
-40
lines changed

distribute.sh

Lines changed: 33 additions & 1 deletion
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)"
@@ -358,6 +358,26 @@ function in_array() {
358358
}
359359

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

@@ -374,6 +394,11 @@ function run_source_modules() {
374394
unset needed[0]
375395
needed=( ${needed[@]} )
376396

397+
# split the version if exist
398+
items=( ${module//==/ } )
399+
module=${items[0]}
400+
version=${items[1]}
401+
377402
# check if the module have already been declared
378403
in_array $module "${processed[@]}"
379404
if [ $? -ne 255 ]; then
@@ -393,6 +418,13 @@ function run_source_modules() {
393418
fi
394419
source $RECIPES_PATH/$module/recipe.sh
395420

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

recipes/libxml2/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_libxml2=2.7.8
3+
VERSION_libxml2=${VERSION_libxml2:-2.7.8}
44
URL_libxml2=ftp://xmlsoft.org/libxml2/libxml2-$VERSION_libxml2.tar.gz
55
DEPS_libxml2=()
66
MD5_libxml2=8127a65e8c3b08856093099b52599c86

recipes/libxslt/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_libxslt=1.1.27
3+
VERSION_libxslt=${VERSION_libxslt:-1.1.27}
44
URL_libxslt=ftp://xmlsoft.org/libxml2/libxslt-$VERSION_libxslt.tar.gz
55
DEPS_libxslt=(libxml2)
66
MD5_libxslt=

recipes/lxml/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_lxml=2.3.6
3+
VERSION_lxml=${VERSION_lxml:-2.3.6}
44
URL_lxml=http://pypi.python.org/packages/source/l/lxml/lxml-$VERSION_lxml.tar.gz
55
DEPS_lxml=(libxml2 libxslt python)
66
MD5_lxml=d5d886088e78b1bdbfd66d328fc2d0bc

recipes/msgpack/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_msgpack=0.3.0
3+
VERSION_msgpack=${VERSION_msgpack:-0.3.0}
44
URL_msgpack=https://pypi.python.org/packages/source/m/msgpack-python/msgpack-python-$VERSION_msgpack.tar.gz
55
DEPS_msgpack=(python setuptools)
66
MD5_msgpack=10dec96c90992b0f6e38bdf0cc5a8e79

recipes/mysql_connector/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_mysql_connector=1.0.8
3+
VERSION_mysql_connector=${VERSION_mysql_connector:-1.0.8}
44
URL_mysql_connector=http://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-$VERSION_mysql_connector.tar.gz
55
DEPS_mysql_connector=(python)
66
MD5_mysql_connector=1f2dd335c72684d51ee5d34f127d7ca9

recipes/numpy/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_numpy=1.7.1
3+
VERSION_numpy=${VERSION_numpy:-1.7.1}
44
URL_numpy=http://pypi.python.org/packages/source/n/numpy/numpy-$VERSION_numpy.tar.gz
55
DEPS_numpy=(python)
66
MD5_numpy=0ab72b3b83528a7ae79c6df9042d61c6

recipes/openssl/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_openssl=1.0.1c
3+
VERSION_openssl=${VERSION_openssl:-1.0.1c}
44
URL_openssl=http://www.openssl.org/source/openssl-$VERSION_openssl.tar.gz
55
DEPS_openssl=()
66
MD5_openssl=ae412727c8c15b67880aef7bd2999b2e

recipes/paramiko/recipe.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/bash
2-
VERSION_paramiko=1.10.1
2+
3+
VERSION_paramiko=${VERSION_paramiko:-1.10.1}
34
DEPS_paramiko=(pycrypto python)
45
URL_paramiko=http://pypi.python.org/packages/source/p/paramiko/paramiko-$VERSION_paramiko.tar.gz
56
MD5_paramiko=4ba105e2d8535496fd633889396b20b7

recipes/pil/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_pil=1.1.7
3+
VERSION_pil=${VERSION_pil:-1.1.7}
44
URL_pil=http://effbot.org/downloads/Imaging-$VERSION_pil.tar.gz
55
DEPS_pil=(png jpeg python)
66
MD5_pil=fc14a54e1ce02a0225be8854bfba478e

recipes/pyasn1/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_pyasn1=2.5
4-
URL_pyasn1=http://downloads.sourceforge.net/project/pyasn1/pyasn1/0.1.4/pyasn1-0.1.4.tar.gz
3+
VERSION_pyasn1=${VERSION_pyasn1:-0.1.4}
4+
URL_pyasn1=http://downloads.sourceforge.net/project/pyasn1/pyasn1/$VERSION_pyasn1/pyasn1-$VERSION_pyasn1.tar.gz
55
DEPS_pyasn1=(python)
66
MD5_pyasn1=
77
BUILD_pyasn1=$BUILD_PATH/pyasn1/$(get_directory $URL_pyasn1)

recipes/pycrypto/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_pycrypto=2.5
3+
VERSION_pycrypto=${VERSION_pycrypto:-2.5}
44
URL_pycrypto=http://pypi.python.org/packages/source/p/pycrypto/pycrypto-$VERSION_pycrypto.tar.gz
55
DEPS_pycrypto=(openssl python)
66
MD5_pycrypto=783e45d4a1a309e03ab378b00f97b291

recipes/pygame/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_pygame=1.9.1
3+
VERSION_pygame=${VERSION_pygame:-1.9.1}
44
URL_pygame=http://pygame.org/ftp/pygame-$(echo $VERSION_pygame)release.tar.gz
55
DEPS_pygame=(python sdl)
66
MD5_pygame=1c4cdc708d17c8250a2d78ef997222fc

recipes/pyjnius/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_pyjnius=
4-
URL_pyjnius=https://github.com/kivy/pyjnius/zipball/master/pyjnius-master.zip
3+
VERSION_pyjnius=${VERSION_pyjnius:-master}
4+
URL_pyjnius=https://github.com/kivy/pyjnius/zipball/$VERSION_pyjnius/pyjnius-$VERSION_pyjnius.zip
55
DEPS_pyjnius=(python sdl)
66
MD5_pyjnius=
77
BUILD_pyjnius=$BUILD_PATH/pyjnius/$(get_directory $URL_pyjnius)

recipes/pylibpd/recipe.sh

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

3-
VERSION_pylibpd=
3+
VERSION_pylibpd=${VERSION_pylibpd:-master}
44
DEPS_pylibpd=(python)
5-
URL_pylibpd=https://github.com/libpd/libpd/archive/master.zip
5+
URL_pylibpd=https://github.com/libpd/libpd/archive/$VERSION_pylibpd.zip
66
MD5_pylibpd=
77
BUILD_pylibpd=$BUILD_PATH/pylibpd/$(get_directory $URL_pylibpd)
88
RECIPE_pylibpd=$RECIPES_PATH/pylibpd

recipes/pyopenssl/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_pyopenssl=0.13
3+
VERSION_pyopenssl=${VERSION_pyopenssl:-0.13}
44
URL_pyopenssl=http://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-$VERSION_pyopenssl.tar.gz
55
DEPS_pyopenssl=(openssl python)
66
MD5_pyopenssl=767bca18a71178ca353dff9e10941929

recipes/recipe.sh.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
error "not configure" && exit -1
66

77
# version of your package
8-
VERSION_xxx=1.3
8+
VERSION_xxx=${VERSION_xxx:-1.3}
99

1010
# dependencies of this recipe
1111
DEPS_xxx=()

recipes/setuptools/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_setuptools=0.6c11
3+
VERSION_setuptools=${VERSION_setuptools:-0.6c11}
44
URL_setuptools=http://pypi.python.org/packages/source/s/setuptools/setuptools-$VERSION_setuptools.tar.gz
55
DEPS_setuptools=(python)
66
MD5_setuptools=7df2a529a074f613b509fb44feefe74e

recipes/sqlalchemy/recipe.sh

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

3-
VERSION_sqlalchemy=0.8.2
3+
VERSION_sqlalchemy=${VERSION_sqlalchemy:-0.8.2}
44
DEPS_sqlalchemy=(python)
55
URL_sqlalchemy=https://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-${VERSION_sqlalchemy}.tar.gz
66
MD5_sqlalchemy=5a33fb43dea93468dbb2a6562ee80b54
@@ -29,4 +29,4 @@ function build_sqlalchemy() {
2929

3030
function postbuild_sqlalchemy() {
3131
true
32-
}
32+
}

recipes/twisted/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_twisted=11.1
3+
VERSION_twisted=${VERSION_twisted:-11.1}
44
URL_twisted=http://twistedmatrix.com/Releases/Twisted/$VERSION_twisted/Twisted-$VERSION_twisted.0.tar.bz2
55
DEPS_twisted=(zope)
66
MD5_twisted=

recipes/txws/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_txws=0.7
3+
VERSION_txws=${VERSION_txws:-0.7}
44
URL_txws=http://pypi.python.org/packages/source/t/txWS/txWS-$VERSION_txws.tar.gz
55
DEPS_txws=(twisted)
66
MD5_txws=e8f5fb03c189d83b47b21176c7574126

recipes/wokkel/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_wokkel=0.7.0
3+
VERSION_wokkel=${VERSION_wokkel:-0.7.0}
44
URL_wokkel=http://pypi.python.org/packages/source/w/wokkel/wokkel-$VERSION_wokkel.tar.gz
55
DEPS_wokkel=(setuptools twisted)
66
MD5_wokkel=fffc7bf564cf1d7d1ccaa6c5d18d6a76

recipes/zope/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_zope=3.8.0
3+
VERSION_zope=${VERSION_zope:-3.8.0}
44
URL_zope=http://pypi.python.org/packages/source/z/zope.interface/zope.interface-$VERSION_zope.tar.gz
55
DEPS_zope=(python)
66
MD5_zope=8ab837320b4532774c9c89f030d2a389

0 commit comments

Comments
 (0)