diff --git a/recipes/apsw/recipe.sh b/recipes/apsw/recipe.sh new file mode 100644 index 0000000000..f2cb60f4a5 --- /dev/null +++ b/recipes/apsw/recipe.sh @@ -0,0 +1,95 @@ +#!/bin/bash + +# version of your package +VERSION_apsw=${VERSION_apsw:-3.8.4.1-r1} + +# dependencies of this recipe +DEPS_apsw=(python) + +# url of the package +URL_apsw=https://github.com/rogerbinns/apsw/releases/download/3.8.4.1-r1/apsw-3.8.4.1-r1.zip + +# md5 of the package +MD5_apsw=5ad3098489576929b90f4215eb5b2621 + +# default build path +BUILD_apsw=$BUILD_PATH/apsw/$(get_directory $URL_apsw) + +# default recipe path +RECIPE_apsw=$RECIPES_PATH/apsw + +# function called for preparing source code if needed +# (you can apply patch etc here.) +function prebuild_apsw() { + + # fetch sqlite if necessary + cd ${BUILD_apsw} + if [ ! -d ${BUILD_apsw}/sqlite3 ]; then + echo "fetching sqlite..." + # using /usr/bin/python for this + python setup.py fetch --sqlite --version=3.8.4.1 --missing-checksum-ok + fi + + # apsw insists on configuring sqlite, but it's for the host, not the target. + # So, put in the correct values. + + cat >sqlite3/sqlite3config.h <setup.py + + # build python extension + export LDFLAGS="$LDFLAGS -L$LIBS_PATH" + export LDSHARED="$LIBLINK" + + echo "building apsw in `pwd`..." + # now we can build; enable the FTS4 sqlite extension for full-text search + try ${HOSTPYTHON} setup.py build --enable=fts4 + echo "installing apsw..." + try ${HOSTPYTHON} setup.py install + echo "done with apsw." + + pop_arm +} + +# function called after all the compile have been done +function postbuild_apsw() { + echo "apsw built" +} diff --git a/recipes/pycrypto/patches/add_length.patch b/recipes/pycrypto/patches/add_length.patch new file mode 100644 index 0000000000..7bb9299692 --- /dev/null +++ b/recipes/pycrypto/patches/add_length.patch @@ -0,0 +1,11 @@ +--- pycrypto-2.6.1/src/hash_SHA2_template.c.orig 2013-10-14 14:38:10.000000000 -0700 ++++ pycrypto-2.6.1/src/hash_SHA2_template.c 2014-05-19 10:15:51.000000000 -0700 +@@ -87,7 +87,7 @@ + * return 1 on success + * return 0 if the length overflows + */ +-int add_length(hash_state *hs, sha2_word_t inc) { ++static int add_length(hash_state *hs, sha2_word_t inc) { + sha2_word_t overflow_detector; + overflow_detector = hs->length_lower; + hs->length_lower += inc; diff --git a/recipes/pycrypto/recipe.sh b/recipes/pycrypto/recipe.sh index cbe7100685..e80136d47d 100644 --- a/recipes/pycrypto/recipe.sh +++ b/recipes/pycrypto/recipe.sh @@ -1,14 +1,25 @@ #!/bin/bash -VERSION_pycrypto=${VERSION_pycrypto:-2.5} +VERSION_pycrypto=${VERSION_pycrypto:-2.6.1} URL_pycrypto=http://pypi.python.org/packages/source/p/pycrypto/pycrypto-$VERSION_pycrypto.tar.gz DEPS_pycrypto=(openssl python) -MD5_pycrypto=783e45d4a1a309e03ab378b00f97b291 +MD5_pycrypto=55a61a054aa66812daf5161a0d5d7eda BUILD_pycrypto=$BUILD_PATH/pycrypto/$(get_directory $URL_pycrypto) RECIPE_pycrypto=$RECIPES_PATH/pycrypto function prebuild_pycrypto() { - true + cd $BUILD_pycrypto + + # check marker in our source build + if [ -f .patched ]; then + # no patch needed + return + fi + + try patch -p1 < $RECIPE_pycrypto/patches/add_length.patch + + # everything done, touch the marker ! + touch .patched } function shouldbuild_pycrypto() {