fix path of all build script + add sdlmixer in build-all

This commit is contained in:
Mathieu Virbel 2012-03-08 20:45:55 +01:00
parent 2eb7ce33ff
commit fcd89f675a
9 changed files with 85 additions and 65 deletions

View file

@ -1,13 +1,14 @@
#!/bin/bash
. environment.sh
. $(dirname $0)/environment.sh
try ./build_python.sh
try ./reduce_python.sh
try ./build_sdl.sh
try ./build_freetype.sh
try ./build_sdlttf.sh
try ./build_kivy.sh
try $(dirname $0)/build-python.sh
try $(dirname $0)/reduce-python.sh
try $(dirname $0)/build-sdl.sh
try $(dirname $0)/build-freetype.sh
try $(dirname $0)/build-sdlttf.sh
try $(dirname $0)/build-sdlmixer.sh
try $(dirname $0)/build-kivy.sh
echo '== Build done'
echo "Available libraries in $BUILDROOT/lib"

View file

@ -1,18 +1,19 @@
#!/bin/bash
. environment.sh
. $(dirname $0)/environment.sh
if [ ! -f $CACHEROOT/freetype-$FT_VERSION.tar.bz2 ]; then
curl -L http://download.savannah.gnu.org/releases/freetype/freetype-$FT_VERSION.tar.bz2 > $CACHEROOT/freetype-$FT_VERSION.tar.bz2
tar xjf $CACHEROOT/freetype-$FT_VERSION.tar.bz2
try curl -L http://download.savannah.gnu.org/releases/freetype/freetype-$FT_VERSION.tar.bz2 > $CACHEROOT/freetype-$FT_VERSION.tar.bz2
try tar xjf $CACHEROOT/freetype-$FT_VERSION.tar.bz2
try mv freetype-$FT_VERSION $TMPROOT
fi
if [ -f freetype-$FT_VERSION/libfreetype-arm7.a ]; then
if [ -f $TMPROOT/freetype-$FT_VERSION/libfreetype-arm7.a ]; then
exit 0;
fi
# lib not found, compile it
pushd freetype-$FT_VERSION
pushd $TMPROOT/freetype-$FT_VERSION
./configure --prefix=/usr/local/iphone \
--host=arm-apple-darwin \
--enable-static=yes \

View file

@ -1,28 +1,30 @@
#!/bin/bash
. environment.sh
. $(dirname $0)/environment.sh
if [ ! -d kivy ] ; then
if [ ! -d $TMPROOT/kivy ] ; then
try pushd $TMPROOT
try git clone https://github.com/kivy/kivy
try cd kivy
try git checkout ios-support
try cd ..
try popd
fi
if [ "X$1" = "X-f" ] ; then
try cd kivy
try pushd $TMPROOT/kivy
try git clean -dxf
try git fetch
try git checkout ios-support
try cd ..
try popd
fi
cd kivy
export LDSHARED="$KIVYIOSROOT/liblink"
pushd $TMPROOT/kivy
export LDSHARED="$KIVYIOSROOT/tools/liblink"
export CFLAGS="$ARM_CFLAGS"
make ios
popd
# FIXME this part is build/cpu dependent :/
bd=build/lib.macosx-*/kivy
try $KIVYIOSROOT/biglink $BUILDROOT/lib/libkivy.a $bd $bd/graphics $bd/core/window $bd/core/text $bd/core/image $bd/core/audio
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
deduplicate $BUILDROOT/lib/libkivy.a

View file

