2013-08-21 14:09:25 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2013-08-26 20:39:29 +02:00
|
|
|
echo "Building pyobjus ============================="
|
2013-08-21 14:09:25 +02:00
|
|
|
|
2013-08-26 20:39:29 +02:00
|
|
|
. $(dirname $0)/environment.sh
|
2013-08-21 14:09:25 +02:00
|
|
|
|
|
|
|
if [ ! -d $TMPROOT/pyobjus ] ; then
|
|
|
|
try pushd $TMPROOT
|
2013-10-16 20:28:04 +02:00
|
|
|
try git clone https://github.com/kivy/pyobjus.git
|
2013-08-21 14:09:25 +02:00
|
|
|
try popd
|
|
|
|
fi
|
|
|
|
|
|
|
|
try pushd $TMPROOT/pyobjus
|
|
|
|
|
|
|
|
OLD_CC="$CC"
|
|
|
|
OLD_CFLAGS="$CFLAGS"
|
|
|
|
OLD_LDFLAGS="$LDFLAGS"
|
|
|
|
OLD_LDSHARED="$LDSHARED"
|
2013-08-22 19:14:21 +02:00
|
|
|
export CC="$ARM_CC -I$BUILDROOT/include -I$BUILDROOT/include/ffi"
|
2013-08-21 14:09:25 +02:00
|
|
|
export CFLAGS="$ARM_CFLAGS"
|
|
|
|
export LDFLAGS="$ARM_LDFLAGS"
|
|
|
|
export LDSHARED="$KIVYIOSROOT/tools/liblink"
|
|
|
|
|
|
|
|
rm -rdf iosbuild/
|
|
|
|
try mkdir iosbuild
|
|
|
|
|
|
|
|
try $HOSTPYTHON setup.py build_ext
|
|
|
|
try $HOSTPYTHON setup.py install -O2 --root iosbuild
|
|
|
|
|
|
|
|
# Strip away the large stuff
|
|
|
|
find iosbuild/ | grep -E '.*\.(py|pyc|so\.o|so\.a|so\.libs)$$' | xargs rm
|
|
|
|
rm -rdf "$BUILDROOT/python/lib/python2.7/site-packages/pyobjus"
|
2013-08-22 19:14:21 +02:00
|
|
|
try cp -R "iosbuild/usr/local/lib/python2.7/site-packages/pyobjus" "$BUILDROOT/python/lib/python2.7/site-packages"
|
2013-08-21 14:09:25 +02:00
|
|
|
popd
|
|
|
|
|
|
|
|
export CC="$OLD_CC"
|
|
|
|
export CFLAGS="$OLD_CFLAGS"
|
|
|
|
export LDFLAGS="$OLD_LDFLAGS"
|
|
|
|
export LDSHARED="$OLD_LDSHARED"
|
|
|
|
|
|
|
|
bd=$TMPROOT/pyobjus/build/lib.macosx-*/pyobjus
|
|
|
|
try $KIVYIOSROOT/tools/biglink $BUILDROOT/lib/libpyobjus.a $bd
|
|
|
|
deduplicate $BUILDROOT/lib/libpyobjus.a
|
2013-09-04 01:53:33 +02:00
|
|
|
|
|
|
|
# copy objc bridge class -> it is used for implementing some objc methods, eg. for accelerometer
|
|
|
|
try cp $TMPROOT/pyobjus/objc_classes/aux/* $KIVYIOSROOT/tools/templates
|
|
|
|
|
2014-08-01 23:43:09 +02:00
|
|
|
echo "Successfully finished building pyobjus ==================="
|