26 lines
1.1 KiB
Shell
26 lines
1.1 KiB
Shell
|
|
#!/usr/bin/env bash
|
||
|
|
# Thin wrapper so you don't have to remember the venv path — runs
|
||
|
|
# buildozer through it directly. Usage: ./build.sh android debug
|
||
|
|
set -euo pipefail
|
||
|
|
|
||
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||
|
|
VENV_BIN="$SCRIPT_DIR/build/venv/bin"
|
||
|
|
BUILDOZER="$VENV_BIN/buildozer"
|
||
|
|
|
||
|
|
if [ ! -x "$BUILDOZER" ]; then
|
||
|
|
echo "Build venv not found — run ./setup-build-env.sh first." >&2
|
||
|
|
exit 1
|
||
|
|
fi
|
||
|
|
|
||
|
|
cd "$SCRIPT_DIR"
|
||
|
|
# Running buildozer by absolute path skips everything `source venv/bin/activate`
|
||
|
|
# normally sets up, so it's replicated by hand:
|
||
|
|
# - PATH: buildozer shells out to find tools like `cython`, which only
|
||
|
|
# resolves if the venv's bin/ is on PATH.
|
||
|
|
# - VIRTUAL_ENV: buildozer's own venv-detection (targets/android.py) checks
|
||
|
|
# this to decide whether to `pip install --user` its own build deps or
|
||
|
|
# install normally. Without it set, buildozer wrongly assumes it's not in
|
||
|
|
# a venv, uses --user, and pip refuses (no user site-packages in a venv).
|
||
|
|
export PATH="$VENV_BIN:$PATH"
|
||
|
|
export VIRTUAL_ENV="$SCRIPT_DIR/build/venv"
|
||
|
|
exec "$BUILDOZER" "$@"
|