diff --git a/recipes/libswift/recipe.sh b/recipes/libswift/recipe.sh new file mode 100644 index 0000000000..694f86243e --- /dev/null +++ b/recipes/libswift/recipe.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +#TODO get a release version if possible +VERSION_libswift= +DEPS_libswift=() +#TODO get a version specific URL and update the md5sum +#URL_libswift=https://github.com/whirm/tgs-android/archive/master.zip +#MD5_libswift=23ce86e2bd4d213fdcf1d8c5c37a979a +URL_libswift=https://nodeload.github.com/triblerteam/libswift/zip/4123e6579309cd65a5ba3800e0b674f348c62bfb +FILENAME_libswift=4123e6579309cd65a5ba3800e0b674f348c62bfb +EXTRACT_libswift=$BUILD_PATH/libswift/libswift-$FILENAME_libswift +BUILD_libswift=$BUILD_PATH/libswift/libswift +RECIPE_libswift=$RECIPES_PATH/libswift + +function prebuild_libswift() { + true +} + +function build_libswift() { + if [ ! -d "$BUILD_libswift" ]; then + cd $BUILD_PATH/libswift + mkdir -p libswift + unzip $PACKAGES_PATH/$FILENAME_libswift + rm -Rf libswift/jni + mv $EXTRACT_libswift libswift/jni + fi + cd $BUILD_libswift + mkdir -p libs + + if [ -f "$BUILD_PATH/libs/libevent.so" ]; then + #return + true + fi + + push_arm + + #FIXME get it so you don't have to download the jni module manually + export LDFLAGS=$LIBLINK + try ndk-build -C $BUILD_libswift/jni + unset LDFLAGS + + #TODO find out why it's libevent.so and not libswift.so + try cp -a $BUILD_libswift/libs/$ARCH/*.so $LIBS_PATH + + pop_arm +} + +function postbuild_libswift() { + true +} + diff --git a/recipes/m2crypto/recipe.sh b/recipes/m2crypto/recipe.sh new file mode 100644 index 0000000000..6f4f7df95b --- /dev/null +++ b/recipes/m2crypto/recipe.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +VERSION_m2crypto=0.21.1 +DEPS_m2crypto=(openssl hostpython python) +URL_m2crypto=http://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-$VERSION_m2crypto.tar.gz +MD5_m2crypto=f93d8462ff7646397a9f77a2fe602d17 +BUILD_m2crypto=$BUILD_PATH/m2crypto/$(get_directory $URL_m2crypto) +RECIPE_m2crypto=$RECIPES_PATH/m2crypto + +function prebuild_m2crypto() { + true +} + +function build_m2crypto() { + cd $BUILD_m2crypto + + if [ -d "$BUILD_PATH/python-install/lib/python2.7/site-packages/m2crypto" ]; then + #return + true + fi + push_arm + + # build python extension + export CFLAGS="$CFLAGS -I$BUILD_PATH/python-install/include/python2.7" + export LDSHARED=$LIBLINK + export PYTHONPATH=$BUILD_PATH/python-install/lib/python2.7/site-packages + + try $BUILD_hostpython/hostpython setup.py build_ext --openssl=$BUILD_openssl --library-dirs=$BUILD_openssl + + unset LDSHARED + + try $BUILD_hostpython/hostpython setup.py install -O2 --prefix $BUILD_PATH/python-install + + pop_arm +} + +function postbuild_m2crypto() { + true +} diff --git a/recipes/netifaces/recipe.sh b/recipes/netifaces/recipe.sh new file mode 100644 index 0000000000..2d5bf27eb0 --- /dev/null +++ b/recipes/netifaces/recipe.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +VERSION_netifaces=0.10.3 +DEPS_netifaces=(hostpython python setuptools) +URL_netifaces=http://pypi.python.org/packages/source/n/netifaces/netifaces-$VERSION_netifaces.tar.gz +MD5_netifaces=b96913473e1dcc3c4a7c43bc15d10e26 +BUILD_netifaces=$BUILD_PATH/netifaces/$(get_directory $URL_netifaces) +RECIPE_netifaces=$RECIPES_PATH/netifaces + +function prebuild_netifaces() { + true +} + +function build_netifaces() { + cd $BUILD_netifaces + + #FIXME it actually builds an egg + if [ -d "$BUILD_PATH/python-install/lib/python2.7/site-packages/netifaces" ]; then + #return + true + fi + push_arm + + # build python extension + export CFLAGS="$CFLAGS -I$BUILD_PATH/python-install/include/python2.7" + export LDSHARED=$LIBLINK + export PYTHONPATH=$BUILD_PATH/python-install/lib/python2.7/site-packages + + # resulting .so is empty but .o will be collected into libpymodules.so in final distribute.sh step + try $BUILD_hostpython/hostpython setup.py build_ext + + unset LDSHARED + + try $BUILD_hostpython/hostpython setup.py install -O2 --prefix $BUILD_PATH/python-install + + pop_arm +} + +function postbuild_netifaces() { + true +} diff --git a/recipes/swift/extra/Android.mk b/recipes/swift/extra/Android.mk new file mode 100644 index 0000000000..c89fd4830a --- /dev/null +++ b/recipes/swift/extra/Android.mk @@ -0,0 +1,21 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := libevent2 + +LOCAL_SRC_FILES := libevent2/lib/libevent.a +LOCAL_EXPORT_C_INCLUDES := libevent2/include +LOCAL_C_INCLUDES := libevent2/include + +include $(PREBUILT_STATIC_LIBRARY) + +LOCAL_MODULE := swift +LOCAL_SRC_FILES := swift.cpp sha1.cpp compat.cpp sendrecv.cpp send_control.cpp hashtree.cpp bin.cpp binmap.cpp binheap.cpp channel.cpp transfer.cpp httpgw.cpp statsgw.cpp cmdgw.cpp avgspeed.cpp availability.cpp + +LOCAL_CFLAGS += -D__NEW__ + +LOCAL_STATIC_LIBRARIES := libevent2 + +#include $(BUILD_SHARED_LIBRARY) +include $(BUILD_EXECUTABLE) diff --git a/recipes/swift/recipe.sh b/recipes/swift/recipe.sh new file mode 100644 index 0000000000..f6cfa631af --- /dev/null +++ b/recipes/swift/recipe.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +#TODO get a release version if possible +VERSION_swift= +DEPS_swift=() +URL_swift=https://nodeload.github.com/triblerteam/libswift/zip/4123e6579309cd65a5ba3800e0b674f348c62bfb +MD5_swift=99cf78ea0b4aeb23a2439dd886f00f8f +FILENAME_swift=4123e6579309cd65a5ba3800e0b674f348c62bfb +EXTRACT_swift=$BUILD_PATH/swift/libswift-$FILENAME_swift +BUILD_swift=$BUILD_PATH/swift/swift +RECIPE_swift=$RECIPES_PATH/swift + +function prebuild_swift() { + true +} + +function build_swift() { + if [ ! -d "$BUILD_swift" ]; then + cd $BUILD_PATH/swift + mkdir -p swift + unzip $PACKAGES_PATH/$FILENAME_swift + rm -Rf swift/jni + mv $EXTRACT_swift swift/jni + + # Use differend Android.mk to create a binary instead of a library + cp $RECIPE_swift/extra/Android.mk swift/jni/Android.mk + fi + + cd $BUILD_swift + mkdir -p libs + + if [ -f "$BUILD_PATH/libs/swift" ]; then + #return + true + fi + + push_arm + + #FIXME get it so you don't have to download the jni module manually + export LDFLAGS=$LIBLINK + try ndk-build -C $BUILD_swift/jni + unset LDFLAGS + + #TODO find out why it's libevent.so and not libswift.so + try cp -a $BUILD_swift/libs/$ARCH/libevent $LIBS_PATH/swift + + pop_arm +} + +function postbuild_swift() { + true +} + diff --git a/recipes/twisted/recipe.sh b/recipes/twisted/recipe.sh index ea553401fc..19ae794116 100644 --- a/recipes/twisted/recipe.sh +++ b/recipes/twisted/recipe.sh @@ -1,14 +1,16 @@ #!/bin/bash -VERSION_twisted=${VERSION_twisted:-11.1} +VERSION_twisted=${VERSION_twisted:-14.0} URL_twisted=http://twistedmatrix.com/Releases/Twisted/$VERSION_twisted/Twisted-$VERSION_twisted.0.tar.bz2 + DEPS_twisted=(zope) -MD5_twisted= +MD5_twisted=9625c094e0a18da77faa4627b98c9815 BUILD_twisted=$BUILD_PATH/twisted/$(get_directory $URL_twisted) RECIPE_twisted=$RECIPES_PATH/twisted function prebuild_twisted() { - true + echo "tty.pyo" >> "${BUILD_PATH}/whitelist.txt" + echo "termios.so" >> "${BUILD_PATH}/whitelist.txt" } function shouldbuild_twisted() { @@ -25,7 +27,7 @@ function build_twisted() { export LDFLAGS="$LDFLAGS -L$LIBS_PATH" export LDSHARED="$LIBLINK" - export PYTHONPATH=$BUILD_hostpython/Lib/site-packages + export PYTHONPATH=$BUILD_hostpython/Lib/site-packages:$BUILD_hostpython/build/lib.linux-x86_64-2.7 # fake try to be able to cythonize generated files $HOSTPYTHON setup.py build_ext