diff --git a/recipes/libpq/patches/libpq.patch b/recipes/libpq/patches/libpq.patch new file mode 100644 index 0000000000..dd961230bf --- /dev/null +++ b/recipes/libpq/patches/libpq.patch @@ -0,0 +1,16 @@ +diff --git a/src/port/crypt.c b/src/port/crypt.c +index 85b98c5..416c509 100644 +--- a/src/port/crypt.c ++++ b/src/port/crypt.c +@@ -87,7 +87,10 @@ static int des_cipher(const char *in, char *out, long salt, int num_iter); + * define "B64" to be the declaration for a 64 bit integer. + * XXX this feature is currently unused, see "endian" comment below. + */ +-#define B64 __int64 ++//to avoid crypt.c:237: error: expected specifier-qualifier-list before '__int64' when cross compiling for android ++#ifndef ANDROID ++ #define B64 __int64 ++#endif + + /* + * define "LARGEDATA" to get faster permutations, by using about 72 kilobytes diff --git a/recipes/libpq/recipe.sh b/recipes/libpq/recipe.sh new file mode 100644 index 0000000000..887a23c767 --- /dev/null +++ b/recipes/libpq/recipe.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +VERSION_libpq=${VERSION_libpq:-9.3.5} +URL_libpq=http://ftp.postgresql.org/pub/source/v$VERSION_libpq/postgresql-$VERSION_libpq.tar.bz2 +DEPS_libpq=(python) +MD5_libpq=5059857c7d7e6ad83b6d55893a121b59 +BUILD_libpq=$BUILD_PATH/libpq/$(get_directory $URL_libpq) +RECIPE_libpq=$RECIPES_PATH/libpq + +function prebuild_libpq() { + cd $BUILD_libpq + if [ -f .patched ]; then + return + fi + # http://www.postgresql.org/message-id/4ECCD3D9.3040505@bernawebdesign.ch + try patch -p1 < $RECIPE_libpq/patches/libpq.patch + touch .patched +} + +function shouldbuild_libpq() { + if [ -f "$BUILD_libpq/src/interfaces/libpq/libpq.so" ]; then + DO_BUILD=0 + fi +} + +function build_libpq() { + cd $BUILD_libpq + + push_arm + + try ./configure --without-readline --host=arm-linux + try make submake-libpq + try cp -a $BUILD_libpq/src/interfaces/libpq/libpq.a $LIBS_PATH + + pop_arm + +} + +function postbuild_libpq() { + true +} diff --git a/recipes/psycopg2/recipe.sh b/recipes/psycopg2/recipe.sh new file mode 100644 index 0000000000..b34cf75a93 --- /dev/null +++ b/recipes/psycopg2/recipe.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# There is a bug in storm that breaks with newer versions (>= 2.5) +VERSION_psycopg2=${VERSION_psycopg2:-2.4.5} +DEPS_psycopg2=(python libpq) +URL_psycopg2=http://pypi.python.org/packages/source/p/psycopg2/psycopg2-$VERSION_psycopg2.tar.gz +MD5_psycopg2=075e4df465e9a863f288d5bdf6e6887e +BUILD_psycopg2=$BUILD_PATH/psycopg2/$(get_directory $URL_psycopg2) +RECIPE_psycopg2=$RECIPES_PATH/psycopg2 + +# function called for preparing source code if needed +# (you can apply patch etc here.) +function prebuild_psycopg2() { + cd $BUILD_psycopg2 + if [ -f .patched ]; then + return + fi + # Set the correct path where our cross compiled libpq.a is (otherwise it + # will try to link against the system one) + try sed -i "s|pg_config_helper.query(.libdir.)|'$LIBS_PATH'|" setup.py + touch .patched +} + +function shouldbuild_psycopg2() { + if [ -d "$SITEPACKAGES_PATH/psycopg2" ]; then + DO_BUILD=0 + fi +} + +function build_psycopg2() { + cd $BUILD_psycopg2 + push_arm + export LDFLAGS="$LDFLAGS -L$LIBS_PATH" + export EXTRA_CFLAGS="--host linux-armv" + # Statically compile psycopg + try $HOSTPYTHON setup.py build_ext --static-libpq + try $HOSTPYTHON setup.py install -O2 --root=$BUILD_PATH/python-install --install-lib=lib/python2.7/site-packages + pop_arm +} + +# function called after all the compile have been done +function postbuild_psycopg2() { + true +} + diff --git a/recipes/storm/recipe.sh b/recipes/storm/recipe.sh new file mode 100644 index 0000000000..f187b56f7c --- /dev/null +++ b/recipes/storm/recipe.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +VERSION_storm=${VERSION_storm:-0.20} +DEPS_storm=(python) +URL_storm=https://pypi.python.org/packages/source/s/storm/storm-$VERSION_storm.tar.bz2 +MD5_storm=4a9048fed9d1ec472ce73fbe54387054 +BUILD_storm=$BUILD_PATH/storm/$(get_directory $URL_storm) +RECIPE_storm=$RECIPES_PATH/storm + +# function called for preparing source code if needed +# (you can apply patch etc here.) +function prebuild_storm() { + cd $BUILD_storm + wget -nc http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg + if [ -f .patched ]; then + return + fi + # I still dont know how to build the c extensions for android yet. + # Luckly, storm provides a python fallback + try sed -i "s|BUILD_CEXTENSIONS = True|BUILD_CEXTENSIONS = False|" setup.py + touch .patched +} + +function shouldbuild_storm() { + if [ -d "$SITEPACKAGES_PATH/storm" ]; then + DO_BUILD=0 + fi +} + +function build_storm() { + cd $BUILD_storm + push_arm + try $BUILD_hostpython/hostpython setup.py install -O2 --root=$BUILD_PATH/python-install --install-lib=lib/python2.7/site-packages + pop_arm +} + +# function called after all the compile have been done +function postbuild_storm() { + true +} +