@ -1,27 +1,28 @@
#!/bin/bash
. ./environment.sh
. $(dirname $0)/environment.sh
# credit to:
# http://randomsplat.com/id5-cross-compiling-python-for-embedded-linux.html
# http://latenitesoft.blogspot.com/2008/10/iphone-programming-tips-building-unix.html
# download python and patch if they aren't there
if [ ! -a $CACHEROOT/Python-$PYTHON_VERSION.tar.bz2 ]; then
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
fi
# get rid of old build
rm -rf Python-$PYTHON_VERSION
rm -rf $TMPROOT/Python-$PYTHON_VERSION
try tar -xjf $CACHEROOT/Python-$PYTHON_VERSION.tar.bz2
try pushd ./Python-$PYTHON_VERSION
try mv Python-$PYTHON_VERSION $TMPROOT
try pushd $TMPROOT/Python-$PYTHON_VERSION
# Patch Python for temporary reduce PY_SSIZE_T_MAX otherzise, splitting string doesnet work
try patch -p1 < ../python_files/Python-$PYTHON_VERSION-ssize-t-max.patch
try patch -p1 < ../python_files/Python-$PYTHON_VERSION-dynload.patch
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
# Copy our setup for modules
try cp ../python_files/ModulesSetup Modules/Setup.local
try cp $KIVYIOSROOT/src/python_files/ModulesSetup Modules/Setup.local
echo "Building for native machine ============================================"
@ -36,7 +37,7 @@ try make distclean
echo "Building for iOS ======================================================="
# patch python to cross-compile
try patch -p1 < ../python_files/Python-$PYTHON_VERSION-xcompile.patch
try patch -p1 < $KIVYIOSROOT/src/python_files/Python-$PYTHON_VERSION-xcompile.patch
# set up environment variables for cross compilation
export CPPFLAGS="-I$SDKROOT/usr/lib/gcc/arm-apple-darwin11/4.2.1/include/ -I$SDKROOT/usr/include/"
@ -48,7 +49,7 @@ mkdir extralibs||echo "foo"
ln -s "$SDKROOT/usr/lib/libgcc_s.1.dylib" extralibs/libgcc_s.10.4.dylib || echo "sdf"
# Copy our setup for modules
try cp ../python_files/ModulesSetup Modules/Setup.local
try cp $KIVYIOSROOT/src/python_files/ModulesSetup Modules/Setup.local
try ./configure CC="$ARM_CC" LD="$ARM_LD" \
CFLAGS="$ARM_CFLAGS" LDFLAGS="$ARM_LDFLAGS -Lextralibs/" \

View file

@ -1,8 +1,8 @@
#!/bin/bash
. ./environment.sh
pushd SDL/Xcode-iPhoneOS/SDL
. $(dirname $0)/environment.sh
pushd $KIVYIOSROOT/src/SDL/Xcode-iPhoneOS/SDL
xcodebuild -project SDLiPhoneOS.xcodeproj -target libSDL -configuration Release -sdk iphoneos5.0
popd
cp SDL/Xcode-iPhoneOS/SDL/build/Release-iPhoneOS/libSDL.a $BUILDROOT/lib
cp -a SDL/include $BUILDROOT/include/SDL
cp src/SDL/Xcode-iPhoneOS/SDL/build/Release-iPhoneOS/libSDL.a $BUILDROOT/lib
cp -a src/SDL/include $BUILDROOT/include/SDL

View file

@ -1,36 +1,42 @@
#!/bin/bash
. environment.sh
. $(dirname $0)/environment.sh
pushd $TMPROOT
if [ ! -f SDL ]; then
ln -s $KIVYIOSROOT/src/SDL SDL
fi
if [ ! -d SDL_mixer ]; then
hg clone http://hg.libsdl.org/SDL_mixer/
try hg clone http://hg.libsdl.org/SDL_mixer/
fi
if [ ! -d libtremor ]; then
mkdir libtremor
cd libtremor
svn co http://svn.xiph.org/trunk/Tremor tremor
cd ..
try mkdir libtremor
try cd libtremor
try svn co http://svn.xiph.org/trunk/Tremor tremor
try cd ..
fi
if [ ! -d libogg ]; then
curl -L http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz > .cache/libogg-1.3.0.tar.gz
tar xzf .cache/libogg-1.3.0.tar.gz
mv libogg-1.3.0 libogg
try curl -L http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz > $CACHEROOT/libogg-1.3.0.tar.gz
try tar xzf $CACHEROOT/libogg-1.3.0.tar.gz
try mv libogg-1.3.0 libogg
fi
if [ ! -f libogg/src/.libs/libogg.a ]; then
cd libogg
./configure --disable-shared \
try cd libogg
try ./configure --disable-shared \
--host=arm-apple-darwin \
--enable-static=yes \
--enable-shared=no \
CC="$ARM_CC" AR="$ARM_AR" \
LDFLAGS="$ARM_LDFLAGS" CFLAGS="$ARM_CFLAGS"
make
cd ..
try make
try cd ..
fi
if [ ! -f libtremor/tremor/.libs/libvorbisidec.a ]; then
cd libtremor/tremor
try cd libtremor/tremor
echo > asm_arm.h
CC="$ARM_CC" AR="$ARM_AR" \
LDFLAGS="$ARM_LDFLAGS" CFLAGS="$ARM_CFLAGS" \
@ -40,20 +46,26 @@ if [ ! -f libtremor/tremor/.libs/libvorbisidec.a ]; then
--enable-static=yes \
--enable-shared=no \
--with-ogg-includes=../../libogg/include
make
cd ../..
try make
try cd ../..
fi
cp libogg/src/.libs/libogg.a $BUILDROOT/lib
cp libtremor/tremor/.libs/libvorbisidec.a $BUILDROOT/lib
popd
if [ -f SDL_mixer/libSDL_mixer-arm7.a ]; then
try cp $TMPROOT/libogg/src/.libs/libogg.a $BUILDROOT/lib
try cp $TMPROOT/libtremor/tremor/.libs/libvorbisidec.a $BUILDROOT/lib
if [ -f $TMPROOT/SDL_mixer/libSDL_mixer-arm7.a ]; then
exit 0;
fi
pushd SDL_mixer/Xcode-iOS
xcodebuild -project SDL_mixer.xcodeproj -configuration Release
if [ ! -f $TMPROOT/libtremor/ogg ]; then
ln -s $TMPROOT/libogg/include/ogg $TMPROOT/libtremor
fi
pushd $TMPROOT/SDL_mixer/Xcode-iOS
try xcodebuild -project SDL_mixer.xcodeproj -configuration Release
popd
cp SDL_mixer/Xcode-iOS/build/Release-iphoneos/libSDL_mixer.a $BUILDROOT/lib
cp -a SDL_mixer/SDL_mixer.h $BUILDROOT/include
try cp $TMPROOT/SDL_mixer/Xcode-iOS/build/Release-iphoneos/libSDL_mixer.a $BUILDROOT/lib
try cp -a $TMPROOT/SDL_mixer/SDL_mixer.h $BUILDROOT/include

