forked from open-osrs/launcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-linux.sh
executable file
·79 lines (65 loc) · 2.45 KB
/
build-linux.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
#!/bin/bash
set -e
JDK_VER="11.0.4"
JDK_BUILD="11"
PACKR_VERSION="runelite-1.0"
# Check if there's a client jar file - If there's no file the AppImage will not work but will still be built.
if ! [ -e build/libs/OpenOSRS-shaded.jar ]
then
echo "build/libs/OpenOSRS-shaded.jar not found, exiting"
exit 1
fi
if ! [ -f OpenJDK11U-jre_x64_linux_hotspot_${JDK_VER}_${JDK_BUILD}.tar.gz ] ; then
curl -Lo OpenJDK11U-jre_x64_linux_hotspot_${JDK_VER}_${JDK_BUILD}.tar.gz \
https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-${JDK_VER}%2B${JDK_BUILD}/OpenJDK11U-jre_x64_linux_hotspot_${JDK_VER}_${JDK_BUILD}.tar.gz
fi
rm -f packr.jar
curl -o packr.jar https://libgdx.badlogicgames.com/ci/packr/packr.jar
echo "70d2cc675155476f1d8516a7ae6729d44681e4fad5a6fc8dfa65cab36a67b7e0 OpenJDK11U-jre_x64_linux_hotspot_${JDK_VER}_${JDK_BUILD}.tar.gz" | sha256sum -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 linux-jdk ] ; then
tar zxf OpenJDK11U-jre_x64_linux_hotspot_${JDK_VER}_${JDK_BUILD}.tar.gz
mkdir linux-jdk
mv jdk-11.0.4+11-jre linux-jdk/jre
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 "18b7cbaab4c3f9ea556f621ca42fbd0dc745a4d11e2a08f496e2c3196580cd53 packr_${PACKR_VERSION}.jar" | sha256sum -c
java -jar packr_${PACKR_VERSION}.jar \
--platform \
linux64 \
--jdk \
linux-jdk \
--executable \
OpenOSRS \
--classpath \
build/libs/OpenOSRS-shaded.jar \
--mainclass \
net.runelite.launcher.Launcher \
--vmargs \
Drunelite.launcher.nojvm=true \
Xmx512m \
Xss2m \
XX:CompileThreshold=1500 \
Djna.nosys=true \
--output \
native-linux/OpenOSRS.AppDir/ \
--resources \
build/filtered-resources/openosrs.desktop \
appimage/openosrs.png
pushd native-linux/OpenOSRS.AppDir
mkdir -p jre/lib/amd64/server/
ln -s ../../server/libjvm.so jre/lib/amd64/server/ # packr looks for libjvm at this hardcoded path
popd
# Symlink AppRun -> RuneLite
pushd native-linux/OpenOSRS.AppDir/
ln -s OpenOSRS AppRun
popd
curl -Lo appimagetool-x86_64.AppImage https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage
chmod 755 appimagetool-x86_64.AppImage
./appimagetool-x86_64.AppImage \
native-linux/OpenOSRS.AppDir/ \
native-linux/OpenOSRS.AppImage