add lxml as a possible recipe + ensure flags are reset after using other build-*

This commit is contained in:
Mathieu Virbel 2012-03-11 17:23:15 +01:00
parent e6ae3dc0ed
commit 0f2ab13935
4 changed files with 112 additions and 3 deletions

View file

@ -14,14 +14,14 @@ fi
# lib not found, compile it # lib not found, compile it
pushd $TMPROOT/freetype-$FT_VERSION pushd $TMPROOT/freetype-$FT_VERSION
./configure --prefix=/usr/local/iphone \ try ./configure --prefix=/usr/local/iphone \
--host=arm-apple-darwin \ --host=arm-apple-darwin \
--enable-static=yes \ --enable-static=yes \
--enable-shared=no \ --enable-shared=no \
CC="$ARM_CC" AR="$ARM_AR" \ CC="$ARM_CC" AR="$ARM_AR" \
LDFLAGS="$ARM_LDFLAGS" CFLAGS="$ARM_CFLAGS" LDFLAGS="$ARM_LDFLAGS" CFLAGS="$ARM_CFLAGS"
make clean try make clean
make try make
# copy to buildroot # copy to buildroot
cp objs/.libs/libfreetype.a $BUILDROOT/lib/libfreetype.a cp objs/.libs/libfreetype.a $BUILDROOT/lib/libfreetype.a

View file

@ -19,9 +19,13 @@ if [ "X$1" = "X-f" ] ; then
fi fi
pushd $TMPROOT/kivy pushd $TMPROOT/kivy
OLD_CFLAGS="$CFLAGS"
OLD_LDSHARED="$LDSHARED"
export LDSHARED="$KIVYIOSROOT/tools/liblink" export LDSHARED="$KIVYIOSROOT/tools/liblink"
export CFLAGS="$ARM_CFLAGS" export CFLAGS="$ARM_CFLAGS"
try make ios try make ios
export LDSHARED="$OLD_LDSHARED"
export CFLAGS="$OLD_CFLAGS"
popd popd
# FIXME this part is build/cpu dependent :/ # FIXME this part is build/cpu dependent :/

102
tools/build-lxml.sh Executable file
View file

