Repository navigation
Expand file tree
/
Copy pathpackage_linux.sh
More file actions
executable file
·102 lines (82 loc) · 3.91 KB
/
Copy pathpackage_linux.sh
File metadata and controls
executable file
·102 lines (82 loc) · 3.91 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/bash
# Package the Linux runtime build as a relocatable tarball + install.sh (#705).
#
# ./scripts/package_linux.sh # package an existing build/ (runs
# # build_linux.sh --service --no-test
# # first if artifacts are missing)
# ./scripts/package_linux.sh --no-build # fail instead of building
#
# Output: dist/displayxr-runtime-linux-<arch>-<version>.tar.gz containing
# bin/displayxr-cli [bin/displayxr-service]
# lib/openxr_displayxr.so
# lib/displayxr/plugins/DisplayXR-SimDisplay.so
# install.sh / uninstall.sh / README.md / VERSION
#
# v1 scope (#705): runtime + sim_display, user-level default. All config files
# (ActiveRuntime json, DP manifest, systemd unit) are GENERATED by install.sh
# at install time with absolute paths — the tarball carries no templates.
# The vendor (Leia SR) plug-in ships via its own installer into the same
# DisplayProcessors root; this tarball stays vendor-free.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
BUILD_DIR="$ROOT/build"
DIST_DIR="$ROOT/dist"
NO_BUILD=0
for arg in "$@"; do
case "$arg" in
--no-build) NO_BUILD=1 ;;
*) echo "Unknown option: $arg (supported: --no-build)" >&2; exit 2 ;;
esac
done
find_runtime() { find "$BUILD_DIR/src/xrt/targets/openxr" -maxdepth 1 -name "openxr_displayxr.so" -type f 2>/dev/null | head -1; }
if [ -z "$(find_runtime)" ]; then
if [ "$NO_BUILD" = 1 ]; then
echo "error: no build found under $BUILD_DIR (run scripts/build_linux.sh --service first)" >&2
exit 1
fi
echo "==> No existing build — running build_linux.sh --service --no-test"
"$ROOT/scripts/build_linux.sh" --service --no-test
fi
RUNTIME_SO="$(find_runtime)"
CLI_BIN="$(find "$BUILD_DIR/src/xrt/targets/cli" -maxdepth 1 -name displayxr-cli -type f | head -1)"
SERVICE_BIN="$(find "$BUILD_DIR/src/xrt/targets/service" -maxdepth 1 -name displayxr-service -type f 2>/dev/null | head -1)"
PLUGIN_SO="$(find "$BUILD_DIR/src/xrt/drivers" -name "DisplayXR-SimDisplay.so" -type f | head -1)"
for f in "$RUNTIME_SO" "$CLI_BIN" "$PLUGIN_SO"; do
[ -n "$f" ] || { echo "error: missing build artifact (runtime/cli/plugin)" >&2; exit 1; }
done
[ -n "$SERVICE_BIN" ] || echo "note: displayxr-service not built — packaging without it (--service build adds it)"
VERSION="$(git -C "$ROOT" describe --tags --always --dirty 2>/dev/null || echo unknown)"
ARCH="$(uname -m)"
NAME="displayxr-runtime-linux-$ARCH-$VERSION"
STAGE="$DIST_DIR/$NAME"
echo "==> Staging $NAME"
rm -rf "$STAGE"
mkdir -p "$STAGE/bin" "$STAGE/lib/displayxr/plugins"
cp "$CLI_BIN" "$STAGE/bin/"
[ -n "$SERVICE_BIN" ] && cp "$SERVICE_BIN" "$STAGE/bin/"
cp "$RUNTIME_SO" "$STAGE/lib/"
cp "$PLUGIN_SO" "$STAGE/lib/displayxr/plugins/"
cp "$ROOT/scripts/linux/install.sh" "$ROOT/scripts/linux/uninstall.sh" "$STAGE/"
chmod +x "$STAGE/install.sh" "$STAGE/uninstall.sh"
echo "$VERSION" > "$STAGE/VERSION"
cat > "$STAGE/README.md" <<EOF
# DisplayXR runtime for Linux ($VERSION)
Lightweight OpenXR runtime for 3D displays — Linux x86_64 build with the
vendor-neutral sim-display display processor.
## Install (user-level, no root)
./install.sh
Registers this runtime as the OpenXR ActiveRuntime for your user, installs the
sim-display display processor into the shared DisplayProcessors discovery
root, and (when present) a systemd --user unit for displayxr-service.
System-wide instead: \`sudo ./install.sh --system\` (no systemd unit, v1).
Remove with \`./uninstall.sh\` (same flag).
## Verify
~/.local/share/displayxr/bin/displayxr-cli selftest
## Vendor display plug-ins
Vendor display processors (e.g. Leia SR) install separately into the same
DisplayProcessors root with a lower probe order and take precedence over
sim-display automatically. See the DisplayXR docs: plugin-discovery.md.
EOF
mkdir -p "$DIST_DIR"
tar -C "$DIST_DIR" -czf "$DIST_DIR/$NAME.tar.gz" "$NAME"
echo "==> $DIST_DIR/$NAME.tar.gz"