View file

@ -1,14 +1,15 @@
#!/bin/bash
. environment.sh
. $(dirname $0)/environment.sh
if [ ! -f $CACHEROOT/SDL_ttf-$SDLTTF_VERSION.tar.gz ]; then
curl -L http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-$SDLTTF_VERSION.tar.gz > $CACHEROOT/SDL_ttf-$SDLTTF_VERSION.tar.gz
tar xzf $CACHEROOT/SDL_ttf-$SDLTTF_VERSION.tar.gz
try curl -L http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-$SDLTTF_VERSION.tar.gz > $CACHEROOT/SDL_ttf-$SDLTTF_VERSION.tar.gz
try tar xzf $CACHEROOT/SDL_ttf-$SDLTTF_VERSION.tar.gz
try mv SDL_ttf-$SDLTTF_VERSION $TMPROOT
fi
if [ ! -f SDL_ttf-$SDLTTF_VERSION/.libs/libSDL_ttf.a ]; then
pushd SDL_ttf-$SDLTTF_VERSION
if [ ! -f $TMPROOT/SDL_ttf-$SDLTTF_VERSION/.libs/libSDL_ttf.a ]; then
pushd $TMPROOT/SDL_ttf-$SDLTTF_VERSION
rm libSDL_ttf.la
./configure --prefix=/usr/local/iphone \
--host=arm-apple-darwin \
@ -24,5 +25,5 @@ fi
# copy to buildroot
cp SDL_ttf-$SDLTTF_VERSION/.libs/libSDL_ttf.a $BUILDROOT/lib/libSDL_ttf.a
cp -a SDL_ttf-$SDLTTF_VERSION/SDL_ttf.h $BUILDROOT/include
cp $TMPROOT/SDL_ttf-$SDLTTF_VERSION/.libs/libSDL_ttf.a $BUILDROOT/lib/libSDL_ttf.a
cp -a $TMPROOT/SDL_ttf-$SDLTTF_VERSION/SDL_ttf.h $BUILDROOT/include

View file

@ -19,6 +19,7 @@ export FT_VERSION=2.4.8
# where the build will be located
export KIVYIOSROOT="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )/../" && pwd )"
export BUILDROOT="$KIVYIOSROOT/build"
export TMPROOT="$KIVYIOSROOT/tmp"
export CACHEROOT="$KIVYIOSROOT/.cache"
# some tools
@ -44,6 +45,7 @@ try mkdir -p $BUILDROOT
try mkdir -p $BUILDROOT/include
try mkdir -p $BUILDROOT/lib
try mkdir -p $CACHEROOT
try mkdir -p $TMPROOT
# one method to deduplicate some symbol in libraries
function deduplicate() {

View file

@ -1,6 +1,6 @@
#!/bin/bash
. environment.sh
. $(dirname $0)/environment.sh
echo "Starting reducing=========="