@ -0,0 +1,102 @@
#!/bin/bash
. $(dirname $0)/environment.sh
if [ ! -f $CACHEROOT/libxml2-$XML2_VERSION.tar.gz ] ; then
try curl -L ftp://xmlsoft.org/libxml2/libxml2-$XML2_VERSION.tar.gz > $CACHEROOT/libxml2-$XML2_VERSION.tar.gz
fi
if [ ! -d $TMPROOT/libxml2-$XML2_VERSION ]; then
try tar xzf $CACHEROOT/libxml2-$XML2_VERSION.tar.gz
try rm -rf $TMPROOT/libxml2-$XML2_VERSION
try mv libxml2-$XML2_VERSION $TMPROOT
fi
if [ ! -f $CACHEROOT/libxslt-$XSLT_VERSION.tar.gz ] ; then
try curl -L ftp://xmlsoft.org/libxml2/libxslt-$XSLT_VERSION.tar.gz > $CACHEROOT/libxslt-$XSLT_VERSION.tar.gz
fi
if [ ! -d $TMPROOT/libxslt-$XSLT_VERSION ]; then
try tar xzf $CACHEROOT/libxslt-$XSLT_VERSION.tar.gz
try rm -rf $TMPROOT/libxslt-$XML2_VERSION
try mv libxslt-$XSLT_VERSION $TMPROOT
fi
if [ ! -f $CACHEROOT/lxml-$LXML_VERSION.tar.gz ]; then
try curl -L http://pypi.python.org/packages/source/l/lxml/lxml-$LXML_VERSION.tar.gz > $CACHEROOT/lxml-$LXML_VERSION.tar.gz
fi
if [ ! -d $TMPROOT/lxml-$LXML_VERSION ]; then
try tar xzf $CACHEROOT/lxml-$LXML_VERSION.tar.gz
try rm -rf $TMPROOT/lxml-$LXML_VERSION
try mv lxml-$LXML_VERSION $TMPROOT
fi
# build libxml2
pushd $TMPROOT/libxml2-$XML2_VERSION
if [ ! -f .libs/libxml2.a ]; then
try ./configure --prefix=/usr/local/iphone \
--host=arm-apple-darwin \
--enable-static=yes \
--enable-shared=no \
--without-modules \
--without-legacy \
--without-history \
--without-debug \
--without-docbook \
--without-python \
--without-iconv \
CC="$ARM_CC" AR="$ARM_AR" \
LDFLAGS="$ARM_LDFLAGS" CFLAGS="$ARM_CFLAGS"
try sed -i '' 's/ runtest\$(EXEEXT) \\/ \\/' Makefile
try sed -i '' 's/ testrecurse\$(EXEEXT)$//' Makefile
try make clean
try make
try cp .libs/libxml2.a $BUILDROOT/lib/libxml2.a
try cp -a include $BUILDROOT/include/libxml2
fi
popd
# build libxslt
pushd $TMPROOT/libxslt-$XSLT_VERSION
if [ ! -f libxslt/.libs/libxslt.a ]; then
try ./configure --build=i686-pc-linux-gnu --host=arm-linux-eabi \
--enable-static=yes \
--enable-shared=no \
--without-plugins \
--without-debug \
--without-python \
--without-crypto \
--with-libxml-src=$TMPROOT/libxml2-$XML2_VERSION \
CC="$ARM_CC" AR="$ARM_AR" \
LDFLAGS="$ARM_LDFLAGS" CFLAGS="$ARM_CFLAGS"
try make clean
try make
try cp libxslt/.libs/libxslt.a $BUILDROOT/lib/libxslt.a
try cp libexslt/.libs/libexslt.a $BUILDROOT/lib/libexslt.a
fi
popd
# build lxml
OLD_CC="$CC"
OLD_LDFLAGS="$LDFLAGS"
OLD_LDSHARED="$LDSHARED"
export CC="$ARM_CC -I$BUILDROOT/include -I$TMPROOT/libxslt-$XSLT_VERSION"
export LDFLAGS="$ARM_LDFLAGS -L$TMPROOT/libxslt-$XSLT_VERSION/libxslt/.libs"
export LDFLAGS="$LDFLAGS -L$TMPROOT/libxslt-$XSLT_VERSION/libexslt/.libs"
export LDFLAGS="$LDFLAGS -L$TMPROOT/libxml2-$XML2_VERSION/.libs"
export LDSHARED="$KIVYIOSROOT/tools/liblink"
pushd $TMPROOT/lxml-$LXML_VERSION
HOSTPYTHON=$TMPROOT/Python-$PYTHON_VERSION/hostpython
try $HOSTPYTHON setup.py build_ext
try $HOSTPYTHON setup.py install -O2
popd
export CC="$OLD_CC"
export LDFLAGS="$OLD_LDFLAGS"
export LDSHARED="$OLD_LDSHARED"
bd=$TMPROOT/lxml-$LXML_VERSION/build/lib.macosx-*/lxml
try $KIVYIOSROOT/tools/biglink $BUILDROOT/lib/liblxml.a $bd
deduplicate $BUILDROOT/lib/liblxml.a

View file

@ -15,6 +15,9 @@ export SDKROOT=$DEVROOT/SDKs/iPhoneOS$SDKVER.sdk
export PYTHON_VERSION=2.7.1 export PYTHON_VERSION=2.7.1
export SDLTTF_VERSION=2.0.10 export SDLTTF_VERSION=2.0.10
export FT_VERSION=2.4.8 export FT_VERSION=2.4.8
export XML2_VERSION=2.7.8
export XSLT_VERSION=1.1.26
export LXML_VERSION=2.3.1
# where the build will be located # where the build will be located
export KIVYIOSROOT="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )/../" && pwd )" export KIVYIOSROOT="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )/../" && pwd )"