event-tracker/android/setup-build-env.sh
AI_Assistant cd9f9456e9
Initial commit: EventTracker desktop app + Android companion
Desktop: GTK3 + matplotlib app tracking arbitrary events (button ->
timestamp -> CSV), with per-event stats, trend charts, settings
(rename/add events, relocate data file), and a reset-with-backup flow.
Portable desktop launcher via a .desktop.in template + install script,
no machine-specific paths baked in.

Android: minimal Kivy v1 companion reading/writing the same CSV format,
plus buildozer build tooling isolated in a venv and a local p4a recipe
override for kivy (see CLAUDE.md for why).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-22 07:52:54 +00:00

33 lines
1.2 KiB
Shell

#!/usr/bin/env bash
# Creates an isolated venv for buildozer/cython so the Android build
# tooling never touches Arch's externally-managed system Python.
# Safe to re-run — skips venv creation if it already exists, and
# pip install is idempotent.
set -euo pipefail
# ---- Configuration ----
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BUILD_DIR="$SCRIPT_DIR/build"
VENV_DIR="$BUILD_DIR/venv"
mkdir -p "$BUILD_DIR"
if [ ! -d "$VENV_DIR" ]; then
echo "Creating venv at $VENV_DIR"
# Plain isolated venv — no --system-site-packages. buildozer's own
# `pip install --user ...` bootstrap step (for p4a's build deps) is
# skipped automatically when it sees $VIRTUAL_ENV set, which build.sh
# sets — see the comment there. --system-site-packages was tried
# briefly to work around that instead, but it leaks the real system
# Python's installed packages into what buildozer decides the app
# needs to bundle, which is worse.
python3 -m venv "$VENV_DIR"
fi
"$VENV_DIR/bin/pip" install --upgrade pip
"$VENV_DIR/bin/pip" install buildozer cython
echo
echo "Build environment ready."
echo "Run the build with: $SCRIPT_DIR/build.sh android debug"
echo "(or activate it directly: source $VENV_DIR/bin/activate)"