Skip to content

Commit f88cae1

Browse files
committed
Merge pull request kivy#80 from thopiekar/master
MySQL/Connector update - 1.0.8
2 parents 4eb3a49 + 3c36f1b commit f88cae1

File tree

5 files changed

+119
-6
lines changed

5 files changed

+119
-6
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ src/default.properties
88
dist
99
*.pyc
1010
testsuite
11+
12+
#ECLIPSE + PYDEV
13+
.project
14+
.pydevproject

README.rst

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,26 @@ Global overview
1414
---------------
1515

1616
#. Download Android NDK, SDK
17-
#. Launch "android", and download latest Android platform
17+
18+
* NDK: http://dl.google.com/android/ndk/android-ndk-r8c-linux-x86.tar.bz2
19+
20+
* More details at: http://developer.android.com/tools/sdk/ndk/index.html
21+
22+
* SDK: http://dl.google.com/android/android-sdk_r21.0.1-linux.tgz
23+
24+
* More details at:http://developer.android.com/sdk/index.html
25+
26+
#. Launch "android", and download latest Android platform, here API 14, which would be Android 4.0
27+
1828
#. Export some environment variables::
1929

2030
export ANDROIDSDK="/path/to/android/android-sdk-linux_86"
21-
export ANDROIDNDK="/path/to/android/android-ndk-r7"
22-
export ANDROIDNDKVER=r7
31+
export ANDROIDNDK="/path/to/android/android-ndk-r8c"
32+
export ANDROIDNDKVER=r8c
2333
export ANDROIDAPI=14
2434

35+
(Of course correct the paths mentioned in ANDROIDSDK and ANDROIDNDK)
36+
2537
#. Clone python-for-android::
2638

2739
git clone git://github.com/kivy/python-for-android

cythonizer.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import os, sys
2+
3+
class cythonizer():
4+
def __init__(self,
5+
android_ndk = os.environ["ANDROIDNDK"],
6+
android_api = os.environ["ANDROIDAPI"],
7+
python_for_android = os.path.join(os.path.split(os.path.realpath(__file__))[0])
8+
):
9+
self.android_ndk = android_ndk
10+
self.android_api = android_api
11+
self.py_for_a = python_for_android
12+
13+
for path in [self.android_ndk, self.py_for_a]:
14+
if not os.path.isdir(path):
15+
print "!! Haven't found path:", repr(path)
16+
sys.exit()
17+
18+
self.gcc = "%s/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc" %(self.android_ndk)
19+
self.sysroot = "%s/platforms/android-%s/arch-arm" %(self.android_ndk, self.android_api)
20+
self.a_incl = "-I%s/platforms/android-%s/arch-arm/usr/include" %(self.android_ndk, self.android_api)
21+
self.p_incl = "-I%s/build/python-install/include/python2.7" %(self.py_for_a)
22+
self.libs = "-L%s/build/libs" %(self.py_for_a)
23+
self.p_libs = "-L%s/build/python-install/lib" %(self.py_for_a)
24+
self.a_libs = "-L%s/platforms/android-%s/arch-arm/usr/lib" %(self.android_ndk, self.android_api)
25+
26+
def make_o(self, c_file, o_file):
27+
command = """%s -mandroid -fomit-frame-pointer -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC --sysroot %s %s %s -c database.c -o database.o""" %(self.gcc,
28+
self.sysroot,
29+
self.a_incl,
30+
self.p_incl)
31+
print command
32+
33+
def make_so(self, o_file, so_file= None):
34+
if so_file == None:
35+
so_file = os.path.splitext(os.path.realpath(o_file))[0]+".so"
36+
command = """%s -shared -O3 -mandroid -fomit-frame-pointer --sysroot %s -lm -lGLESv2 -lpython2.7 %s %s %s %s -o %s """ %(self.gcc,
37+
self.sysroot,
38+
self.libs,
39+
self.p_libs,
40+
self.a_libs,
41+
o_file,
42+
so_file)
43+
print command
44+
def make(self, py_pyx):
45+
for root, dirs, files in os.walk(directory):
46+
for file in files:
47+
if file.endswith('.py') or file.endswith('.pyx'):
48+
print file
49+
self.make_o(py_pyx)
50+
self.make_so(py_pyx)
51+
52+
if __name__ == "__main__":
53+
c = cythonizer()
54+
c.make("test.py")

recipes/kivy_stable/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_kivy_stable=1.5.1
4+
URL_kivy_stable=https://github.com/kivy/kivy/archive/$VERSION_kivy_stable.zip
5+
DEPS_kivy_stable=(pygame pyjnius android)
6+
MD5_kivy_stable=
7+
BUILD_kivy_stable=$BUILD_PATH/kivy_stable/$VERSION_kivy_stable
8+
RECIPE_kivy_stable=$RECIPES_PATH/kivy_stable
9+
10+
function prebuild_kivy_stable() {
11+
true
12+
}
13+
14+
function build_kivy_stable() {
15+
if [ -d "$BUILD_PATH/python-install/lib/python2.7/site-packages/kivy" ]; then
16+
#return
17+
true
18+
fi
19+
20+
cd $BUILD_kivy_stable
21+
22+
push_arm
23+
24+
export LDFLAGS="$LDFLAGS -L$LIBS_PATH"
25+
export LDSHARED="$LIBLINK"
26+
27+
# fake try to be able to cythonize generated files
28+
$BUILD_PATH/python-install/bin/python.host setup.py build_ext
29+
try find . -iname '*.pyx' -exec cython {} \;
30+
try $BUILD_PATH/python-install/bin/python.host setup.py build_ext -v
31+
try find build/lib.* -name "*.o" -exec $STRIP {} \;
32+
try $BUILD_PATH/python-install/bin/python.host setup.py install -O2
33+
34+
try rm -rf $BUILD_PATH/python-install/lib/python*/site-packages/kivy/tools
35+
36+
unset LDSHARED
37+
pop_arm
38+
}
39+
40+
function postbuild_kivy_stable() {
41+
true
42+
}
43+

recipes/mysql_connector/recipe.sh

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

3-
VERSION_mysql_connector=1.0.7
4-
URL_mysql_connector=https://launchpad.net/debian/+archive/primary/+files/mysql-connector-python_$VERSION_mysql_connector.orig.tar.gz
3+
VERSION_mysql_connector=1.0.8
4+
URL_mysql_connector=http://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-$VERSION_mysql_connector.tar.gz
55
DEPS_mysql_connector=()
6-
MD5_mysql_connector=44c6b2c314c7ab7b7060484970b5ff23
6+
MD5_mysql_connector=1f2dd335c72684d51ee5d34f127d7ca9
77
BUILD_mysql_connector=$BUILD_PATH/mysql_connector/$(get_directory $URL_mysql_connector)
88
RECIPE_mysql_connector=$RECIPES_PATH/mysql_connector
99

0 commit comments

Comments
 (0)