File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ VERSION_leveldb=${VERSION_leveldb:- 1.18}
3+ URL_leveldb=https://github.com/google/leveldb/archive/v${VERSION_leveldb} .tar.gz
4+ DEPS_leveldb=()
5+ BUILD_leveldb=$BUILD_PATH /leveldb/$( get_directory $URL_leveldb )
6+ RECIPE_leveldb=$RECIPES_PATH /leveldb
7+
8+ function prebuild_leveldb() {
9+ cp $ANDROIDNDK /sources/cxx-stl/gnu-libstdc++/$TOOLCHAIN_VERSION /libs/$ARCH /libgnustl_shared.so $LIBS_PATH
10+ }
11+
12+ function shouldbuild_leveldb() {
13+ if [ -d " $LIBS_PATH /libleveldb.so" ]; then
14+ DO_BUILD=0
15+ fi
16+ }
17+
18+ function build_leveldb() {
19+ cd $BUILD_leveldb
20+
21+ push_arm
22+ 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/"
23+ export CFLAGS=" $CFLAGS -fpic -shared"
24+ export CXXFLAGS=$CFLAGS
25+ export LDFLAGS=" $LDFLAGS -L$LIBS_PATH "
26+ export LDFLAGS=" $LDFLAGS -lgnustl_shared"
27+ export LDSHARED=$LIBLINK
28+
29+ # Make sure leveldb is compiled for Android and does not include versioned numbers
30+ export TARGET_OS=OS_ANDROID_CROSSCOMPILE
31+ # FIXME: Not idempotent
32+ try sed -i " 127i\ \ \ \ \ \ \ \ PLATFORM_SHARED_VERSIONED=" build_detect_platform
33+
34+ # Build
35+ try make
36+
37+ # Copy the shared library
38+ try cp -L libleveldb.so $LIBS_PATH
39+
40+ # Unset
41+ unset TARGET_OS
42+ unset LDSHARED
43+ pop_arm
44+ }
45+
46+ function postbuild_leveldb() {
47+ true
48+ }
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ VERSION_plyvel=${VERSION_plyvel:- 0.9}
3+ URL_plyvel=https://pypi.python.org/packages/source/p/plyvel/plyvel-${VERSION_plyvel} .tar.gz
4+ DEPS_plyvel=(python setuptools leveldb)
5+ MD5_plyvel=b0f768a07683dad01554b040c6320ed5
6+ BUILD_plyvel=$BUILD_PATH /plyvel/$( get_directory $URL_plyvel )
7+ RECIPE_plyvel=$RECIPES_PATH /plyvel
8+
9+ function prebuild_plyvel() {
10+ true
11+ }
12+
13+ function shouldbuild_plyvel() {
14+ if [ -d " $SITEPACKAGES_PATH /plyvel" ]; then
15+ DO_BUILD=0
16+ fi
17+ }
18+
19+ function build_plyvel() {
20+ cd $BUILD_plyvel
21+
22+ # Add zip_safe=False, if not already there
23+ grep -q -e ' zip_safe=False' setup.py || sed -i " 30i\ \ \ \ zip_safe=False," setup.py
24+
25+ push_arm
26+
27+ # gnu-libstdc++, leveldb and python
28+ export CFLAGS=" $CFLAGS -I$BUILD_leveldb /include"
29+ 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/"
30+ export CFLAGS=" $CFLAGS -fpic -shared"
31+ export CXXFLAGS=$CFLAGS
32+
33+ export LDFLAGS=" $LDFLAGS -L$LIBS_PATH "
34+ export LDFLAGS=" $LDFLAGS -lgnustl_shared -lpython2.7"
35+ export LDSHARED=$LIBLINK
36+
37+ export PPO=$PYTHONPATH
38+ export PYTHONPATH=$SITEPACKAGES_PATH :$BUILDLIB_PATH
39+
40+ try $HOSTPYTHON setup.py install -O2
41+
42+ export PYTHONPATH=$PPO
43+ unset LDSHARED
44+ unset PPO
45+ pop_arm
46+ }
47+
48+ function postbuild_plyvel() {
49+ true
50+ }
You can’t perform that action at this time.
0 commit comments