#!/usr/bin/env bash # Builds OVRAS for the Steam Frame inside a Debian container (Qt 6.8, the # series of the Frame's system Qt). Result: build/steamframe-/Release/, # packaged by package-release.sh. Adapted from the vrdashboard template. # # build_scripts/steamframe/container-build.sh cross x86_64 host -> aarch64 # build_scripts/steamframe/container-build.sh native for the host's own # architecture (on the Frame: native arm64) # build_scripts/steamframe/container-build.sh shell # interactive shell in that container # # Uses podman if available, else docker (override with CONTAINER_ENGINE). set -euo pipefail here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" root="$(cd "$here/../.." && pwd)" mode="${1:-}" case "$mode" in cross) dockerfile=cross-arm64.Dockerfile toolchain="-DCMAKE_TOOLCHAIN_FILE=build_scripts/steamframe/aarch64-linux-gnu.cmake" ;; native) dockerfile=native.Dockerfile; toolchain="" ;; *) echo "usage: $0 cross|native [shell]" >&2; exit 2 ;; esac image="ovras-steamframe-${dockerfile%.Dockerfile}" engine="${CONTAINER_ENGINE:-$(command -v podman || command -v docker)}" build="build/steamframe-$mode" "$engine" build -q -t "$image" -f "$here/$dockerfile" "$here" >/dev/null # Run as the calling user, so the build tree isn't owned by root. run=("$engine" run --rm -v "$root:$root:z" -w "$root") if [[ "$(basename "$engine")" == docker ]]; then run+=(--user "$(id -u):$(id -g)") else run+=(--userns=keep-id) fi [[ -t 0 ]] && run+=(-it) if [[ "${2:-}" == shell ]]; then exec "${run[@]}" "$image" bash fi # OVRAS_STEAM_FRAME: Frame capabilities and defaults # (src/utils/platform_capabilities.h). "${run[@]}" "$image" bash -c " set -e cmake -S . -B $build -G Ninja -DCMAKE_BUILD_TYPE=Release \ -DOVRAS_STEAM_FRAME=ON $toolchain cmake --build $build " echo "Built: $root/$build/Release"