Files
daniel-lynch--ovrplugin-ope…/packaging/build_openxr_loader.sh
T
Daniel LynchandClaude Opus 4.8 a72a79ad29 Initial public release: OVRPlugin→OpenXR interoperability shim
An independent reimplementation of Meta's libOVRPlugin ABI on top of OpenXR, so
VrApi-era Meta Quest VR titles can run on non-Meta OpenXR runtimes (Monado,
Steam Frame) instead of being locked to Meta hardware. Original code only — no
Meta/Epic/Capcom binaries, headers, or assets. Includes a desktop harness that
drives the shim against Monado headless.

Scope/legal: interoperability; entitlement handling is out of scope. See README
for the legal/scope section and docs/ for the research trail and design notes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D6sFYGXZPsq3v7xtcDES6g
2026-06-29 00:48:48 -04:00

30 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
# Build the Khronos OpenXR loader (libopenxr_loader.so) for Android arm64 so the
# shim's NEEDED dependency resolves at runtime. Output -> packaging/libs/arm64/.
set -euo pipefail
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/_env.sh"
[ -n "${NDK:-}" ] && [ -d "$NDK" ] || { echo "NDK not found. Set \$ANDROID_NDK or run scripts/fetch_deps.sh"; exit 1; }
SRC="$ROOT/tools/OpenXR-SDK"
if [ ! -d "$SRC" ]; then
echo "downloading OpenXR-SDK source..."
curl -fsSL -o "$ROOT/tools/oxrsdk.tgz" \
"https://github.com/KhronosGroup/OpenXR-SDK/archive/refs/heads/main.tar.gz"
tar xzf "$ROOT/tools/oxrsdk.tgz" -C "$ROOT/tools"
mv "$ROOT/tools/OpenXR-SDK-main" "$SRC"
fi
GEN="Unix Makefiles"; command -v ninja >/dev/null && GEN="Ninja"
cmake -S "$SRC" -B "$SRC/build-android" \
-DCMAKE_TOOLCHAIN_FILE="$NDK/build/cmake/android.toolchain.cmake" \
-DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-29 \
-DDYNAMIC_LOADER=ON -DBUILD_TESTS=OFF -DBUILD_API_LAYERS=OFF \
-DBUILD_CONFORMANCE_TESTS=OFF -DBUILD_WITH_SYSTEM_JSONCPP=OFF \
-G "$GEN" >/dev/null
cmake --build "$SRC/build-android" --target openxr_loader -j4
mkdir -p "$PKG/libs/arm64"
find "$SRC/build-android" -name 'libopenxr_loader.so' -exec cp {} "$PKG/libs/arm64/" \;
echo "loader -> $PKG/libs/arm64/libopenxr_loader.so"
file "$PKG/libs/arm64/libopenxr_loader.so" 2>/dev/null || true