-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·37 lines (31 loc) · 1.43 KB
/
Copy pathbootstrap.sh
File metadata and controls
executable file
·37 lines (31 loc) · 1.43 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
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PYTHON_BIN="${PYTHON_BIN:-python3}"
PYTHON_ENV_BIN=""
if [[ -x "${ROOT_DIR}/.venv/bin/python" ]] && "${ROOT_DIR}/.venv/bin/python" -m pip --version >/dev/null 2>&1; then
PYTHON_ENV_BIN="${ROOT_DIR}/.venv/bin/python"
elif [[ -x "${ROOT_DIR}/../.venv/bin/python" ]] && "${ROOT_DIR}/../.venv/bin/python" -m pip --version >/dev/null 2>&1; then
PYTHON_ENV_BIN="${ROOT_DIR}/../.venv/bin/python"
else
if [[ ! -x "${ROOT_DIR}/.venv/bin/python" ]]; then
"${PYTHON_BIN}" -m venv "${ROOT_DIR}/.venv"
fi
PYTHON_ENV_BIN="${ROOT_DIR}/.venv/bin/python"
fi
if ! "${PYTHON_ENV_BIN}" -m pip --version >/dev/null 2>&1; then
echo "Project virtualenv is missing pip. Install python3-venv, remove .venv, then run ./bootstrap.sh again." >&2
exit 1
fi
"${PYTHON_ENV_BIN}" -m pip install --upgrade pip
"${PYTHON_ENV_BIN}" -m pip install pypng lz4 Pillow
if [[ ! -d "${ROOT_DIR}/dependencies/lvgl/.git" || \
! -d "${ROOT_DIR}/dependencies/spdlog/.git" || \
! -d "${ROOT_DIR}/dependencies/smooth_ui_toolkit/.git" || \
! -d "${ROOT_DIR}/dependencies/miniaudio/.git" ]]; then
"${PYTHON_ENV_BIN}" "${ROOT_DIR}/fetch_repos.py"
fi
echo "Keyboard Guide bootstrap complete."
echo "Build with:"
echo " cmake -S . -B build/sdl -DKEYBOARD_GUIDE_USE_SDL=ON"
echo " cmake --build build/sdl -j$(getconf _NPROCESSORS_ONLN 2>/dev/null || echo 4)"