kivy-ios/tools/reduce-python.sh

34 lines
905 B
Bash
Raw Normal View History

2011-12-06 11:42:37 +01:00
#!/bin/bash
2011-12-05 10:44:07 +01:00
. $(dirname $0)/environment.sh
if [ -f $BUILDROOT/python/lib/python27.zip ]; then
echo "Python already reduced and compressed."
exit 0
fi
echo "Starting reducing python 2.7"
2011-12-05 10:44:07 +01:00
try rm -rf $BUILDROOT/python/embed/include/python2.7
try mkdir -p $BUILDROOT/python/embed/include/python2.7
try cp $BUILDROOT/python/include/python2.7/pyconfig.h $BUILDROOT/python/embed/include/python2.7/pyconfig.h
try cd $BUILDROOT/python/lib/python2.7
2011-12-05 10:44:07 +01:00
find . -iname '*.pyc' | xargs rm
find . -iname '*.py' | xargs rm
find . -iname 'test*' | xargs rm -rf
rm -rf lib* wsgiref bsddb curses idlelib hotshot || true
try cd ..
2011-12-06 10:49:14 +01:00
rm -rf pkgconfig || true
echo "Compressing to python27.zip"
try pushd $BUILDROOT/python/lib/python2.7
rm config/libpython2.7.a config/python.o config/config.c.in config/makesetup
mv config ..
mv site-packages ..
zip -r ../python27.zip *
rm -rf *
mv ../config .
mv ../site-packages .
popd