diff --git a/Makefile b/Makefile index 27ab723..b29f719 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,32 @@ all: iphoneos iphonesimulator - echo "Building fat lib"; + ./tools/link-fat-lib.sh iphoneos: mkdir -p build/armv7; \ cp -r tools build/armv7/tools; \ cp -r src build/armv7/src; \ export TARGET_SDK=iphoneos; \ - TARGET_SDK=iphoneos build/armv7/tools/build-all.sh; + TARGET_SDK=iphoneos build/armv7/tools/build-all.sh; \ + rm -rf tmp; \ + mkdir -p tmp/; \ + cp -r build/armv7/tmp/Python-2.7.1 tmp/Python-2.7.1; \ + rm -rf build/armv7/tools build/armv7/src build/armv7/tmp; \ + mv build/armv7/build/* build/armv7/; \ + rm -r build/armv7/build; \ + libtool -static -o build/armv7/lib/kivy-ios-all.a build/armv7/lib/lib*; + iphonesimulator: mkdir -p build/i386; \ cp -r tools build/i386/tools; \ cp -r src build/i386/src; \ export TARGET_SDK=iphonesimulator; \ - TARGET_SDK=iphonesimulator build/i386/tools/build-all.sh; + TARGET_SDK=iphonesimulator build/i386/tools/build-all.sh; \ + rm -rf build/i386/tools build/i386/src build/i386/tmp; \ + mv build/i386/build/* build/i386/; \ + rm -r build/i386/build; \ + libtool -static -o build/i386/lib/kivy-ios-all.a build/i386/lib/lib*; clean: rm -rf ./build diff --git a/tools/create-xcode-project.sh b/tools/create-xcode-project.sh index 04eff22..398ccbc 100755 --- a/tools/create-xcode-project.sh +++ b/tools/create-xcode-project.sh @@ -34,8 +34,8 @@ try mkdir $APPDIR echo "-> Copy templates" try cp $TEMPLATESDIR/main.m $APPDIR/main.m -try cp $TEMPLATESDIR/bridge.h $APPDIR/bridge.h -try cp $TEMPLATESDIR/bridge.m $APPDIR/bridge.m +#try cp $TEMPLATESDIR/bridge.h $APPDIR/bridge.h +#try cp $TEMPLATESDIR/bridge.m $APPDIR/bridge.m try cp $TEMPLATESDIR/icon.png $APPDIR/icon.png try cp $TEMPLATESDIR/template-Info.plist $APPDIR/$APPID-Info.plist try cp -a $TEMPLATESDIR/template.xcodeproj $APPDIR/$APPID.xcodeproj diff --git a/tools/link-fat-lib.sh b/tools/link-fat-lib.sh new file mode 100755 index 0000000..318d9ee --- /dev/null +++ b/tools/link-fat-lib.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +echo "== Building fat lib for iphoneos armv7 and simulator i386 =============" + +. $(dirname $0)/environment.sh + +rm -rf $BUILDROOT/include +rm -rf $BUILDROOT/python +rm -rf $BUILDROOT/pkgconfig +rm -rf $BUILDROOT/lib + + +cp -r $BUILDROOT/armv7/include $BUILDROOT/include +cp -r $BUILDROOT/armv7/python $BUILDROOT/python +cp -r $BUILDROOT/armv7/pkgconfig $BUILDROOT/pkgconfig +mkdir -p $BUILDROOT/lib +lipo -create -o $BUILDROOT/lib/kivy-ios-fat.a $BUILDROOT/i386/lib/kivy-ios-all.a $BUILDROOT/armv7/lib/kivy-ios-all.a diff --git a/tools/populate-project.sh b/tools/populate-project.sh index a5b2fbe..4de148c 100755 --- a/tools/populate-project.sh +++ b/tools/populate-project.sh @@ -31,7 +31,8 @@ echo "-> Synchronize source code" try rsync -av --delete $SRCDIR/ $YOURAPPDIR echo "-> Compile to pyo" -$HOSTPYTHON -OO -m compileall $YOURAPPDIR +#$HOSTPYTHON -OO -m compileall $YOURAPPDIR +python -OO -m compileall $YOURAPPDIR #echo "-> Remove unused files (pyc, py)" #find $YOURAPPDIR -iname '*.py' -exec rm {} \; diff --git a/tools/templates/template.xcodeproj/project.pbxproj b/tools/templates/template.xcodeproj/project.pbxproj index 489c694..f2bc236 100755 --- a/tools/templates/template.xcodeproj/project.pbxproj +++ b/tools/templates/template.xcodeproj/project.pbxproj @@ -11,30 +11,19 @@ 010731C4137F20C300A8D3A0 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 010731C3137F20C300A8D3A0 /* QuartzCore.framework */; }; 01532DAA137C099F0076F6BF /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 01532DA9137C099F0076F6BF /* icon.png */; }; 01790B81137E5ED900E037D1 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 01790B7A137E5ED900E037D1 /* OpenGLES.framework */; }; + 12021725181F13DE00466F76 /* kivy-ios-fat.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 12021724181F13DE00466F76 /* kivy-ios-fat.a */; }; 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; 288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765FC0DF74451002DB57D /* CoreGraphics.framework */; }; - 2C18EF8C17CBD2900041C0E1 /* libffi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C18EF8A17CBD2900041C0E1 /* libffi.a */; }; - 2C18EF8D17CBD2900041C0E1 /* libpyobjus.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C18EF8B17CBD2900041C0E1 /* libpyobjus.a */; }; 2CB5F34417D51580006187AB /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2CB5F34317D51580006187AB /* CoreMotion.framework */; }; - 2CB5F34717D5233A006187AB /* bridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CB5F34617D5233A006187AB /* bridge.m */; }; 596C7514150CFC75003F57D9 /* include in Resources */ = {isa = PBXBuildFile; fileRef = 596C7513150CFC75003F57D9 /* include */; }; 5983EC97163CB90D00475EFB /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5983EC96163CB90D00475EFB /* libsqlite3.dylib */; }; - 598E034D14F80187000D1362 /* libSDL_mixer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 598E034C14F80187000D1362 /* libSDL_mixer.a */; }; - 598E035414F80578000D1362 /* libogg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 598E035314F80578000D1362 /* libogg.a */; }; - 598E035A14F8177A000D1362 /* libvorbisidec.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 598E035914F8177A000D1362 /* libvorbisidec.a */; }; 59994D8D148D48E300863906 /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 59994D8C148D48E300863906 /* ImageIO.framework */; }; 59994D90148D686900863906 /* libbz2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 59994D8F148D686900863906 /* libbz2.dylib */; }; 59994D9E148E353000863906 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 59994D9D148E352F00863906 /* libz.dylib */; }; - 59994DAD148E558600863906 /* libfreetype.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 59994DA8148E558600863906 /* libfreetype.a */; }; - 59994DAE148E558600863906 /* libkivy.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 59994DA9148E558600863906 /* libkivy.a */; }; - 59994DAF148E558600863906 /* libpython2.7.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 59994DAA148E558600863906 /* libpython2.7.a */; }; - 59994DB0148E558600863906 /* libSDL_ttf.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 59994DAB148E558600863906 /* libSDL_ttf.a */; }; - 59994DB1148E558600863906 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 59994DAC148E558600863906 /* libSDL2.a */; }; 59994DB3148E564400863906 /* lib in Resources */ = {isa = PBXBuildFile; fileRef = 59994DB2148E564400863906 /* lib */; }; 59994E3B148E85C800863906 /* YourApp in Resources */ = {isa = PBXBuildFile; fileRef = 59994E3A148E85C800863906 /* YourApp */; }; - 59ED7D08150E0C4400A92BEE /* libios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 59ED7D07150E0C4400A92BEE /* libios.a */; }; 59ED7D0B150E325100A92BEE /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 59ED7D0A150E325100A92BEE /* MessageUI.framework */; }; /* End PBXBuildFile section */ @@ -43,33 +32,22 @@ 010731C3137F20C300A8D3A0 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 01532DA9137C099F0076F6BF /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = ""; }; 01790B7A137E5ED900E037D1 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + 12021724181F13DE00466F76 /* kivy-ios-fat.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "kivy-ios-fat.a"; path = "../build/lib/kivy-ios-fat.a"; sourceTree = ""; }; 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 1D6058910D05DD3D006BFB54 /* ##APPNAME##.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ##APPNAME##.app; sourceTree = BUILT_PRODUCTS_DIR; }; 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 288765FC0DF74451002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 2C18EF8A17CBD2900041C0E1 /* libffi.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libffi.a; path = ../build/lib/libffi.a; sourceTree = ""; }; - 2C18EF8B17CBD2900041C0E1 /* libpyobjus.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpyobjus.a; path = ../build/lib/libpyobjus.a; sourceTree = ""; }; 2CB5F34317D51580006187AB /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; }; - 2CB5F34517D5233A006187AB /* bridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bridge.h; sourceTree = SOURCE_ROOT; }; - 2CB5F34617D5233A006187AB /* bridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = bridge.m; sourceTree = SOURCE_ROOT; }; 596C7513150CFC75003F57D9 /* include */ = {isa = PBXFileReference; lastKnownFileType = folder; name = include; path = ../build/python/embed/include; sourceTree = ""; }; 5983EC96163CB90D00475EFB /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; }; - 598E034C14F80187000D1362 /* libSDL_mixer.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libSDL_mixer.a; path = ../build/lib/libSDL_mixer.a; sourceTree = ""; }; - 598E035314F80578000D1362 /* libogg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libogg.a; path = ../build/lib/libogg.a; sourceTree = ""; }; - 598E035914F8177A000D1362 /* libvorbisidec.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libvorbisidec.a; path = ../build/lib/libvorbisidec.a; sourceTree = ""; }; 59994D8C148D48E300863906 /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = System/Library/Frameworks/ImageIO.framework; sourceTree = SDKROOT; }; 59994D8F148D686900863906 /* libbz2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libbz2.dylib; path = usr/lib/libbz2.dylib; sourceTree = SDKROOT; }; 59994D9D148E352F00863906 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; - 59994DA8148E558600863906 /* libfreetype.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfreetype.a; path = ../build/lib/libfreetype.a; sourceTree = ""; }; - 59994DA9148E558600863906 /* libkivy.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libkivy.a; path = ../build/lib/libkivy.a; sourceTree = ""; }; - 59994DAA148E558600863906 /* libpython2.7.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpython2.7.a; path = ../build/lib/libpython2.7.a; sourceTree = ""; }; - 59994DAB148E558600863906 /* libSDL_ttf.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libSDL_ttf.a; path = ../build/lib/libSDL_ttf.a; sourceTree = ""; }; - 59994DAC148E558600863906 /* libSDL2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libSDL2.a; path = ../build/lib/libSDL2.a; sourceTree = ""; }; 59994DB2148E564400863906 /* lib */ = {isa = PBXFileReference; lastKnownFileType = folder; name = lib; path = ../build/python/lib; sourceTree = SOURCE_ROOT; }; 59994E3A148E85C800863906 /* YourApp */ = {isa = PBXFileReference; lastKnownFileType = folder; path = YourApp; sourceTree = ""; }; - 59ED7D07150E0C4400A92BEE /* libios.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libios.a; path = ../build/lib/libios.a; sourceTree = ""; }; 59ED7D0A150E325100A92BEE /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; + 8D1107310486CEB800E47090 /* tracer-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "tracer-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; + 1D6058910D05DD3D006BFB54 /* ##APPNAME##.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ##APPNAME##.app; sourceTree = BUILT_PRODUCTS_DIR; }; 8D1107310486CEB800E47090 /* ##APPID##-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "##APPID##-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -79,19 +57,9 @@ buildActionMask = 2147483647; files = ( 2CB5F34417D51580006187AB /* CoreMotion.framework in Frameworks */, - 2C18EF8C17CBD2900041C0E1 /* libffi.a in Frameworks */, - 2C18EF8D17CBD2900041C0E1 /* libpyobjus.a in Frameworks */, + 12021725181F13DE00466F76 /* kivy-ios-fat.a in Frameworks */, 5983EC97163CB90D00475EFB /* libsqlite3.dylib in Frameworks */, 59ED7D0B150E325100A92BEE /* MessageUI.framework in Frameworks */, - 59ED7D08150E0C4400A92BEE /* libios.a in Frameworks */, - 598E035A14F8177A000D1362 /* libvorbisidec.a in Frameworks */, - 598E035414F80578000D1362 /* libogg.a in Frameworks */, - 598E034D14F80187000D1362 /* libSDL_mixer.a in Frameworks */, - 59994DAD148E558600863906 /* libfreetype.a in Frameworks */, - 59994DAE148E558600863906 /* libkivy.a in Frameworks */, - 59994DAF148E558600863906 /* libpython2.7.a in Frameworks */, - 59994DB0148E558600863906 /* libSDL_ttf.a in Frameworks */, - 59994DB1148E558600863906 /* libSDL2.a in Frameworks */, 59994D90148D686900863906 /* libbz2.dylib in Frameworks */, 59994D9E148E353000863906 /* libz.dylib in Frameworks */, 59994D8D148D48E300863906 /* ImageIO.framework in Frameworks */, @@ -105,7 +73,6 @@ runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ - /* Begin PBXGroup section */ 080E96DDFE201D6D7F000001 /* Classes */ = { isa = PBXGroup; @@ -159,19 +126,9 @@ 29B97323FDCFA39411CA2CEA /* Frameworks */ = { isa = PBXGroup; children = ( + 12021724181F13DE00466F76 /* kivy-ios-fat.a */, 2CB5F34317D51580006187AB /* CoreMotion.framework */, - 2C18EF8A17CBD2900041C0E1 /* libffi.a */, - 2C18EF8B17CBD2900041C0E1 /* libpyobjus.a */, 5983EC96163CB90D00475EFB /* libsqlite3.dylib */, - 59994DA8148E558600863906 /* libfreetype.a */, - 59994DA9148E558600863906 /* libkivy.a */, - 59994DAA148E558600863906 /* libpython2.7.a */, - 59994DAB148E558600863906 /* libSDL_ttf.a */, - 598E035914F8177A000D1362 /* libvorbisidec.a */, - 598E035314F80578000D1362 /* libogg.a */, - 598E034C14F80187000D1362 /* libSDL_mixer.a */, - 59994DAC148E558600863906 /* libSDL2.a */, - 59ED7D07150E0C4400A92BEE /* libios.a */, 59994D9D148E352F00863906 /* libz.dylib */, 59994D8F148D686900863906 /* libbz2.dylib */, 59994D8C148D48E300863906 /* ImageIO.framework */, @@ -181,8 +138,7 @@ 01790B7A137E5ED900E037D1 /* OpenGLES.framework */, 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, 1D30AB110D05D00D00671497 /* Foundation.framework */, - 288765FC0DF74451002DB57D /* CoreGraphics.framework */, - ); + 288765FC0DF74451002DB57D /* CoreGraphics.framework */, ); name = Frameworks; sourceTree = ""; }; @@ -364,7 +320,7 @@ SDKROOT = iphoneos; STRIP_INSTALLED_PRODUCT = YES; STRIP_STYLE = all; - SUPPORTED_PLATFORMS = iphoneos; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; TARGETED_DEVICE_FAMILY = 2; VALID_ARCHS = armv7; }; @@ -389,7 +345,7 @@ "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; SDKROOT = iphoneos; STRIP_INSTALLED_PRODUCT = YES; - SUPPORTED_PLATFORMS = iphoneos; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; TARGETED_DEVICE_FAMILY = 2; USER_HEADER_SEARCH_PATHS = ""; VALID_ARCHS = armv7; @@ -420,4 +376,4 @@ /* End XCConfigurationList section */ }; rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} \ No newline at end of file +}