#!/bin/bash # ============================================================ # ObsiGate Desktop — Build Linux (.deb + .AppImage) # Prérequis : Rust, Tauri CLI, libwebkit2gtk, Python 3.11 # ============================================================ set -e echo "========================================" echo " ObsiGate Desktop — Build Linux" echo "========================================" echo "" # ── 1. Vérifier les prérequis ───────────────────────────────── echo "[1/4] Verifying prerequisites..." command -v cargo >/dev/null 2>&1 || { echo "❌ Rust/Cargo not found. Install: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh"; exit 1; } command -v tauri >/dev/null 2>&1 || cargo install tauri-cli # Check system deps if command -v apt-get >/dev/null 2>&1; then sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev curl 2>/dev/null fi echo "✅ Dependencies OK" # ── 2. Préparer Python 3.11 ──────────────────────────────────── echo "[2/4] Preparing Python environment..." python3 -m venv python-embed/venv source python-embed/venv/bin/activate pip install --upgrade pip -q pip install -r ../backend/requirements.txt -q echo "✅ Python environment ready" # ── 3. Build Tauri ──────────────────────────────────────────── echo "[3/4] Building Tauri application..." cargo tauri build --target x86_64-unknown-linux-gnu --bundles deb,appimage echo "✅ Build successful" # ── 4. Résultats ─────────────────────────────────────────────── OUTDIR="target/x86_64-unknown-linux-gnu/release" echo "[4/4] Results:" ls -lh "$OUTDIR/bundle/deb/"*.deb 2>/dev/null ls -lh "$OUTDIR/bundle/appimage/"*.AppImage 2>/dev/null echo "" echo "✅ Done! Check $OUTDIR/bundle/"