forked from renpy/renpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
renpy.sh
executable file
·88 lines (75 loc) · 2.13 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
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
#!/bin/sh
SCRIPT="$0"
# Resolve the chain of symlinks leading to this script.
while [ -L "$SCRIPT" ] ; do
LINK=$(readlink "$SCRIPT")
case "$LINK" in
/*)
SCRIPT="$LINK"
;;
*)
SCRIPT="$(dirname "$SCRIPT")/$LINK"
;;
esac
done
# The directory containing this shell script - an absolute path.
ROOT=$(dirname "$SCRIPT")
ROOT=$(cd "$ROOT"; pwd)
# The name of this shell script without the .sh on the end.
BASEFILE=$(basename "$SCRIPT" .sh)
if [ -z "$RENPY_PLATFORM" ] ; then
RENPY_PLATFORM="$(uname -s)-$(uname -m)"
case "$RENPY_PLATFORM" in
Darwin-*)
RENPY_PLATFORM="darwin-x86_64"
ROOT1="$ROOT/../Resources/autorun"
ROOT2="$ROOT/../../.."
export DYLD_INSERT_LIBRARIES="${DYLD_INSERT_LIBRARIES:-${STEAM_DYLD_INSERT_LIBRARIES}}"
;;
*-x86_64|amd64)
RENPY_PLATFORM="linux-x86_64"
ROOT1="$ROOT"
ROOT2="$ROOT"
;;
*-i*86)
RENPY_PLATFORM="linux-i686"
ROOT1="$ROOT"
ROOT2="$ROOT"
;;
Linux-*)
RENPY_PLATFORM="linux-$(uname -m)"
ROOT1="$ROOT"
ROOT2="$ROOT"
;;
*)
ROOT1="$ROOT"
ROOT2="$ROOT"
;;
esac
fi
for BASE in "$ROOT" "$ROOT1" "$ROOT2"; do
LIB="$BASE/lib/$RENPY_PLATFORM"
if test -d "$LIB"; then
break
fi
done
for BASE in "$ROOT" "$ROOT1" "$ROOT2"; do
if test -e "$BASE/$BASEFILE.py"; then
break
fi
done
if ! test -d "$LIB"; then
echo "Ren'Py platform files not found in:"
echo
echo "$ROOT/lib/$RENPY_PLATFORM"
echo
echo "Please compile the platform files using the instructions in README.md"
echo "or point them to an existing installation using ./after_checkout.sh <path>."
echo
echo "Alternatively, please set RENPY_PLATFORM to a different platform."
exit 1
fi
if test -n "$LD_LIBRARY_PATH"; then
export LD_LIBRARY_PATH="$LIB:$LD_LIBRARY_PATH"
fi
exec $RENPY_GDB "$LIB/$BASEFILE" $RENPY_PYARGS -EO "$BASE/$BASEFILE.py" "$@"