-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathretroarch-apple-packaging.sh
executable file
·37 lines (27 loc) · 1.24 KB
/
retroarch-apple-packaging.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
# app stuff
rm -rf RetroArch.app
mkdir -p RetroArch.app/Contents/MacOS
cp -r pkg/apple/OSX/* RetroArch.app/Contents
cp retroarch RetroArch.app/Contents/MacOS
mv RetroArch.app/Contents/Info_Metal.plist RetroArch.app/Contents/Info.plist
sed -i'.bak' 's/\${EXECUTABLE_NAME}/RetroArch/' RetroArch.app/Contents/Info.plist
sed -i'.bak' 's/\$(PRODUCT_BUNDLE_IDENTIFIER)/com.libretro.RetroArch/' RetroArch.app/Contents/Info.plist
sed -i'.bak' 's/\${PRODUCT_NAME}/RetroArch/' RetroArch.app/Contents/Info.plist
sed -i'.bak' 's/\${MACOSX_DEPLOYMENT_TARGET}/10.13/' RetroArch.app/Contents/Info.plist
cp media/retroarch.icns RetroArch.app/Contents/Resources/
# dmg stuff
umount wc
rm -rf RetroArch.dmg wc empty.dmg
mkdir -p template
hdiutil create -fs HFSX -layout SPUD -size 200m empty.dmg -srcfolder template -format UDRW -volname RetroArch -quiet
rmdir template
mkdir -p wc
hdiutil attach empty.dmg -noautoopen -quiet -mountpoint wc
rm -rf wc/RetroArch.app
ditto -rsrc RetroArch.app wc/RetroArch.app
ln -s /Applications wc/Applications
WC_DEV=`hdiutil info | grep wc | grep "Apple_HFS" | awk '{print $1}'` && hdiutil detach $WC_DEV -quiet -force
hdiutil convert empty.dmg -quiet -format UDZO -imagekey zlib-level=9 -o RetroArch.dmg
umount wc
rm -rf wc empty.dmg