-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun.sh
More file actions
90 lines (80 loc) · 2.44 KB
/
Copy pathrun.sh
File metadata and controls
90 lines (80 loc) · 2.44 KB
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
86
87
88
89
90
#!/usr/bin/env bash
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
# Detect OS and pick the right LWJGL natives classifier
LWJGL_VERSION="3.3.5"
MAVEN="https://repo1.maven.org/maven2/org/lwjgl"
MODULES=(lwjgl lwjgl-opengl lwjgl-glfw)
OS="$(uname -s)"
ARCH="$(uname -m)"
if [ "$OS" = "Darwin" ]; then
if [ "$ARCH" = "arm64" ]; then
NATIVES_CLASSIFIER="natives-macos-arm64"
else
NATIVES_CLASSIFIER="natives-macos"
fi
elif [ "$OS" = "Linux" ]; then
NATIVES_CLASSIFIER="natives-linux"
elif [[ "$OS" == MINGW* || "$OS" == MSYS* || "$OS" == CYGWIN* ]]; then
NATIVES_CLASSIFIER="natives-windows"
else
echo "ERROR: Unsupported OS: $OS" >&2
exit 1
fi
# Auto-download LWJGL natives for this platform if not present
MISSING=0
REBUILD=0
for mod in "${MODULES[@]}"; do
jar="lib/${mod}-${LWJGL_VERSION}-${NATIVES_CLASSIFIER}.jar"
if [ ! -f "$jar" ]; then
MISSING=1
break
fi
done
if [ "$MISSING" -eq 1 ]; then
echo "LWJGL natives ($NATIVES_CLASSIFIER) not found — downloading..."
if ! command -v curl &>/dev/null && ! command -v wget &>/dev/null; then
echo "ERROR: curl or wget is required to download natives." >&2
exit 1
fi
for mod in "${MODULES[@]}"; do
jar="lib/${mod}-${LWJGL_VERSION}-${NATIVES_CLASSIFIER}.jar"
if [ ! -f "$jar" ]; then
url="${MAVEN}/${mod}/${LWJGL_VERSION}/${mod}-${LWJGL_VERSION}-${NATIVES_CLASSIFIER}.jar"
echo " Downloading $(basename "$jar")..."
if command -v curl &>/dev/null; then
curl -fsSL -o "$jar" "$url"
else
wget -q -O "$jar" "$url"
fi
fi
done
echo "Natives downloaded."
REBUILD=1
fi
case "$OS" in
MINGW*|MSYS*|CYGWIN*)
APP_PATH="$SCRIPT_DIR/Exe Output/Progressive Java Client/Progressive Java Client.exe"
;;
Darwin)
APP_PATH="$SCRIPT_DIR/Exe Output/Progressive Java Client.app/Contents/MacOS/Progressive Java Client"
;;
Linux)
APP_PATH="$SCRIPT_DIR/Exe Output/Progressive Java Client/bin/Progressive Java Client"
;;
*)
echo "ERROR: Unsupported OS: $OS" >&2
exit 1
;;
esac
if [ ! -x "$APP_PATH" ] || [ "$REBUILD" -eq 1 ]; then
bash build.sh
fi
echo "Starting packaged RS2 client..."
"$APP_PATH"
EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]; then
echo ""
echo "Client exited with error code $EXIT_CODE."
fi