mirror of
https://github.com/DeeJanuz/frametop.git
synced 2026-10-15 22:00:37 +02:00
scripts/openvr.sh is the one place for the OpenVR SDK the programs build against: the v2.15.6 headers, fetched into build/include and checked by sha256, and the API library. ft-pointer, the ft_pointer driver, and ft-powerd now build against those headers like ft-screens and ft-gaze, instead of the 2.1.0 copy in SteamVR's samples, which has no public tag an image could pin. The library stays SteamVR's own; OPENVR_LIB links another copy (the image has no SteamVR), and the rpath still names SteamVR's folder first. FRAME_IN_BOX=1 tells the scripts they already run in the build container, so pack/Containerfile can run them instead of keeping a second copy of every compile line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
34 lines
1.7 KiB
Bash
34 lines
1.7 KiB
Bash
# Sourced by the build scripts, in the build container, from a component's folder: the
|
|
# OpenVR header and API library Frametop builds against. Sets OPENVR_CFLAGS and OPENVR_LIBS.
|
|
#
|
|
# Headers: the pinned public SDK, fetched once into build/include and checked by sha256.
|
|
# The headers SteamVR ships on the Frame (in its samples) are 2.1.0, which predates
|
|
# interfaces Frametop uses (IVRIPCResourceManagerClient, the eye tracking API) and has no
|
|
# public tag to pin; the Frame's runtime supports this SDK's interface versions.
|
|
# Library: SteamVR's own libopenvr_api by default. OPENVR_LIB names another folder with a
|
|
# libopenvr_api.so to link (the image uses the SDK's copy, since it has no SteamVR); the
|
|
# programs still look in SteamVR's folder first, so on the Frame they load SteamVR's.
|
|
openvr_tag=v2.15.6
|
|
openvr_steamvr=/opt/steamvr/bin/linuxarm64
|
|
|
|
openvr_fetch() { # openvr_fetch <header> <sha256>
|
|
local f=build/include/$1
|
|
echo "$2 $f" | sha256sum -c --status 2>/dev/null && return 0
|
|
mkdir -p build/include
|
|
curl -fsSL "https://raw.githubusercontent.com/ValveSoftware/openvr/$openvr_tag/headers/$1" -o "$f.part" || return
|
|
if ! echo "$2 $f.part" | sha256sum -c --status; then
|
|
echo "$1 from openvr $openvr_tag doesn't match its pinned sha256" >&2
|
|
rm -f "$f.part"
|
|
return 1
|
|
fi
|
|
mv "$f.part" "$f"
|
|
}
|
|
openvr_fetch openvr.h 1e6ed57199896cc1f7c5484e50fa18955e97be15be690beb28d998c877ead7fd
|
|
openvr_fetch openvr_driver.h 1036efe998d63e82d1d3db2b32a2f58df4a8eeaf5280f50aaf28220ff60a40ab
|
|
|
|
openvr_lib=${OPENVR_LIB:-$openvr_steamvr}
|
|
openvr_rpath=$openvr_steamvr
|
|
[ "$openvr_lib" = "$openvr_steamvr" ] || openvr_rpath=$openvr_steamvr:$openvr_lib
|
|
OPENVR_CFLAGS=-Ibuild/include
|
|
OPENVR_LIBS="-L$openvr_lib -lopenvr_api -Wl,-rpath,$openvr_rpath"
|