Skip to content

Added 4 recipes and updated Twisted #254

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 9, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions recipes/libswift/recipe.sh
Original file line number Diff line number Diff line change
@@ -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
}

39 changes: 39 additions & 0 deletions recipes/m2crypto/recipe.sh
Original file line number Diff line number Diff line change
@@ -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
}
41 changes: 41 additions & 0 deletions recipes/netifaces/recipe.sh
Original file line number Diff line number Diff line change
@@ -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
}
21 changes: 21 additions & 0 deletions recipes/swift/extra/Android.mk
Original file line number Diff line number Diff line change
@@ -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)
53 changes: 53 additions & 0 deletions recipes/swift/recipe.sh
Original file line number Diff line number Diff line change
@@ -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
}

10 changes: 6 additions & 4 deletions recipes/twisted/recipe.sh
Original file line number Diff line number Diff line change
@@ -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() {
Expand All @@ -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
Expand Down