diff --git a/.gitignore b/.gitignore index 8716774..9129d43 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ build/* SDL/Xcode-iPhoneOS/SDL/build/ kivy/* libtremor/* +libogg/* + diff --git a/app/YourApp/.empty b/app/YourApp/.empty deleted file mode 100644 index e69de29..0000000 diff --git a/app/main.m b/app/main.m index 5182d3c..63f1852 100644 --- a/app/main.m +++ b/app/main.m @@ -25,8 +25,12 @@ int main(int argc, char *argv[]) { // Kivy environment to prefer some implementation on ios platform putenv("KIVY_BUILD=ios"); + putenv("KIVY_NO_CONFIG=1"); + putenv("KIVY_NO_FILELOG=1"); + putenv("KIVY_NO_CONSOLELOG=1"); putenv("KIVY_WINDOW=sdl"); putenv("KIVY_IMAGE=imageio"); + putenv("KIVY_AUDIO=sdl"); NSString * resourcePath = [[NSBundle mainBundle] resourcePath]; NSLog(@"PythonHome is: %s", (char *)[resourcePath UTF8String]); @@ -41,13 +45,13 @@ int main(int argc, char *argv[]) { // Search and start main.py const char * prog = [ - [[NSBundle mainBundle] pathForResource:@"YourApp/main" ofType:@"py"] cStringUsingEncoding: + [[NSBundle mainBundle] pathForResource:@"YourApp/main" ofType:@"pyo"] cStringUsingEncoding: NSUTF8StringEncoding]; - NSLog(@"Running main.py: %s", prog); + NSLog(@"Running main.pyo: %s", prog); FILE* fd = fopen(prog, "r"); if ( fd == NULL ) { ret = 1; - NSLog(@"Unable to open main.py, abort."); + NSLog(@"Unable to open main.pyo, abort."); } else { ret = PyRun_SimpleFileEx(fd, prog, 1); if (ret != 0) diff --git a/build_kivy.sh b/build_kivy.sh index 29df863..6d0684e 100755 --- a/build_kivy.sh +++ b/build_kivy.sh @@ -24,5 +24,5 @@ make ios # 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 +try $KIVYIOSROOT/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 diff --git a/build_sdl.sh b/build_sdl.sh index 64e307a..e8abec3 100755 --- a/build_sdl.sh +++ b/build_sdl.sh @@ -1,8 +1,8 @@ #!/bin/bash . ./environment.sh pushd SDL/Xcode-iPhoneOS/SDL -xcodebuild -project SDLiPhoneOS.xcodeproj -target libSDL -configuration Debug -sdk iphoneos5.0 +xcodebuild -project SDLiPhoneOS.xcodeproj -target libSDL -configuration Release -sdk iphoneos5.0 popd -cp SDL/Xcode-iPhoneOS/SDL/build/Debug-iPhoneOS/libSDL.a $BUILDROOT/lib +cp SDL/Xcode-iPhoneOS/SDL/build/Release-iPhoneOS/libSDL.a $BUILDROOT/lib cp -a SDL/include $BUILDROOT/include/SDL diff --git a/build_sdlmixer.sh b/build_sdlmixer.sh index b708a12..848a7c5 100755 --- a/build_sdlmixer.sh +++ b/build_sdlmixer.sh @@ -11,14 +11,49 @@ if [ ! -d libtremor ]; then svn co http://svn.xiph.org/trunk/Tremor tremor 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 +fi + +if [ ! -f libogg/src/.libs/libogg.a ]; then + cd libogg + ./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 .. +fi + +if [ ! -f libtremor/tremor/.libs/libvorbisidec.a ]; then + cd libtremor/tremor + echo > asm_arm.h + CC="$ARM_CC" AR="$ARM_AR" \ + LDFLAGS="$ARM_LDFLAGS" CFLAGS="$ARM_CFLAGS" \ + ACLOCAL_FLAGS="-I /usr/local/share/aclocal" ./autogen.sh \ + --disable-shared \ + --host=arm-apple-darwin \ + --enable-static=yes \ + --enable-shared=no \ + --with-ogg-includes=../../libogg/include + make + cd ../.. +fi + +cp libogg/src/.libs/libogg.a $BUILDROOT/lib +cp libtremor/tremor/.libs/libvorbisidec.a $BUILDROOT/lib if [ -f SDL_mixer/libSDL_mixer-arm7.a ]; then exit 0; fi pushd SDL_mixer/Xcode-iOS -xcodebuild -project SDL_mixer.xcodeproj -configuration Debug +xcodebuild -project SDL_mixer.xcodeproj -configuration Release popd -cp SDL_mixer/Xcode-iOS/build/Debug-iphoneos/libSDL_mixer.a $BUILDROOT/lib +cp SDL_mixer/Xcode-iOS/build/Release-iphoneos/libSDL_mixer.a $BUILDROOT/lib cp -a SDL_mixer/SDL_mixer.h $BUILDROOT/include diff --git a/build_sdlttf.sh b/build_sdlttf.sh index 591f1ab..d1da0a8 100755 --- a/build_sdlttf.sh +++ b/build_sdlttf.sh @@ -7,25 +7,22 @@ if [ ! -f $CACHEROOT/SDL_ttf-$SDLTTF_VERSION.tar.gz ]; then tar xzf $CACHEROOT/SDL_ttf-$SDLTTF_VERSION.tar.gz fi -if [ -f SDL_ttf-$SDLTTF_VERSION/libSDL_ttf-arm7.a ]; then - exit 0; +if [ ! -f SDL_ttf-$SDLTTF_VERSION/.libs/libSDL_ttf.a ]; then + pushd SDL_ttf-$SDLTTF_VERSION + rm libSDL_ttf.la + ./configure --prefix=/usr/local/iphone \ + --host=arm-apple-darwin \ + --enable-static=yes \ + --enable-shared=no \ + --without-x \ + CC="$ARM_CC" AR="$ARM_AR" \ + LDFLAGS="$ARM_LDFLAGS" CFLAGS="$ARM_CFLAGS" + make clean + make libSDL_ttf.la + popd fi -pushd SDL_ttf-$SDLTTF_VERSION -rm libSDL_ttf.la -./configure --prefix=/usr/local/iphone \ - --host=arm-apple-darwin \ - --enable-static=yes \ - --enable-shared=no \ - --without-x \ - CC="$ARM_CC" AR="$ARM_AR" \ - LDFLAGS="$ARM_LDFLAGS" CFLAGS="$ARM_CFLAGS" -make clean -make libSDL_ttf.la - # copy to buildroot -cp .libs/libSDL_ttf.a $BUILDROOT/lib/libSDL_ttf.a -cp -a SDL_ttf.h $BUILDROOT/include - -popd +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 diff --git a/environment.sh b/environment.sh index ec5872c..5ab3010 100755 --- a/environment.sh +++ b/environment.sh @@ -35,8 +35,9 @@ export ARM_CFLAGS="$ARM_CFLAGS -miphoneos-version-min=$SDKVER" export ARM_LDFLAGS="-isysroot $SDKROOT" export ARM_LDFLAGS="$ARM_LDFLAGS -miphoneos-version-min=$SDKVER" -# comment this line if you want debugging stuff -export ARM_CFLAGS="$ARM_CFLAGS -O0 -g" +# uncomment this line if you want debugging stuff +export ARM_CFLAGS="$ARM_CFLAGS -O3" +#export ARM_CFLAGS="$ARM_CFLAGS -O0 -g" # create build directory if not found try mkdir -p $BUILDROOT