Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
3 | pmbaty | 1 | #!/bin/bash |
2 | |||
4 | pmbaty | 3 | MY_PATH=`dirname "$0"` |
4 | APP_NAME="Rick Dangerous" |
||
7 | pmbaty | 5 | APP_VERSION="1.3" |
4 | pmbaty | 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 | |||
7 | pmbaty | 23 | cp -pPR SDL2.framework "${APP_NAME}.app/Contents/Frameworks" |
24 | rm -rf "${APP_NAME}.app/Contents/Frameworks/SDL2.framework/Versions/A/_CodeSignature" |
||
25 | rm -rf "${APP_NAME}.app/Contents/Frameworks/SDL2.framework/Versions/A/Headers" |
||
26 | rm -rf "${APP_NAME}.app/Contents/Frameworks/SDL2.framework/Headers" |
||
27 | rm -rf "${APP_NAME}.app/Contents/Frameworks/SDL2_image.framework" |
||
4 | pmbaty | 28 | |
7 | pmbaty | 29 | gcc *.c osx-sdlmain.m -ISDL2.framework/Headers -framework Foundation -framework Cocoa -F. -framework SDL2 -o "${APP_NAME}.app/Contents/MacOS/${APP_NAME}" |
4 | pmbaty | 30 | if [ ! "_$?" = "_0" ]; then |
31 | rm -rf "${APP_NAME}.app" |
||
32 | exit |
||
33 | fi |
||
34 | install_name_tool -add_rpath "@loader_path/../Frameworks" "${APP_NAME}.app/Contents/MacOS/${APP_NAME}" |
||
35 | if [ ! "_$?" = "_0" ]; then |
||
36 | rm -rf "${APP_NAME}.app" |
||
37 | exit |
||
38 | fi |
||
39 | |||
40 | mkdir "__${APP_NAME}.iconset" |
||
41 | sips -z 16 16 "${ICON_FILE}" --out "__${APP_NAME}.iconset/icon_16x16.png" > /dev/null |
||
42 | sips -z 32 32 "${ICON_FILE}" --out "__${APP_NAME}.iconset/icon_16x16@2x.png" > /dev/null |
||
43 | sips -z 32 32 "${ICON_FILE}" --out "__${APP_NAME}.iconset/icon_32x32.png" > /dev/null |
||
44 | sips -z 64 64 "${ICON_FILE}" --out "__${APP_NAME}.iconset/icon_32x32@2x.png" > /dev/null |
||
45 | sips -z 128 128 "${ICON_FILE}" --out "__${APP_NAME}.iconset/icon_128x128.png" > /dev/null |
||
46 | sips -z 256 256 "${ICON_FILE}" --out "__${APP_NAME}.iconset/icon_128x128@2x.png" > /dev/null |
||
47 | sips -z 256 256 "${ICON_FILE}" --out "__${APP_NAME}.iconset/icon_256x256.png" > /dev/null |
||
48 | sips -z 512 512 "${ICON_FILE}" --out "__${APP_NAME}.iconset/icon_256x256@2x.png" > /dev/null |
||
49 | sips -z 512 512 "${ICON_FILE}" --out "__${APP_NAME}.iconset/icon_512x512.png" > /dev/null |
||
50 | sips -z 1024 1024 "${ICON_FILE}" --out "__${APP_NAME}.iconset/icon_512x512@2x.png" > /dev/null |
||
51 | iconutil -c icns "__${APP_NAME}.iconset" |
||
52 | if [ ! "_$?" = "_0" ]; then |
||
53 | rm -rf "__${APP_NAME}.iconset" |
||
54 | rm -rf "${APP_NAME}.app" |
||
55 | exit |
||
56 | fi |
||
57 | rm -rf "__${APP_NAME}.iconset" |
||
58 | mv "__${APP_NAME}.icns" "${APP_NAME}.app/Contents/Resources/${APP_NAME}.icns" |
||
59 | |||
60 | cp -r "../sounds" "${APP_NAME}.app/Contents/Resources" |
||
61 | |||
62 | echo -n "APPL???" > "${APP_NAME}.app/Contents/PkgInfo" |
||
63 | |||
64 | echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > "${APP_NAME}.app/Contents/Info.plist" |
||
65 | 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" |
||
66 | echo "<plist version=\"1.0\">" >> "${APP_NAME}.app/Contents/Info.plist" |
||
67 | echo "<dict>" >> "${APP_NAME}.app/Contents/Info.plist" |
||
68 | echo " <key>CFBundleDevelopmentRegion</key>" >> "${APP_NAME}.app/Contents/Info.plist" |
||
69 | echo " <string>en</string>" >> "${APP_NAME}.app/Contents/Info.plist" |
||
70 | echo " <key>CFBundleExecutable</key>" >> "${APP_NAME}.app/Contents/Info.plist" |
||
71 | echo " <string>${APP_NAME}</string>" >> "${APP_NAME}.app/Contents/Info.plist" |
||
72 | echo " <key>CFBundleIconFile</key>" >> "${APP_NAME}.app/Contents/Info.plist" |
||
73 | echo " <string>${APP_NAME}.icns</string>" >> "${APP_NAME}.app/Contents/Info.plist" |
||
74 | echo " <key>CFBundleIdentifier</key>" >> "${APP_NAME}.app/Contents/Info.plist" |
||
75 | echo " <string>${BUNDLE_ID}</string>" >> "${APP_NAME}.app/Contents/Info.plist" |
||
76 | echo " <key>CFBundleInfoDictionaryVersion</key>" >> "${APP_NAME}.app/Contents/Info.plist" |
||
77 | echo " <string>6.0</string>" >> "${APP_NAME}.app/Contents/Info.plist" |
||
78 | echo " <key>CFBundleName</key>" >> "${APP_NAME}.app/Contents/Info.plist" |
||
79 | echo " <string>${APP_NAME}</string>" >> "${APP_NAME}.app/Contents/Info.plist" |
||
80 | echo " <key>CFBundleVersion</key>" >> "${APP_NAME}.app/Contents/Info.plist" |
||
81 | echo " <string>${APP_VERSION}</string>" >> "${APP_NAME}.app/Contents/Info.plist" |
||
82 | echo " <key>NSHumanReadableCopyright</key>" >> "${APP_NAME}.app/Contents/Info.plist" |
||
83 | echo " <string>${APP_COPYRIGHT}</string>" >> "${APP_NAME}.app/Contents/Info.plist" |
||
84 | echo " <key>CFBundlePackageType</key>" >> "${APP_NAME}.app/Contents/Info.plist" |
||
85 | echo " <string>APPL</string>" >> "${APP_NAME}.app/Contents/Info.plist" |
||
86 | echo " <key>CFBundleSignature</key>" >> "${APP_NAME}.app/Contents/Info.plist" |
||
87 | echo " <string>????</string>" >> "${APP_NAME}.app/Contents/Info.plist" |
||
88 | echo "</dict>" >> "${APP_NAME}.app/Contents/Info.plist" |
||
89 | echo "</plist>" >> "${APP_NAME}.app/Contents/Info.plist" |