2011-12-01 17:42:14 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2012-03-08 20:45:55 +01:00
|
|
|
. $(dirname $0)/environment.sh
|
2011-12-01 17:42:14 +01:00
|
|
|
|
2012-03-08 20:45:55 +01:00
|
|
|
if [ ! -d $TMPROOT/kivy ] ; then
|
|
|
|
try pushd $TMPROOT
|
2013-05-13 10:39:32 +02:00
|
|
|
try git clone -b stable https://github.com/kivy/kivy
|
2011-12-01 17:42:14 +01:00
|
|
|
try cd kivy
|
2012-03-08 20:45:55 +01:00
|
|
|
try popd
|
2011-12-01 17:42:14 +01:00
|
|
|
fi
|
|
|
|
|
2011-12-06 16:02:21 +01:00
|
|
|
if [ "X$1" = "X-f" ] ; then
|
2012-03-08 20:45:55 +01:00
|
|
|
try pushd $TMPROOT/kivy
|
2011-12-01 17:42:14 +01:00
|
|
|
try git clean -dxf
|
2013-05-13 10:39:32 +02:00
|
|
|
try git pull origin stable
|
2012-03-08 20:45:55 +01:00
|
|
|
try popd
|
2011-12-01 17:42:14 +01:00
|
|
|
fi
|
|
|
|
|
2012-03-08 20:45:55 +01:00
|
|
|
pushd $TMPROOT/kivy
|
2012-03-11 17:23:15 +01:00
|
|
|
OLD_CFLAGS="$CFLAGS"
|
|
|
|
OLD_LDSHARED="$LDSHARED"
|
2012-03-08 20:45:55 +01:00
|
|
|
export LDSHARED="$KIVYIOSROOT/tools/liblink"
|
2011-12-06 12:08:47 +01:00
|
|
|
export CFLAGS="$ARM_CFLAGS"
|
2013-01-05 12:17:52 +01:00
|
|
|
|
2013-02-28 19:21:58 +01:00
|
|
|
ln -s $KIVYIOSROOT/Python-$IOS_PYTHON_VERSION/python
|
|
|
|
ln -s $KIVYIOSROOT/Python-$IOS_PYTHON_VERSION/python.exe
|
2013-01-05 12:17:52 +01:00
|
|
|
|
|
|
|
rm -rdf iosbuild/
|
|
|
|
try mkdir iosbuild
|
|
|
|
|
|
|
|
echo "First build ========================================"
|
2013-02-28 19:21:58 +01:00
|
|
|
HOSTPYTHON=$TMPROOT/Python-$IOS_PYTHON_VERSION/hostpython
|
2013-01-05 12:17:52 +01:00
|
|
|
$HOSTPYTHON setup.py build_ext -g
|
|
|
|
echo "cythoning =========================================="
|
|
|
|
find . -name *.pyx -exec $KIVYIOSROOT/tools/cythonize.py {} \;
|
|
|
|
echo "Second build ======================================="
|
2013-02-11 21:33:52 +01:00
|
|
|
try $HOSTPYTHON setup.py build_ext -g
|
|
|
|
try $HOSTPYTHON setup.py install -O2 --root iosbuild
|
2013-01-05 12:17:52 +01:00
|
|
|
# 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/kivy"
|
|
|
|
# Copy to python for iOS installation
|
2013-02-11 21:33:52 +01:00
|
|
|
try cp -R "iosbuild/usr/local/lib/python2.7/site-packages/kivy" "$BUILDROOT/python/lib/python2.7/site-packages"
|
2013-01-05 12:17:52 +01:00
|
|
|
|
2012-03-11 17:23:15 +01:00
|
|
|
export LDSHARED="$OLD_LDSHARED"
|
|
|
|
export CFLAGS="$OLD_CFLAGS"
|
2012-03-08 20:45:55 +01:00
|
|
|
popd
|
2011-12-01 17:42:14 +01:00
|
|
|
|
2011-12-05 10:09:35 +01:00
|
|
|
# FIXME this part is build/cpu dependent :/
|
2012-03-08 20:45:55 +01:00
|
|
|
bd=$TMPROOT/kivy/build/lib.macosx-*/kivy
|
|
|
|
try $KIVYIOSROOT/tools/biglink $BUILDROOT/lib/libkivy.a $bd $bd/graphics $bd/core/window $bd/core/text $bd/core/image $bd/core/audio
|
2011-12-06 15:32:31 +01:00
|
|
|
deduplicate $BUILDROOT/lib/libkivy.a
|