mirror of
https://github.com/bleackstorm/SteamFrame-FPV-Control-Center.git
synced 2026-12-03 07:31:57 +01:00
55 lines
2.4 KiB
Bash
Executable File
55 lines
2.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Script de compilation optimisée pour le casque Valve Steam Frame (ARM64 / SteamOS)
|
|
set -euo pipefail
|
|
|
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null 2>&1 && pwd)"
|
|
cd "$DIR"
|
|
|
|
echo "=== Compilation optimisée pour Valve Steam Frame (SteamOS ARM64) ==="
|
|
|
|
ARCH=$(uname -m)
|
|
echo "[1/3] Architecture détectée : ${ARCH}"
|
|
|
|
if [ "$ARCH" = "aarch64" ]; then
|
|
echo "[+] Exécution native sur architecture ARM64 (Steam Frame / Snapdragon 8 Gen 3)."
|
|
|
|
# Vérification des dépendances sur SteamOS / Arch Linux ARM
|
|
if command -v pacman >/dev/null 2>&1; then
|
|
echo "[+] Vérification des paquets requis via pacman..."
|
|
sudo pacman -S --needed --noconfirm \
|
|
gcc pkgconf vulkan-devel openxr \
|
|
gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-libav || true
|
|
fi
|
|
|
|
echo "[2/3] Compilation Release native avec optimisations CPU Cortex-X4 / NEON..."
|
|
export RUSTFLAGS="-C target-cpu=native -C opt-level=3"
|
|
cargo build --release
|
|
|
|
echo "[3/3] Installation locale des lanceurs .desktop (Bureau GPUI + Mode VR Gaming)..."
|
|
mkdir -p ~/.local/share/applications
|
|
chmod +x "$DIR/launch.sh" "$DIR/launch_vr.sh"
|
|
for desktop_file in steamframe-fpv.desktop steamframe-fpv-vr.desktop; do
|
|
cp "$desktop_file" ~/.local/share/applications/
|
|
sed -i -E \
|
|
-e "s|^Exec=.*/(launch(_vr)?\.sh)|Exec=$DIR/\1|g" \
|
|
-e "s|^Path=.*|Path=$DIR|g" \
|
|
-e "s|^Icon=.*/assets/|Icon=$DIR/assets/|g" \
|
|
"$HOME/.local/share/applications/$desktop_file"
|
|
done
|
|
|
|
echo "=== SUCCÈS : Binaire compilé dans $DIR/target/release/steamframe-fpv ==="
|
|
echo " Mode Gaming : ajoutez 'SteamFrame FPV (Mode VR)' (launch_vr.sh) en jeu non-Steam."
|
|
else
|
|
echo "[!] Exécution sur hôte ${ARCH} (Ubuntu / PC de développement)."
|
|
echo "[2/3] Compilation Release hôte standard..."
|
|
cargo build --release
|
|
|
|
echo "[3/3] Création de l'archive de déploiement pour le Steam Frame..."
|
|
mkdir -p dist
|
|
tar --exclude="target" --exclude=".git" -czf dist/steamframe-fpv-deploy.tar.gz \
|
|
Cargo.toml Cargo.lock src scripts assets README.md launch.sh launch_vr.sh steamframe-fpv.desktop steamframe-fpv-vr.desktop
|
|
|
|
echo "=== SUCCÈS : Archive de déploiement créée dans $DIR/dist/steamframe-fpv-deploy.tar.gz ==="
|
|
echo "Pour déployer sur le casque, lancez : ./scripts/deploy_to_steamframe.sh [ip_steamframe]"
|
|
fi
|