-
Notifications
You must be signed in to change notification settings - Fork 1
/
build-apsw.sh
45 lines (38 loc) · 1.23 KB
/
build-apsw.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
. $(dirname $0)/environment.sh
if [ ! -f $CACHEROOT/sqlite-amalgamation-3080401.zip ] ; then
try curl -L http://sqlite.org/2014/sqlite-amalgamation-3080401.zip > $CACHEROOT/sqlite-amalgamation-3080401.zip
fi
if [ ! -d $TMPROOT/apsw ]; then
try pushd $TMPROOT
try git clone -b master https://github.com/rogerbinns/apsw
try cd apsw
try unzip $CACHEROOT/sqlite-amalgamation-3080401.zip
try mv sqlite-amalgamation-3080401/* $TMPROOT/apsw
try rm -rf sqlite-amalgamation-3080401
try popd
fi
pushd $TMPROOT/apsw
OLD_CC="$CC"
OLD_CFLAGS="$CFLAGS"
OLD_LD="$LD"
OLD_LDFLAGS="$LDFLAGS"
OLD_LDSHARED="$LDSHARED"
export LDSHARED="$KIVYIOSROOT/tools/liblink"
export LDFLAGS="$ARM_LDFLAGS"
export LD="$ARM_LD"
export CFLAGS="$ARM_CFLAGS -DEXPERIMENTAL=1 -DAPSW_USE_SQLITE_AMALGAMATION=\'sqlite3.c\'"
export CC="$ARM_CC"
$HOSTPYTHON setup.py build_ext -v
$HOSTPYTHON setup.py install -O2
export LDSHARED="$OLD_LDSHARED"
export LDFLAGS="$OLD_LDFLAGS"
export LD="$OLD_LD"
export CFLAGS="$OLD_CFLAGS"
export CC="$OLD_CC"
popd
bd=$TMPROOT/apsw/build/lib.macosx-*/
try $KIVYIOSROOT/tools/biglink $BUILDROOT/lib/libapsw.a $bd
deduplicate $BUILDROOT/lib/libapsw.a
try cp $bd/* "$BUILDROOT/python/lib/python2.7/site-packages"
echo '== APSW build is done'