Welcome to mirror list, hosted at ThFree Co, Russian Federation.

fix_mac_app_bundle.sh - github.com/ClusterM/hakchi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7540801c9f37092a1bf15042a2b402cdabc5d2a4 (plain)
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
38
39
40
41
42
43
44
45
#!/bin/bash

BINARY=build/hakchi-gui.app
DYLIBBUNDLER=3rdparty/macdylibbundler/dylibbundler

$DYLIBBUNDLER -x $BINARY/Contents/MacOS/hakchi-gui -b -cd -d $BINARY/Contents/libs

macdeployqt $BINARY

cp -rf bin $BINARY/Contents/MacOS/bin
cp -rf udev $BINARY/Contents/MacOS/udev
cp -rf mod $BINARY/Contents/MacOS/mod
cp -rf 3rdparty $BINARY/Contents/MacOS/3rdparty

curl -o icon.png http://www.iconeasy.com/icon/png/Game/Nes/Nes%20Console.png

replace_icon(){
    droplet=$1
    icon=$2
    if [[ $icon =~ ^https?:// ]]; then
        curl -sLo /tmp/icon $icon
        icon=/tmp/icon
    fi
    rm -rf $droplet$'/Icon\r'
    sips -i $icon >/dev/null
    DeRez -only icns $icon > /tmp/icns.rsrc
    Rez -append /tmp/icns.rsrc -o $droplet$'/Icon\r'
    SetFile -a C $droplet
    SetFile -a V $droplet$'/Icon\r'
}

replace_icon $BINARY icon.png

# clean up.
rm icon.png
rm /tmp/icns.rsrc

plutil -replace CFBundleGetInfoString -string "© madmonkey1907" $BINARY/Contents/Info.plist

chmod +x $BINARY/Contents/MacOS/hakchi-gui
chmod +x $BINARY/Contents/MacOS/bin/*

mv $BINARY "build/Hakchi GUI.app"

exit 0