diff --git a/tools/build-all.sh b/tools/build-all.sh index 067147c..7944267 100755 --- a/tools/build-all.sh +++ b/tools/build-all.sh @@ -14,6 +14,7 @@ try $(dirname $0)/build-libjpeg.sh try $(dirname $0)/build-pil.sh try $(dirname $0)/build-kivy.sh try $(dirname $0)/build-pyobjus.sh +try $(dirname $0)/build-plyer.sh echo '== Build done' echo "Available libraries in $BUILDROOT/lib" diff --git a/tools/build-plyer.sh b/tools/build-plyer.sh new file mode 100755 index 0000000..45966f4 --- /dev/null +++ b/tools/build-plyer.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +echo "Building plyer =============================" + +. $(dirname $0)/environment.sh + +if [ ! -d $TMPROOT/plyer ] ; then +try pushd $TMPROOT +try git clone https://github.com/kivy/plyer.git +try popd +fi + +try pushd $TMPROOT/plyer + +OLD_CC="$CC" +OLD_CFLAGS="$CFLAGS" +OLD_LDFLAGS="$LDFLAGS" +OLD_LDSHARED="$LDSHARED" +export CC="$ARM_CC -I$BUILDROOT/include -I$BUILDROOT/include/ffi" +export CFLAGS="$ARM_CFLAGS" +export LDFLAGS="$ARM_LDFLAGS" +export LDSHARED="$KIVYIOSROOT/tools/liblink" + +rm -rdf iosbuild/ +try mkdir iosbuild + +try $HOSTPYTHON setup.py build +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 + +# Remove other platforms except ios +iosbuild_path="iosbuild/usr/local/lib/python2.7/site-packages/plyer" +find $iosbuild_path/platforms -mindepth 1 -maxdepth 1 -d -type d ! -iname ios | xargs rm -r + +rm -rdf "$BUILDROOT/python/lib/python2.7/site-packages/plyer" +try cp -R $iosbuild_path "$BUILDROOT/python/lib/python2.7/site-packages" +popd + +export CC="$OLD_CC" +export CFLAGS="$OLD_CFLAGS" +export LDFLAGS="$OLD_LDFLAGS" +export LDSHARED="$OLD_LDSHARED" + +echo "Succesufully finished building plyer ==================="