diff --git a/templates/icon.png b/templates/icon.png new file mode 100644 index 0000000..c499b4b Binary files /dev/null and b/templates/icon.png differ diff --git a/templates/main.m b/templates/main.m new file mode 100644 index 0000000..63f1852 --- /dev/null +++ b/templates/main.m @@ -0,0 +1,69 @@ +// +// main.m +// iOS-python-test +// + +#import +#import +#include +#include "SDL/SDL_main.h" +#include + +int main(int argc, char *argv[]) { + int ret = 0; + + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + + // Change the executing path to YourApp + chdir("YourApp"); + + // Special environment to prefer .pyo, and don't write bytecode if .py are found + // because the process will not have write attribute on the device. + putenv("PYTHONOPTIMIZE=2"); + putenv("PYTHONDONTWRITEBYTECODE=1"); + putenv("PYTHONNOUSERSITE=1"); + + // 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]); + Py_SetPythonHome((char *)[resourcePath UTF8String]); + + NSLog(@"Initializing python"); + Py_Initialize(); + PySys_SetArgv(argc, argv); + + // If other modules are using thread, we need to initialize them before. + PyEval_InitThreads(); + + // Search and start main.py + const char * prog = [ + [[NSBundle mainBundle] pathForResource:@"YourApp/main" ofType:@"pyo"] cStringUsingEncoding: + NSUTF8StringEncoding]; + NSLog(@"Running main.pyo: %s", prog); + FILE* fd = fopen(prog, "r"); + if ( fd == NULL ) { + ret = 1; + NSLog(@"Unable to open main.pyo, abort."); + } else { + ret = PyRun_SimpleFileEx(fd, prog, 1); + if (ret != 0) + NSLog(@"Application quit abnormally!"); + } + + Py_Finalize(); + NSLog(@"Leaving"); + + [pool release]; + + // Look like the app still runn even when we leaved here. + exit(ret); + return ret; +} diff --git a/templates/template-Info.plist b/templates/template-Info.plist new file mode 100644 index 0000000..6266a81 --- /dev/null +++ b/templates/template-Info.plist @@ -0,0 +1,51 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIconFiles + + icon.png + + CFBundleIcons + + CFBundlePrimaryIcon + + CFBundleIconFiles + + icon.png + + UIPrerenderedIcon + + + + CFBundleIdentifier + org.kivy.##APPID## + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.1 + CFBundleSignature + ???? + CFBundleVersion + 1.1 + LSRequiresIPhoneOS + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/templates/template.xcodeproj/project.pbxproj b/templates/template.xcodeproj/project.pbxproj new file mode 100755 index 0000000..da6ac0e --- /dev/null +++ b/templates/template.xcodeproj/project.pbxproj @@ -0,0 +1,373 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 010731C2137F20B800A8D3A0 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 010731C1137F20B800A8D3A0 /* AudioToolbox.framework */; }; + 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 */; }; + 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 */; }; + 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 /* libSDL.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 59994DAC148E558600863906 /* libSDL.a */; }; + 59994DB3148E564400863906 /* lib in Resources */ = {isa = PBXBuildFile; fileRef = 59994DB2148E564400863906 /* lib */; }; + 59994E35148E815300863906 /* include in Resources */ = {isa = PBXBuildFile; fileRef = 59994E34148E815300863906 /* include */; }; + 59994E3B148E85C800863906 /* YourApp in Resources */ = {isa = PBXBuildFile; fileRef = 59994E3A148E85C800863906 /* YourApp */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 010731C1137F20B800A8D3A0 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + 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; }; + 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 = ""; }; + 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 /* libSDL.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libSDL.a; path = ../build/lib/libSDL.a; sourceTree = ""; }; + 59994DB2148E564400863906 /* lib */ = {isa = PBXFileReference; lastKnownFileType = folder; name = lib; path = ../build/python/lib; sourceTree = SOURCE_ROOT; }; + 59994E34148E815300863906 /* include */ = {isa = PBXFileReference; lastKnownFileType = folder; name = include; path = ../build/python/include; sourceTree = SOURCE_ROOT; }; + 59994E3A148E85C800863906 /* YourApp */ = {isa = PBXFileReference; lastKnownFileType = folder; path = YourApp; sourceTree = ""; }; + 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 */ + +/* Begin PBXFrameworksBuildPhase section */ + 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 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 /* libSDL.a in Frameworks */, + 59994D90148D686900863906 /* libbz2.dylib in Frameworks */, + 59994D9E148E353000863906 /* libz.dylib in Frameworks */, + 59994D8D148D48E300863906 /* ImageIO.framework in Frameworks */, + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, + 288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */, + 01790B81137E5ED900E037D1 /* OpenGLES.framework in Frameworks */, + 010731C2137F20B800A8D3A0 /* AudioToolbox.framework in Frameworks */, + 010731C4137F20C300A8D3A0 /* QuartzCore.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 080E96DDFE201D6D7F000001 /* Classes */ = { + isa = PBXGroup; + children = ( + ); + path = Classes; + sourceTree = ""; + }; + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 1D6058910D05DD3D006BFB54 /* ##APPNAME##.app */, + ); + name = Products; + sourceTree = ""; + }; + 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { + isa = PBXGroup; + children = ( + 080E96DDFE201D6D7F000001 /* Classes */, + 29B97315FDCFA39411CA2CEA /* Other Sources */, + 29B97317FDCFA39411CA2CEA /* Resources */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, + ); + name = CustomTemplate; + sourceTree = ""; + }; + 29B97315FDCFA39411CA2CEA /* Other Sources */ = { + isa = PBXGroup; + children = ( + 59994E34148E815300863906 /* include */, + 29B97316FDCFA39411CA2CEA /* main.m */, + ); + name = "Other Sources"; + sourceTree = ""; + }; + 29B97317FDCFA39411CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + 59994DB2148E564400863906 /* lib */, + 59994E3A148E85C800863906 /* YourApp */, + 01532DA9137C099F0076F6BF /* icon.png */, + 8D1107310486CEB800E47090 /* ##APPID##-Info.plist */, + ); + name = Resources; + sourceTree = ""; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 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 /* libSDL.a */, + 59994D9D148E352F00863906 /* libz.dylib */, + 59994D8F148D686900863906 /* libbz2.dylib */, + 59994D8C148D48E300863906 /* ImageIO.framework */, + 010731C1137F20B800A8D3A0 /* AudioToolbox.framework */, + 010731C3137F20C300A8D3A0 /* QuartzCore.framework */, + 01790B7A137E5ED900E037D1 /* OpenGLES.framework */, + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, + 1D30AB110D05D00D00671497 /* Foundation.framework */, + 288765FC0DF74451002DB57D /* CoreGraphics.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 1D6058900D05DD3D006BFB54 /* ##APPID## */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "##APPID##" */; + buildPhases = ( + 1D60588D0D05DD3D006BFB54 /* Resources */, + 1D60588E0D05DD3D006BFB54 /* Sources */, + 1D60588F0D05DD3D006BFB54 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ##APPID##; + productName = ##APPID##; + productReference = 1D6058910D05DD3D006BFB54 /* ##APPNAME##.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "##APPID##" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 1D6058900D05DD3D006BFB54 /* ##APPID## */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 1D60588D0D05DD3D006BFB54 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 01532DAA137C099F0076F6BF /* icon.png in Resources */, + 59994DB3148E564400863906 /* lib in Resources */, + 59994E35148E815300863906 /* include in Resources */, + 59994E3B148E85C800863906 /* YourApp in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 1D60588E0D05DD3D006BFB54 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1D60589B0D05DD56006BFB54 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 1D6058940D05DD3E006BFB54 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CODE_SIGN_IDENTITY = "iPhone Distribution"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ""; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + HEADER_SEARCH_PATHS = ( + "\"$(PROJECT_DIR)/../build/include\"", + "\"$(PROJECT_DIR)/../build/python/include\"", + ); + INFOPLIST_FILE = "##APPID##-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(PROJECT_DIR)/../build/lib\"", + ); + OTHER_LDFLAGS = "-all_load"; + PRODUCT_NAME = ##APPNAME##; + PROVISIONING_PROFILE = ""; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; + SDKROOT = iphoneos; + USER_HEADER_SEARCH_PATHS = ""; + }; + name = Debug; + }; + 1D6058950D05DD3E006BFB54 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CODE_SIGN_IDENTITY = "iPhone Distribution"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + COPY_PHASE_STRIP = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ""; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + HEADER_SEARCH_PATHS = ( + "\"$(PROJECT_DIR)/../build/include\"", + "\"$(PROJECT_DIR)/../build/python/include\"", + ); + INFOPLIST_FILE = "##APPID##-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(PROJECT_DIR)/../build/lib\"", + ); + OTHER_LDFLAGS = "-all_load"; + PRODUCT_NAME = ##APPNAME##; + PROVISIONING_PROFILE = ""; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; + SDKROOT = iphoneos; + SKIP_INSTALL = NO; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CODE_SIGN_IDENTITY = "iPhone Distribution"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + COPY_PHASE_STRIP = YES; + DEAD_CODE_STRIPPING = NO; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_VERSION = com.apple.compilers.llvmgcc42; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ""; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + ONLY_ACTIVE_ARCH = YES; + PROVISIONING_PROFILE = ""; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; + SDKROOT = iphoneos; + STRIP_INSTALLED_PRODUCT = YES; + STRIP_STYLE = all; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = 2; + USER_HEADER_SEARCH_PATHS = "/Users/dennda/dev/sdl-1.3/Xcode-iPhoneOS/SDL/build/Debug-iphoneos/usr/local/include/"; + VALID_ARCHS = armv7; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CODE_SIGN_IDENTITY = "iPhone Distribution"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + COPY_PHASE_STRIP = YES; + DEAD_CODE_STRIPPING = NO; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_VERSION = com.apple.compilers.llvmgcc42; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + ONLY_ACTIVE_ARCH = YES; + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + PROVISIONING_PROFILE = ""; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; + SDKROOT = iphoneos; + STRIP_INSTALLED_PRODUCT = YES; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = 2; + USER_HEADER_SEARCH_PATHS = ""; + VALID_ARCHS = armv7; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "##APPID##" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1D6058940D05DD3E006BFB54 /* Debug */, + 1D6058950D05DD3E006BFB54 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "##APPID##" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff --git a/templates/template.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/templates/template.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..abc43a5 --- /dev/null +++ b/templates/template.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/biglink b/tools/biglink similarity index 100% rename from biglink rename to tools/biglink diff --git a/build_all.sh b/tools/build_all.sh similarity index 100% rename from build_all.sh rename to tools/build_all.sh diff --git a/build_freetype.sh b/tools/build_freetype.sh similarity index 100% rename from build_freetype.sh rename to tools/build_freetype.sh diff --git a/build_kivy.sh b/tools/build_kivy.sh similarity index 100% rename from build_kivy.sh rename to tools/build_kivy.sh diff --git a/build_python.sh b/tools/build_python.sh similarity index 100% rename from build_python.sh rename to tools/build_python.sh diff --git a/build_sdl.sh b/tools/build_sdl.sh similarity index 100% rename from build_sdl.sh rename to tools/build_sdl.sh diff --git a/build_sdlmixer.sh b/tools/build_sdlmixer.sh similarity index 100% rename from build_sdlmixer.sh rename to tools/build_sdlmixer.sh diff --git a/build_sdlttf.sh b/tools/build_sdlttf.sh similarity index 100% rename from build_sdlttf.sh rename to tools/build_sdlttf.sh diff --git a/clean_python.sh b/tools/clean_python.sh similarity index 100% rename from clean_python.sh rename to tools/clean_python.sh diff --git a/tools/create-xcode-project.sh b/tools/create-xcode-project.sh new file mode 100755 index 0000000..8a5d0e9 --- /dev/null +++ b/tools/create-xcode-project.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +try () { + "$@" || exit -1 +} + +APPNAME=$1 +APPID=$(echo $APPNAME | tr '[A-Z]' '[a-z]') +TEMPLATESDIR=$(dirname $0)/templates/ +APPDIR=$(dirname $0)/app-$APPID +if [ "X$APPNAME" == "X" ]; then + echo $(basename $0) "" + exit 1 +fi + +echo "-> Create $APPDIR directory" +try mkdir $APPDIR + +echo "-> Copy templates" +try cp $TEMPLATESDIR/main.m $APPDIR/main.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 + +echo "-> Customize templates" +try find $APPDIR -type f -exec sed -i '' "s/##APPID##/$APPID/g" {} \; +try find $APPDIR -type f -exec sed -i '' "s/##APPNAME##/$APPNAME/g" {} \; + +echo "-> Done !" + +echo +echo "Your project is available at $APPDIR" +echo +echo "You can now type: open $APPDIR/$APPID.xcodeproj" +echo diff --git a/environment.sh b/tools/environment.sh similarity index 95% rename from environment.sh rename to tools/environment.sh index 5ab3010..b716dfc 100755 --- a/environment.sh +++ b/tools/environment.sh @@ -17,7 +17,7 @@ export SDLTTF_VERSION=2.0.10 export FT_VERSION=2.4.8 # where the build will be located -export KIVYIOSROOT="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +export KIVYIOSROOT="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )/../" && pwd )" export BUILDROOT="$KIVYIOSROOT/build" export CACHEROOT="$KIVYIOSROOT/.cache" diff --git a/liblink b/tools/liblink similarity index 100% rename from liblink rename to tools/liblink diff --git a/tools/populate-project.sh b/tools/populate-project.sh new file mode 100755 index 0000000..8f0cd86 --- /dev/null +++ b/tools/populate-project.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +try () { + "$@" || exit -1 +} + +APPNAME=$1 +APPID=$(echo $APPNAME | tr '[A-Z]' '[a-z]') +APPDIR=$(dirname $0)/app-$APPID +SRCDIR=$2 + +if [ "X$APPNAME" == "X" ]; then + echo $(basename $0) " " + exit 1 +fi + +if [ "X$SRCDIR" == "X" ]; then + echo $(basename $0) " " + exit 1 +fi + +echo "-> Copy $SRCDIR to $APPDIR/YourApp" +YOURAPPDIR=$APPDIR/YourApp + +echo "-> Remove any previous YourApp version" +rm -r $YOURAPPDIR + +echo "-> Copy the new source" +try cp -a $SRCDIR $YOURAPPDIR + +echo "-> Compile to pyo" +python -OO -m compileall $YOURAPPDIR + +echo "-> Remove unused files (pyc, py)" +find $YOURAPPDIR -iname '*.py' -exec rm {} \; +find $YOURAPPDIR -iname '*.pyc' -exec rm {} \; + + +echo "-> Source code of $APPNAME updated." + diff --git a/reduce_python.sh b/tools/reduce_python.sh similarity index 100% rename from reduce_python.sh rename to tools/reduce_python.sh