Skip to content
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
48 changes: 48 additions & 0 deletions recipes/leveldb/recipe.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash
VERSION_leveldb=${VERSION_leveldb:-1.18}
URL_leveldb=https://github.com/google/leveldb/archive/v${VERSION_leveldb}.tar.gz
DEPS_leveldb=()
BUILD_leveldb=$BUILD_PATH/leveldb/$(get_directory $URL_leveldb)
RECIPE_leveldb=$RECIPES_PATH/leveldb

function prebuild_leveldb() {
cp $ANDROIDNDK/sources/cxx-stl/gnu-libstdc++/$TOOLCHAIN_VERSION/libs/$ARCH/libgnustl_shared.so $LIBS_PATH
}

function shouldbuild_leveldb() {
if [ -d "$LIBS_PATH/libleveldb.so" ]; then
DO_BUILD=0
fi
}

function build_leveldb() {
cd $BUILD_leveldb

push_arm
export CFLAGS="$CFLAGS -I$ANDROIDNDK/sources/cxx-stl/gnu-libstdc++/$TOOLCHAIN_VERSION/include/ -I$ANDROIDNDK/sources/cxx-stl/gnu-libstdc++/$TOOLCHAIN_VERSION/libs/$ARCH/include/"
export CFLAGS="$CFLAGS -fpic -shared"
export CXXFLAGS=$CFLAGS
export LDFLAGS="$LDFLAGS -L$LIBS_PATH"
export LDFLAGS="$LDFLAGS -lgnustl_shared"
export LDSHARED=$LIBLINK

# Make sure leveldb is compiled for Android and does not include versioned numbers
export TARGET_OS=OS_ANDROID_CROSSCOMPILE
#FIXME: Not idempotent
try sed -i "127i\ \ \ \ \ \ \ \ PLATFORM_SHARED_VERSIONED=" build_detect_platform

# Build
try make

# Copy the shared library
try cp -L libleveldb.so $LIBS_PATH

# Unset
unset TARGET_OS
unset LDSHARED
pop_arm
}

function postbuild_leveldb() {
true
}
50 changes: 50 additions & 0 deletions recipes/plyvel/recipe.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash
VERSION_plyvel=${VERSION_plyvel:-0.9}
URL_plyvel=https://pypi.python.org/packages/source/p/plyvel/plyvel-${VERSION_plyvel}.tar.gz
DEPS_plyvel=(python setuptools leveldb)
MD5_plyvel=b0f768a07683dad01554b040c6320ed5
BUILD_plyvel=$BUILD_PATH/plyvel/$(get_directory $URL_plyvel)
RECIPE_plyvel=$RECIPES_PATH/plyvel

function prebuild_plyvel() {
true
}

function shouldbuild_plyvel() {
if [ -d "$SITEPACKAGES_PATH/plyvel" ]; then
DO_BUILD=0
fi
}

function build_plyvel() {
cd $BUILD_plyvel

# Add zip_safe=False, if not already there
grep -q -e 'zip_safe=False' setup.py || sed -i "30i\ \ \ \ zip_safe=False," setup.py

push_arm

# gnu-libstdc++, leveldb and python
export CFLAGS="$CFLAGS -I$BUILD_leveldb/include"
export CFLAGS="$CFLAGS -I$ANDROIDNDK/sources/cxx-stl/gnu-libstdc++/$TOOLCHAIN_VERSION/include/ -I$ANDROIDNDK/sources/cxx-stl/gnu-libstdc++/$TOOLCHAIN_VERSION/libs/armeabi/include/"
export CFLAGS="$CFLAGS -fpic -shared"
export CXXFLAGS=$CFLAGS

export LDFLAGS="$LDFLAGS -L$LIBS_PATH"
export LDFLAGS="$LDFLAGS -lgnustl_shared -lpython2.7"
export LDSHARED=$LIBLINK

export PPO=$PYTHONPATH
export PYTHONPATH=$SITEPACKAGES_PATH:$BUILDLIB_PATH

try $HOSTPYTHON setup.py install -O2

export PYTHONPATH=$PPO
unset LDSHARED
unset PPO
pop_arm
}

function postbuild_plyvel() {
true
}