forked from open-osrs/launcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-osx-x64.sh
66 lines (49 loc) · 2.32 KB
/
build-osx-x64.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
#!/bin/bash
set -e
JDK_VER="11.0.14.1"
JDK_BUILD="1"
PACKR_VERSION="runelite-1.4"
SIGNING_IDENTITY="Developer ID Application"
if ! [ -f OpenJDK11U-jre_x64_mac_hotspot_${JDK_VER}_${JDK_BUILD}.tar.gz ] ; then
curl -Lo OpenJDK11U-jre_x64_mac_hotspot_${JDK_VER}_${JDK_BUILD}.tar.gz \
https://github.com/adoptium/temurin11-binaries/releases/download/jdk-${JDK_VER}%2B${JDK_BUILD}/OpenJDK11U-jre_x64_mac_hotspot_${JDK_VER}_${JDK_BUILD}.tar.gz
fi
echo "1b2f792ad05af9dba876db962c189527e645b48f50ceb842b4e39169de553303 OpenJDK11U-jre_x64_mac_hotspot_${JDK_VER}_${JDK_BUILD}.tar.gz" | 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-jdk ] ; then
tar zxf OpenJDK11U-jre_x64_mac_hotspot_${JDK_VER}_${JDK_BUILD}.tar.gz
mkdir osx-jdk
mv jdk-${JDK_VER}+${JDK_BUILD}-jre osx-jdk/jre
pushd osx-jdk/jre
# Move JRE out of Contents/Home/
mv Contents/Home/* .
# Remove unused leftover folders
rm -rf Contents
popd
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-x64-config.json
cp build/filtered-resources/Info.plist native-osx/OpenOSRS.app/Contents
echo Setting world execute permissions on OpenOSRS
pushd native-osx/OpenOSRS.app
chmod g+x,o+x Contents/MacOS/OpenOSRS
popd
codesign -f -s "${SIGNING_IDENTITY}" --entitlements osx/signing.entitlements --options runtime native-osx/OpenOSRS.app || true
# create-dmg exits with an error code due to no code signing, but is still okay
# note we use Adam-/create-dmg as upstream does not support UDBZ
create-dmg --format UDBZ native-osx/OpenOSRS.app native-osx/ || true
mv native-osx/OpenOSRS\ *.dmg native-osx/OpenOSRS-x64.dmg
if ! hdiutil imageinfo native-osx/OpenOSRS-x64.dmg | grep -q "Format: UDBZ" ; then
echo "Format of resulting dmg was not UDBZ, make sure your create-dmg has support for --format"
exit 1
fi
# Notarize app
if xcrun notarytool submit native-osx/OpenOSRS-x64.dmg --wait --keychain-profile "AC_PASSWORD" ; then
xcrun stapler staple native-osx/OpenOSRS-x64.dmg
fi