forked from renpy/renpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
renpy.sh
executable file
·62 lines (48 loc) · 1.69 KB
/
renpy.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
#!/bin/sh
# The directory containing this shell script - an absolute path.
ROOT=$(dirname "$0")
ROOT=$(cd "$ROOT"; pwd)
# The name of this shell script without the .sh on the end.
BASEFILE=$(basename "$0" .sh)
# The full path to the shell script, without the .sh at the end of it.
BASE="$ROOT/$BASEFILE"
# Assume Darwin means Mac OS X, and launch us using the OS X launcher.
if [ "$(uname -s)" = "Darwin" ] ; then
RENPY_LAUNCHER_DIR="$ROOT"
export RENPY_LAUNCHER_DIR
if [ -e "${BASE}.app/Contents/MacOS/${BASEFILE}" ] ; then
LAUNCHER="${BASE}.app/Contents/MacOS/${BASEFILE}"
else
LAUNCHER="${BASE}.app/Contents/MacOS/Ren'Py Launcher"
fi
exec $RENPY_GDB "${LAUNCHER}" "${BASE}.py" "$@"
fi
# Otherwise, assume we're on linux, or an OS that can run Linux binaries.
# If that's not the case, you'll have to change this script.
if [ -z "$RENPY_PLATFORM" ] ; then
case `uname -m` in
x86_64|amd64)
RENPY_PLATFORM="linux-x86_64"
;;
i*86)
RENPY_PLATFORM="linux-i686"
;;
*)
echo "Ren'Py could not detect that platform it's running on. Please set"
echo "the RENPY_PLATFORM environment variable to one of \"linux-i686\" or"
echo "\"linux-x86_64\", and run this command again."
exit 1
;;
esac
fi
LIB="$ROOT/lib/$RENPY_PLATFORM"
RENPY_ORIGINAL_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
if [ -z "$LD_LIBRARY_PATH" ] ; then
LD_LIBRARY_PATH="$LIB"
else
LD_LIBRARY_PATH="$LIB:$LD_LIBRARY_PATH"
fi
export LD_LIBRARY_PATH
export RENPY_PLATFORM
export RENPY_ORIGINAL_LD_LIBRARY_PATH
exec $RENPY_GDB "$LIB/python" $RENPY_PYARGS -OO "$BASE.py" "$@"