forked from renpy/renpy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·66 lines (51 loc) · 1.4 KB
/
Copy pathrun.sh
File metadata and controls
executable file
·66 lines (51 loc) · 1.4 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
#!/bin/bash
# This builds out of date modules using the default C compiler, and then
# runs them.
set -e
export RENPY_CYTHON=cython
ROOT="$(cd "$(dirname "$0")" && pwd)"
QUIET=${RENPY_QUIET- --quiet}
if [ -n "$RENPY_COVERAGE" ]; then
variant="renpy-coverage"
else
variant="renpy-run"
fi
if [ -n "$RENPY_VIRTUAL_ENV" ] ; then
. "$RENPY_VIRTUAL_ENV/bin/activate"
fi
if [ -z "$VIRTUAL_ENV" ] ; then
if [ -d "$ROOT/.venv" ] ; then
. "$ROOT/.venv/bin/activate"
else
echo "Please use 'uv sync' to creat the virtual environment."
exit 1
fi
fi
if [[ "$OSTYPE" == "darwin"* ]]; then
CPUS=$(sysctl -n hw.logicalcpu)
else
CPUS=$(nproc)
fi
BUILD_J="-j $CPUS"
setup () {
pushd $1 >/dev/null
if ! python setup.py $QUIET build_ext -b tmp/build/lib.$variant -t tmp/build/tmp.$variant --inplace $BUILD_J; then
if [ "$(which python)" != "$ROOT/.venv/bin/python" ]; then
echo "Warning: Running using $(which python)"
fi
exit 1
fi
popd >/dev/null
}
if [ -e "$ROOT/cubism" ]; then
export CUBISM="$ROOT/cubism"
export CUBISM_PLATFORM=${CUBISM_PLATFORM:-linux/x86_64}
export LD_LIBRARY_PATH="$CUBISM/Core/dll/$CUBISM_PLATFORM:${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
fi
setup "$ROOT/"
if [ "$1" = "--build" ] ; then
echo "Ren'Py build complete."
exit 0
else
exec $RENPY_GDB python -X utf8 $ROOT/renpy.py "$@"
fi