Skip to content

Commit cf0554d

Browse files
committed
Merge branch 'master' of github.com:d3vgru/python-for-android
2 parents 5416cf2 + 4ab3e2c commit cf0554d

3 files changed

Lines changed: 124 additions & 0 deletions

File tree

recipes/libswift/recipe.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
3+
#TODO get a release version if possible
4+
VERSION_libswift=
5+
DEPS_libswift=()
6+
#TODO get a version specific URL and update the md5sum
7+
URL_libswift=https://github.com/whirm/tgs-android/archive/master.zip
8+
MD5_libswift=23ce86e2bd4d213fdcf1d8c5c37a979a
9+
BUILD_libswift=$BUILD_PATH/libswift/$(get_directory $URL_libswift)
10+
RECIPE_libswift=$RECIPES_PATH/libswift
11+
12+
function prebuild_libswift() {
13+
true
14+
}
15+
16+
function build_libswift() {
17+
cd $BUILD_libswift
18+
19+
if [ -d "$BUILD_PATH/libs/libevent.so" ]; then
20+
#return
21+
true
22+
fi
23+
24+
push_arm
25+
26+
#FIXME get it so you don't have to download the jni module manually
27+
export $LDFLAGS=$LIBLINK
28+
try ndk-build -C $BUILD_libswift/jni
29+
unset LDFLAGS
30+
31+
#TODO find out why it's libevent.so and not libswift.so
32+
try cp -a $BUILD_libswift/libs/$ARCH/*.so $LIBS_PATH
33+
34+
pop_arm
35+
}
36+
37+
function postbuild_libswift() {
38+
true
39+
}
40+

recipes/m2crypto/recipe.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
3+
VERSION_m2crypto=0.21.1
4+
DEPS_m2crypto=(openssl hostpython python)
5+
URL_m2crypto=http://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-$VERSION_m2crypto.tar.gz
6+
MD5_m2crypto=f93d8462ff7646397a9f77a2fe602d17
7+
BUILD_m2crypto=$BUILD_PATH/m2crypto/$(get_directory $URL_m2crypto)
8+
RECIPE_m2crypto=$RECIPES_PATH/m2crypto
9+
10+
function prebuild_m2crypto() {
11+
true
12+
}
13+
14+
function build_m2crypto() {
15+
cd $BUILD_m2crypto
16+
17+
if [ -d "$BUILD_PATH/python-install/lib/python2.7/site-packages/m2crypto" ]; then
18+
#return
19+
true
20+
fi
21+
22+
push_arm
23+
24+
# build python extension
25+
export CFLAGS="$CFLAGS -I$BUILD_PATH/python-install/include/python2.7"
26+
export LDSHARED=$LIBLINK
27+
export PYTHONPATH=$BUILD_PATH/python-install/lib/python2.7/site-packages
28+
29+
try $BUILD_hostpython/hostpython setup.py build_ext --openssl=$BUILD_openssl --library-dirs=$BUILD_openssl
30+
31+
unset LDSHARED
32+
33+
try $BUILD_hostpython/hostpython setup.py install -O2 --prefix $BUILD_PATH/python-install
34+
35+
pop_arm
36+
}
37+
38+
function postbuild_m2crypto() {
39+
true
40+
}
41+

recipes/netifaces/recipe.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
3+
VERSION_netifaces=0.8
4+
DEPS_netifaces=(hostpython python setuptools)
5+
URL_netifaces=http://alastairs-place.net/projects/netifaces/netifaces-$VERSION_netifaces.tar.gz
6+
MD5_netifaces=e57e5983f4c286fac5f8068fbfc5c873
7+
BUILD_netifaces=$BUILD_PATH/netifaces/$(get_directory $URL_netifaces)
8+
RECIPE_netifaces=$RECIPES_PATH/netifaces
9+
10+
function prebuild_netifaces() {
11+
true
12+
}
13+
14+
function build_netifaces() {
15+
cd $BUILD_netifaces
16+
17+
#FIXME it actually builds an egg
18+
if [ -d "$BUILD_PATH/python-install/lib/python2.7/site-packages/netifaces" ]; then
19+
#return
20+
true
21+
fi
22+
23+
push_arm
24+
25+
# build python extension
26+
export CFLAGS="$CFLAGS -I$BUILD_PATH/python-install/include/python2.7"
27+
export LDSHARED=$LIBLINK
28+
export PYTHONPATH=$BUILD_PATH/python-install/lib/python2.7/site-packages
29+
30+
# resulting .so is empty but .o will be collected into libpymodules.so in final distribute.sh step
31+
try $BUILD_hostpython/hostpython setup.py build_ext
32+
33+
unset LDSHARED
34+
35+
try $BUILD_hostpython/hostpython setup.py install -O2 --prefix $BUILD_PATH/python-install
36+
37+
pop_arm
38+
}
39+
40+
function postbuild_netifaces() {
41+
true
42+
}
43+

0 commit comments

Comments
 (0)