Skip to content

Commit e308111

Browse files
committed
Merge pull request kivy#292 from romaia/storm
Add a storm/psycopg2 recipe
2 parents 9cbc78c + fc3def4 commit e308111

File tree

4 files changed

+143
-0
lines changed

4 files changed

+143
-0
lines changed

recipes/libpq/patches/libpq.patch

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
diff --git a/src/port/crypt.c b/src/port/crypt.c
2+
index 85b98c5..416c509 100644
3+
--- a/src/port/crypt.c
4+
+++ b/src/port/crypt.c
5+
@@ -87,7 +87,10 @@ static int des_cipher(const char *in, char *out, long salt, int num_iter);
6+
* define "B64" to be the declaration for a 64 bit integer.
7+
* XXX this feature is currently unused, see "endian" comment below.
8+
*/
9+
-#define B64 __int64
10+
+//to avoid crypt.c:237: error: expected specifier-qualifier-list before '__int64' when cross compiling for android
11+
+#ifndef ANDROID
12+
+ #define B64 __int64
13+
+#endif
14+
15+
/*
16+
* define "LARGEDATA" to get faster permutations, by using about 72 kilobytes

recipes/libpq/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_libpq=${VERSION_libpq:-9.3.5}
4+
URL_libpq=http://ftp.postgresql.org/pub/source/v$VERSION_libpq/postgresql-$VERSION_libpq.tar.bz2
5+
DEPS_libpq=(python)
6+
MD5_libpq=5059857c7d7e6ad83b6d55893a121b59
7+
BUILD_libpq=$BUILD_PATH/libpq/$(get_directory $URL_libpq)
8+
RECIPE_libpq=$RECIPES_PATH/libpq
9+
10+
function prebuild_libpq() {
11+
cd $BUILD_libpq
12+
if [ -f .patched ]; then
13+
return
14+
fi
15+
# http://www.postgresql.org/message-id/4ECCD3D9.3040505@bernawebdesign.ch
16+
try patch -p1 < $RECIPE_libpq/patches/libpq.patch
17+
touch .patched
18+
}
19+
20+
function shouldbuild_libpq() {
21+
if [ -f "$BUILD_libpq/src/interfaces/libpq/libpq.so" ]; then
22+
DO_BUILD=0
23+
fi
24+
}
25+
26+
function build_libpq() {
27+
cd $BUILD_libpq
28+
29+
push_arm
30+
31+
try ./configure --without-readline --host=arm-linux
32+
try make submake-libpq
33+
try cp -a $BUILD_libpq/src/interfaces/libpq/libpq.a $LIBS_PATH
34+
35+
pop_arm
36+
37+
}
38+
39+
function postbuild_libpq() {
40+
true
41+
}

recipes/psycopg2/recipe.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
3+
# There is a bug in storm that breaks with newer versions (>= 2.5)
4+
VERSION_psycopg2=${VERSION_psycopg2:-2.4.5}
5+
DEPS_psycopg2=(python libpq)
6+
URL_psycopg2=http://pypi.python.org/packages/source/p/psycopg2/psycopg2-$VERSION_psycopg2.tar.gz
7+
MD5_psycopg2=075e4df465e9a863f288d5bdf6e6887e
8+
BUILD_psycopg2=$BUILD_PATH/psycopg2/$(get_directory $URL_psycopg2)
9+
RECIPE_psycopg2=$RECIPES_PATH/psycopg2
10+
11+
# function called for preparing source code if needed
12+
# (you can apply patch etc here.)
13+
function prebuild_psycopg2() {
14+
cd $BUILD_psycopg2
15+
if [ -f .patched ]; then
16+
return
17+
fi
18+
# Set the correct path where our cross compiled libpq.a is (otherwise it
19+
# will try to link against the system one)
20+
try sed -i "s|pg_config_helper.query(.libdir.)|'$LIBS_PATH'|" setup.py
21+
touch .patched
22+
}
23+
24+
function shouldbuild_psycopg2() {
25+
if [ -d "$SITEPACKAGES_PATH/psycopg2" ]; then
26+
DO_BUILD=0
27+
fi
28+
}
29+
30+
function build_psycopg2() {
31+
cd $BUILD_psycopg2
32+
push_arm
33+
export LDFLAGS="$LDFLAGS -L$LIBS_PATH"
34+
export EXTRA_CFLAGS="--host linux-armv"
35+
# Statically compile psycopg
36+
try $HOSTPYTHON setup.py build_ext --static-libpq
37+
try $HOSTPYTHON setup.py install -O2 --root=$BUILD_PATH/python-install --install-lib=lib/python2.7/site-packages
38+
pop_arm
39+
}
40+
41+
# function called after all the compile have been done
42+
function postbuild_psycopg2() {
43+
true
44+
}
45+

recipes/storm/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_storm=${VERSION_storm:-0.20}
4+
DEPS_storm=(python)
5+
URL_storm=https://pypi.python.org/packages/source/s/storm/storm-$VERSION_storm.tar.bz2
6+
MD5_storm=4a9048fed9d1ec472ce73fbe54387054
7+
BUILD_storm=$BUILD_PATH/storm/$(get_directory $URL_storm)
8+
RECIPE_storm=$RECIPES_PATH/storm
9+
10+
# function called for preparing source code if needed
11+
# (you can apply patch etc here.)
12+
function prebuild_storm() {
13+
cd $BUILD_storm
14+
wget -nc http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
15+
if [ -f .patched ]; then
16+
return
17+
fi
18+
# I still dont know how to build the c extensions for android yet.
19+
# Luckly, storm provides a python fallback
20+
try sed -i "s|BUILD_CEXTENSIONS = True|BUILD_CEXTENSIONS = False|" setup.py
21+
touch .patched
22+
}
23+
24+
function shouldbuild_storm() {
25+
if [ -d "$SITEPACKAGES_PATH/storm" ]; then
26+
DO_BUILD=0
27+
fi
28+
}
29+
30+
function build_storm() {
31+
cd $BUILD_storm
32+
push_arm
33+
try $BUILD_hostpython/hostpython setup.py install -O2 --root=$BUILD_PATH/python-install --install-lib=lib/python2.7/site-packages
34+
pop_arm
35+
}
36+
37+
# function called after all the compile have been done
38+
function postbuild_storm() {
39+
true
40+
}
41+

0 commit comments

Comments
 (0)