forked from open-osrs/launcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-osx-aarch64.sh
67 lines (49 loc) · 2.33 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
#!/bin/bash
set -e
JDK_VER="17"
JDK_BUILD="35"
PACKR_VERSION="runelite-1.4"
SIGNING_IDENTITY="Developer ID Application"
FILE="OpenJDK17-jdk_aarch64_mac_hotspot_${JDK_VER}_${JDK_BUILD}.tar.gz"
URL="https://github.com/adoptium/temurin17-binaries/releases/download/jdk-${JDK_VER}%2B${JDK_BUILD}/${FILE}"
if ! [ -f ${FILE} ] ; then
curl -Lo ${FILE} ${URL}
fi
echo "910bb88543211c63298e5b49f7144ac4463f1d903926e94a89bfbf10163bbba1 ${FILE}" | shasum -c
# packr requires a "jdk" and pulls the jre from it - so we have to place it inside
# the jdk folder at jre/
if ! [ -d osx-aarch64-jdk ] ; then
# Extract jdk archive
tar zxf $FILE
# Create jre
jdk-${JDK_VER}+${JDK_BUILD}/Contents/Home/bin/jlink \
--add-modules java.base,java.datatransfer,java.desktop,java.logging,java.management \
--add-modules java.naming,java.net.http,java.sql,java.xml\
--add-modules jdk.crypto.ec,jdk.httpserver,jdk.unsupported\
--add-modules jdk.random,jdk.net,jdk.crypto.cryptoki,jdk.accessibility\
--add-modules jdk.charsets,java.prefs,jdk.unsupported.desktop\
--no-header-files --no-man-pages\
--output osx-aarch64-jdk/jre
# Cleanup
rm -rf jdk-${JDK_VER}+${JDK_BUILD}
fi
if ! [ -f packr_${PACKR_VERSION}.jar ] ; then
curl -Lo packr_${PACKR_VERSION}.jar \
https://github.com/runelite/packr/releases/download/${PACKR_VERSION}/packr.jar
fi
echo "f51577b005a51331b822a18122ce08fca58cf6fee91f071d5a16354815bbe1e3 packr_${PACKR_VERSION}.jar" | shasum -c
java -jar packr_${PACKR_VERSION}.jar \
packr/macos-aarch64-config.json
cp build/filtered-resources/Info.plist native-osx-aarch64/OpenOSRS.app/Contents
echo Setting world execute permissions on OpenOSRS
pushd native-osx-aarch64/OpenOSRS.app
chmod g+x,o+x Contents/MacOS/OpenOSRS
popd
codesign -f -s "${SIGNING_IDENTITY}" --entitlements osx/signing.entitlements --options runtime native-osx-aarch64/OpenOSRS.app || true
# create-dmg exits with an error code due to no code signing, but is still okay
create-dmg native-osx-aarch64/OpenOSRS.app native-osx-aarch64/ || true
mv native-osx-aarch64/OpenOSRS\ *.dmg native-osx-aarch64/OpenOSRS-aarch64.dmg
# Notarize app
if xcrun notarytool submit native-osx-aarch64/OpenOSRS-aarch64.dmg --wait --keychain-profile "AC_PASSWORD" ; then
xcrun stapler staple native-osx-aarch64/OpenOSRS-aarch64.dmg
fi