Full working app with: - Rust core (mtgc-core): Scryfall ingester, nucleo fuzzy search, SQLite two-DB architecture (reference.db + library.db via ATTACH), criteria filters, deck ops - Tauri v2 shell exposing the core as typed IPC commands - React/TS frontend: card entry, library browser, deck editor - Features: fuzzy card search, color/CMC/type/commander-identity filters, tile/list view toggle, hover card previews, deck format + commander support, per-card location field, grouping by type/subtype/CMC/color, localStorage persistence for active tab/deck/grouping, Discord-inspired dark UI (#C8553D accent) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
81 lines
2.4 KiB
Bash
Executable File
81 lines
2.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# devel-setup.sh — one-time developer environment setup for mtgc.
|
|
#
|
|
# Installs the Tauri v2 Linux system libraries and the Tauri CLI, and verifies
|
|
# the toolchain (Rust, Node, pkg-config libs) needed to build the desktop shell.
|
|
#
|
|
# Safe to re-run: package installs are idempotent and the CLI install is skipped
|
|
# if already present.
|
|
#
|
|
# Usage:
|
|
# ./scripts/devel-setup.sh
|
|
#
|
|
set -euo pipefail
|
|
|
|
info() { printf '\033[1;34m==>\033[0m %s\n' "$*"; }
|
|
warn() { printf '\033[1;33m[warn]\033[0m %s\n' "$*"; }
|
|
err() { printf '\033[1;31m[err]\033[0m %s\n' "$*" >&2; }
|
|
|
|
# --- 1. Prerequisites already expected on the machine ----------------------
|
|
|
|
if ! command -v rustc >/dev/null 2>&1; then
|
|
err "Rust not found. Install from https://rustup.rs and re-run."
|
|
exit 1
|
|
fi
|
|
info "Rust: $(rustc --version)"
|
|
|
|
if ! command -v node >/dev/null 2>&1; then
|
|
warn "Node.js not found — needed for the Vite/React frontend."
|
|
warn "Install Node 18+ (e.g. 'sudo dnf install nodejs') before running the app."
|
|
else
|
|
info "Node: $(node --version)"
|
|
fi
|
|
|
|
# --- 2. Tauri v2 system libraries (Fedora / dnf) ---------------------------
|
|
|
|
FEDORA_PKGS=(
|
|
webkit2gtk4.1-devel
|
|
gtk3-devel
|
|
libappindicator-gtk3-devel
|
|
librsvg2-devel
|
|
file
|
|
openssl-devel
|
|
)
|
|
|
|
if command -v dnf >/dev/null 2>&1; then
|
|
info "Installing Tauri system libraries via dnf (sudo required)…"
|
|
sudo dnf install -y "${FEDORA_PKGS[@]}"
|
|
else
|
|
warn "dnf not found — this script targets Fedora."
|
|
warn "Install the equivalents of: ${FEDORA_PKGS[*]}"
|
|
warn "See https://tauri.app/start/prerequisites/ for your distro."
|
|
fi
|
|
|
|
# --- 3. Verify the libraries pkg-config will look for ----------------------
|
|
|
|
check_pkg() {
|
|
if pkg-config --exists "$1" 2>/dev/null; then
|
|
info "found $1"
|
|
else
|
|
warn "missing $1 (Tauri build may fail)"
|
|
fi
|
|
}
|
|
if command -v pkg-config >/dev/null 2>&1; then
|
|
check_pkg webkit2gtk-4.1
|
|
check_pkg gtk+-3.0
|
|
else
|
|
warn "pkg-config not found; cannot verify libraries."
|
|
fi
|
|
|
|
# --- 4. Tauri v2 CLI -------------------------------------------------------
|
|
|
|
if cargo tauri --version >/dev/null 2>&1; then
|
|
info "Tauri CLI: $(cargo tauri --version 2>&1 | head -1)"
|
|
else
|
|
info "Installing Tauri v2 CLI (cargo install tauri-cli --version '^2')…"
|
|
cargo install tauri-cli --version '^2'
|
|
fi
|
|
|
|
info "Setup complete. Next: scaffold + run the desktop shell with 'cargo tauri dev'."
|