-
Notifications
You must be signed in to change notification settings - Fork 97
/
build-osx-aarch64.sh
executable file
·85 lines (66 loc) · 2.18 KB
/
build-osx-aarch64.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
set -e
APPBASE="build/macos-aarch64/RuneLite.app"
build() {
pushd native
cmake -DCMAKE_OSX_ARCHITECTURES=arm64 -B build-aarch64 .
cmake --build build-aarch64 --config Release
popd
source .jdk-versions.sh
rm -rf build/macos-aarch64
mkdir -p build/macos-aarch64
if ! [ -f mac_aarch64_jre.tar.gz ] ; then
curl -Lo mac_aarch64_jre.tar.gz $MAC_AARCH64_LINK
fi
echo "$MAC_AARCH64_CHKSUM mac_aarch64_jre.tar.gz" | shasum -c
mkdir -p $APPBASE/Contents/{MacOS,Resources}
cp native/build-aarch64/src/RuneLite $APPBASE/Contents/MacOS/
cp target/RuneLite.jar $APPBASE/Contents/Resources/
cp packr/macos-aarch64-config.json $APPBASE/Contents/Resources/config.json
cp target/filtered-resources/Info.plist $APPBASE/Contents/
cp osx/runelite.icns $APPBASE/Contents/Resources/icons.icns
tar zxf mac_aarch64_jre.tar.gz
mkdir $APPBASE/Contents/Resources/jre
mv jdk-$MAC_AARCH64_VERSION-jre/Contents/Home/* $APPBASE/Contents/Resources/jre
echo Setting world execute permissions on RuneLite
pushd $APPBASE
chmod g+x,o+x Contents/MacOS/RuneLite
popd
otool -l $APPBASE/Contents/MacOS/RuneLite
}
dmg() {
SIGNING_IDENTITY="Developer ID Application"
codesign -f -s "${SIGNING_IDENTITY}" --entitlements osx/signing.entitlements --options runtime $APPBASE || true
# create-dmg exits with an error code due to no code signing, but is still okay
create-dmg $APPBASE . || true
mv RuneLite\ *.dmg RuneLite-aarch64.dmg
# dump for CI
hdiutil imageinfo RuneLite-aarch64.dmg
if ! hdiutil imageinfo RuneLite-aarch64.dmg | grep -q "Format: ULFO" ; then
echo Format of dmg is not ULFO
exit 1
fi
if ! hdiutil imageinfo RuneLite-aarch64.dmg | grep -q "Apple_HFS" ; then
echo Filesystem of dmg is not Apple_HFS
exit 1
fi
# Notarize app
if xcrun notarytool submit RuneLite-aarch64.dmg --wait --keychain-profile "AC_PASSWORD" ; then
xcrun stapler staple RuneLite-aarch64.dmg
fi
}
while test $# -gt 0; do
case "$1" in
--build)
build
shift
;;
--dmg)
dmg
shift
;;
*)
break
;;
esac
done