Rev 3 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3 | Rev 4 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #!/bin/bash |
1 | #!/bin/bash |
2 | 2 | ||
- | 3 | MY_PATH=`dirname "$0"` |
|
- | 4 | APP_NAME="Rick Dangerous" |
|
- | 5 | APP_VERSION="1.2" |
|
- | 6 | APP_COPYRIGHT="© 2016 Pierre-Marie Baty |
|
- | 7 | © 2002 BigOrno |
|
- | 8 | © 1989 CORE Design |
|
- | 9 | Artwork by Simon Phipps" |
|
- | 10 | BUNDLE_ID="com.pmbaty.rick.rickdangerous" |
|
- | 11 | ICON_FILE="rick.png" |
|
- | 12 | ||
- | 13 | cd "${MY_PATH}" |
|
- | 14 | ||
- | 15 | rm -rf "${APP_NAME}.app" |
|
- | 16 | ||
- | 17 | mkdir "${APP_NAME}.app" |
|
- | 18 | mkdir "${APP_NAME}.app/Contents" |
|
- | 19 | mkdir "${APP_NAME}.app/Contents/MacOS" |
|
- | 20 | mkdir "${APP_NAME}.app/Contents/Frameworks" |
|
- | 21 | mkdir "${APP_NAME}.app/Contents/Resources" |
|
- | 22 | ||
- | 23 | cp -r "SDL.framework" "${APP_NAME}.app/Contents/Frameworks" |
|
- | 24 | ||
3 | gcc *.c osx-sdlmain.m -ISDL.framework/Headers -framework Foundation -framework Cocoa -F. -framework SDL -o " |
25 | gcc *.c osx-sdlmain.m -ISDL.framework/Headers -framework Foundation -framework Cocoa -F. -framework SDL -o "${APP_NAME}.app/Contents/MacOS/${APP_NAME}" |
- | 26 | if [ ! "_$?" = "_0" ]; then |
|
- | 27 | rm -rf "${APP_NAME}.app" |
|
- | 28 | exit |
|
- | 29 | fi |
|
4 | install_name_tool -add_rpath "@loader_path |
30 | install_name_tool -add_rpath "@loader_path/../Frameworks" "${APP_NAME}.app/Contents/MacOS/${APP_NAME}" |
- | 31 | if [ ! "_$?" = "_0" ]; then |
|
- | 32 | rm -rf "${APP_NAME}.app" |
|
- | 33 | exit |
|
- | 34 | fi |
|
- | 35 | ||
- | 36 | mkdir "__${APP_NAME}.iconset" |
|
- | 37 | sips -z 16 16 "${ICON_FILE}" --out "__${APP_NAME}.iconset/icon_16x16.png" > /dev/null |
|
- | 38 | sips -z 32 32 "${ICON_FILE}" --out "__${APP_NAME}.iconset/icon_16x16@2x.png" > /dev/null |
|
- | 39 | sips -z 32 32 "${ICON_FILE}" --out "__${APP_NAME}.iconset/icon_32x32.png" > /dev/null |
|
- | 40 | sips -z 64 64 "${ICON_FILE}" --out "__${APP_NAME}.iconset/icon_32x32@2x.png" > /dev/null |
|
- | 41 | sips -z 128 128 "${ICON_FILE}" --out "__${APP_NAME}.iconset/icon_128x128.png" > /dev/null |
|
- | 42 | sips -z 256 256 "${ICON_FILE}" --out "__${APP_NAME}.iconset/icon_128x128@2x.png" > /dev/null |
|
- | 43 | sips -z 256 256 "${ICON_FILE}" --out "__${APP_NAME}.iconset/icon_256x256.png" > /dev/null |
|
- | 44 | sips -z 512 512 "${ICON_FILE}" --out "__${APP_NAME}.iconset/icon_256x256@2x.png" > /dev/null |
|
- | 45 | sips -z 512 512 "${ICON_FILE}" --out "__${APP_NAME}.iconset/icon_512x512.png" > /dev/null |
|
- | 46 | sips -z 1024 1024 "${ICON_FILE}" --out "__${APP_NAME}.iconset/icon_512x512@2x.png" > /dev/null |
|
- | 47 | iconutil -c icns "__${APP_NAME}.iconset" |
|
- | 48 | if [ ! "_$?" = "_0" ]; then |
|
- | 49 | rm -rf "__${APP_NAME}.iconset" |
|
- | 50 | rm -rf "${APP_NAME}.app" |
|
- | 51 | exit |
|
- | 52 | fi |
|
- | 53 | rm -rf "__${APP_NAME}.iconset" |
|
- | 54 | mv "__${APP_NAME}.icns" "${APP_NAME}.app/Contents/Resources/${APP_NAME}.icns" |
|
- | 55 | ||
- | 56 | cp -r "../sounds" "${APP_NAME}.app/Contents/Resources" |
|
- | 57 | ||
- | 58 | echo -n "APPL???" > "${APP_NAME}.app/Contents/PkgInfo" |
|
- | 59 | ||
- | 60 | echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > "${APP_NAME}.app/Contents/Info.plist" |
|
- | 61 | echo "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">" >> "${APP_NAME}.app/Contents/Info.plist" |
|
- | 62 | echo "<plist version=\"1.0\">" >> "${APP_NAME}.app/Contents/Info.plist" |
|
- | 63 | echo "<dict>" >> "${APP_NAME}.app/Contents/Info.plist" |
|
- | 64 | echo " <key>CFBundleDevelopmentRegion</key>" >> "${APP_NAME}.app/Contents/Info.plist" |
|
- | 65 | echo " <string>en</string>" >> "${APP_NAME}.app/Contents/Info.plist" |
|
- | 66 | echo " <key>CFBundleExecutable</key>" >> "${APP_NAME}.app/Contents/Info.plist" |
|
- | 67 | echo " <string>${APP_NAME}</string>" >> "${APP_NAME}.app/Contents/Info.plist" |
|
- | 68 | echo " <key>CFBundleIconFile</key>" >> "${APP_NAME}.app/Contents/Info.plist" |
|
- | 69 | echo " <string>${APP_NAME}.icns</string>" >> "${APP_NAME}.app/Contents/Info.plist" |
|
- | 70 | echo " <key>CFBundleIdentifier</key>" >> "${APP_NAME}.app/Contents/Info.plist" |
|
- | 71 | echo " <string>${BUNDLE_ID}</string>" >> "${APP_NAME}.app/Contents/Info.plist" |
|
- | 72 | echo " <key>CFBundleInfoDictionaryVersion</key>" >> "${APP_NAME}.app/Contents/Info.plist" |
|
- | 73 | echo " <string>6.0</string>" >> "${APP_NAME}.app/Contents/Info.plist" |
|
- | 74 | echo " <key>CFBundleName</key>" >> "${APP_NAME}.app/Contents/Info.plist" |
|
- | 75 | echo " <string>${APP_NAME}</string>" >> "${APP_NAME}.app/Contents/Info.plist" |
|
- | 76 | echo " <key>CFBundleVersion</key>" >> "${APP_NAME}.app/Contents/Info.plist" |
|
- | 77 | echo " <string>${APP_VERSION}</string>" >> "${APP_NAME}.app/Contents/Info.plist" |
|
- | 78 | echo " <key>NSHumanReadableCopyright</key>" >> "${APP_NAME}.app/Contents/Info.plist" |
|
- | 79 | echo " <string>${APP_COPYRIGHT}</string>" >> "${APP_NAME}.app/Contents/Info.plist" |
|
- | 80 | echo " <key>CFBundlePackageType</key>" >> "${APP_NAME}.app/Contents/Info.plist" |
|
- | 81 | echo " <string>APPL</string>" >> "${APP_NAME}.app/Contents/Info.plist" |
|
- | 82 | echo " <key>CFBundleSignature</key>" >> "${APP_NAME}.app/Contents/Info.plist" |
|
- | 83 | echo " <string>????</string>" >> "${APP_NAME}.app/Contents/Info.plist" |
|
- | 84 | echo "</dict>" >> "${APP_NAME}.app/Contents/Info.plist" |
|
- | 85 | echo "</plist>" >> "${APP_NAME}.app/Contents/Info.plist" |