replace PYTHON_VERSION with IOS_PYTHON_VERSION, and factorize HOSTPYTHON into environment.sh. closes #27

This commit is contained in:
Mathieu Virbel 2013-02-28 19:21:58 +01:00
parent ad85ed15f0
commit d0eacfc3ae
7 changed files with 16 additions and 18 deletions

View file

@ -21,7 +21,6 @@ export LDFLAGS="$ARM_LDFLAGS"
export LDSHARED="$KIVYIOSROOT/tools/liblink"
try pushd $TMPROOT/audiostream-master
HOSTPYTHON=$TMPROOT/Python-$PYTHON_VERSION/hostpython
$HOSTPYTHON setup.py build_ext &>/dev/null
try find . -iname '*.pyx' -exec $KIVYIOSROOT/tools/cythonize.py {} \;
try $HOSTPYTHON setup.py build_ext

View file

@ -12,7 +12,6 @@ export LDFLAGS="$ARM_LDFLAGS"
export LDSHARED="$KIVYIOSROOT/tools/liblink"
try pushd $KIVYIOSROOT/src/ios
HOSTPYTHON=$TMPROOT/Python-$PYTHON_VERSION/hostpython
try $KIVYIOSROOT/tools/cythonize.py *.pyx
try $HOSTPYTHON setup.py build_ext
try $HOSTPYTHON setup.py install -O2 --root iosbuild

View file

@ -22,14 +22,14 @@ OLD_LDSHARED="$LDSHARED"
export LDSHARED="$KIVYIOSROOT/tools/liblink"
export CFLAGS="$ARM_CFLAGS"
ln -s $KIVYIOSROOT/Python-$PYTHON_VERSION/python
ln -s $KIVYIOSROOT/Python-$PYTHON_VERSION/python.exe
ln -s $KIVYIOSROOT/Python-$IOS_PYTHON_VERSION/python
ln -s $KIVYIOSROOT/Python-$IOS_PYTHON_VERSION/python.exe
rm -rdf iosbuild/
try mkdir iosbuild
echo "First build ========================================"
HOSTPYTHON=$TMPROOT/Python-$PYTHON_VERSION/hostpython
HOSTPYTHON=$TMPROOT/Python-$IOS_PYTHON_VERSION/hostpython
$HOSTPYTHON setup.py build_ext -g
echo "cythoning =========================================="
find . -name *.pyx -exec $KIVYIOSROOT/tools/cythonize.py {} \;

View file

@ -97,7 +97,6 @@ export LDFLAGS="$ARM_LDFLAGS -L$PREFIX/lib"
export LDSHARED="$KIVYIOSROOT/tools/liblink"
pushd $TMPROOT/lxml-$LXML_VERSION
HOSTPYTHON=$TMPROOT/Python-$PYTHON_VERSION/hostpython
XML2_CONFIG=$PREFIX/bin/xml2-config
XSLT_CONFIG=$PREFIX/bin/xslt-config

View file

@ -7,20 +7,20 @@
# http://latenitesoft.blogspot.com/2008/10/iphone-programming-tips-building-unix.html
# download python and patch if they aren't there
if [ ! -f $CACHEROOT/Python-$PYTHON_VERSION.tar.bz2 ]; then
curl http://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.bz2 > $CACHEROOT/Python-$PYTHON_VERSION.tar.bz2
if [ ! -f $CACHEROOT/Python-$IOS_PYTHON_VERSION.tar.bz2 ]; then
curl http://www.python.org/ftp/python/$IOS_PYTHON_VERSION/Python-$IOS_PYTHON_VERSION.tar.bz2 > $CACHEROOT/Python-$IOS_PYTHON_VERSION.tar.bz2
fi
# get rid of old build
rm -rf $TMPROOT/Python-$PYTHON_VERSION
try tar -xjf $CACHEROOT/Python-$PYTHON_VERSION.tar.bz2
try mv Python-$PYTHON_VERSION $TMPROOT
try pushd $TMPROOT/Python-$PYTHON_VERSION
rm -rf $TMPROOT/Python-$IOS_PYTHON_VERSION
try tar -xjf $CACHEROOT/Python-$IOS_PYTHON_VERSION.tar.bz2
try mv Python-$IOS_PYTHON_VERSION $TMPROOT
try pushd $TMPROOT/Python-$IOS_PYTHON_VERSION
# Patch Python for temporary reduce PY_SSIZE_T_MAX otherzise, splitting string doesnet work
try patch -p1 < $KIVYIOSROOT/src/python_files/Python-$PYTHON_VERSION-ssize-t-max.patch
try patch -p1 < $KIVYIOSROOT/src/python_files/Python-$PYTHON_VERSION-dynload.patch
try patch -p1 < $KIVYIOSROOT/src/python_files/Python-$PYTHON_VERSION-static-_sqlite3.patch
try patch -p1 < $KIVYIOSROOT/src/python_files/Python-$IOS_PYTHON_VERSION-ssize-t-max.patch
try patch -p1 < $KIVYIOSROOT/src/python_files/Python-$IOS_PYTHON_VERSION-dynload.patch
try patch -p1 < $KIVYIOSROOT/src/python_files/Python-$IOS_PYTHON_VERSION-static-_sqlite3.patch
# Copy our setup for modules
try cp $KIVYIOSROOT/src/python_files/ModulesSetup Modules/Setup.local
@ -37,7 +37,7 @@ try make distclean
echo "Building for iOS ======================================================="
# patch python to cross-compile
try patch -p1 < $KIVYIOSROOT/src/python_files/Python-$PYTHON_VERSION-xcompile.patch
try patch -p1 < $KIVYIOSROOT/src/python_files/Python-$IOS_PYTHON_VERSION-xcompile.patch
# set up environment variables for cross compilation
export CPPFLAGS="-I$IOSSDKROOT/usr/lib/gcc/arm-apple-darwin11/4.2.1/include/ -I$IOSSDKROOT/usr/include/"

View file

@ -24,7 +24,7 @@ if [ ! -d $DEVROOT ]; then
fi
# version of packages
export PYTHON_VERSION=2.7.1
export IOS_PYTHON_VERSION=2.7.1
export SDLTTF_VERSION=2.0.10
export FT_VERSION=2.4.8
export XML2_VERSION=2.7.8
@ -44,6 +44,7 @@ export PKG_CONFIG_PATH="$BUILDROOT/pkgconfig:$PKG_CONFIG_PATH"
# some tools
export CCACHE=$(which ccache)
export HOSTPYTHON="$TMPROOT/Python-$IOS_PYTHON_VERSION/hostpython"
for fn in cython-2.7 cython; do
export CYTHON=$(which $fn)
if [ "X$CYTHON" != "X" ]; then

View file

@ -29,7 +29,7 @@ echo "-> Synchronize source code"
try rsync -av --delete $SRCDIR/ $YOURAPPDIR
echo "-> Compile to pyo"
$TMPROOT/Python-$PYTHON_VERSION/hostpython -OO -m compileall $YOURAPPDIR
$HOSTPYTHON -OO -m compileall $YOURAPPDIR
echo "-> Remove unused files (pyc, py)"
find $YOURAPPDIR -iname '*.py' -exec rm {} \;