forked from tuna-os/tuna-installer
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathrun-dev.sh
More file actions
executable file
·74 lines (65 loc) · 2.94 KB
/
Copy pathrun-dev.sh
File metadata and controls
executable file
·74 lines (65 loc) · 2.94 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
#!/usr/bin/bash
# run-dev.sh — run bootc-installer from the local build for development
#
# Usage:
# ./run-dev.sh # launch the installer window
# ./run-dev.sh --rebuild # force full rebuild before launching
# ./run-dev.sh --logs # tail the log only (don't launch)
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PREFIX="/tmp/bootc-installer-dev"
FISHERMAN="${TUNA_FISHERMAN_PATH:-/var/tmp/fisherman-test}"
RECIPE="${VANILLA_CUSTOM_RECIPE:-$SCRIPT_DIR/recipe.json}"
RUN_LOG="/tmp/bootc-installer-run.log"
DEBUG_LOG="$HOME/.cache/tuna-installer/installer-debug.log"
if [[ "$1" == "--logs" ]]; then
tail -f "$DEBUG_LOG"
exit 0
fi
# ── Rebuild check ─────────────────────────────────────────────────────────────
_needs_rebuild=0
if [[ "$1" == "--rebuild" ]] || [[ ! -f "$PREFIX/bin/bootc-installer" ]]; then
_needs_rebuild=1
elif find "$SCRIPT_DIR/bootc_installer" -newer "$PREFIX/share/org.bootcinstaller.Installer/bootc-installer.gresource" \( -name "*.py" -o -name "*.blp" \) 2>/dev/null | grep -q .; then
echo "[run-dev] Sources changed — rebuilding..."
_needs_rebuild=1
fi
if [[ "$_needs_rebuild" == "1" ]]; then
cd "$SCRIPT_DIR"
toolbox run --container dakota-lab bash -c "
meson setup build --prefix=/tmp/bootc-installer-dev -Dvariant=gnome -Dbuild-fisherman=false --reconfigure 2>/dev/null || true
ninja -C build
meson install -C build
"
fi
# ── Kill any existing instance ────────────────────────────────────────────────
pkill -f "python3 $PREFIX/bin/bootc-installer" 2>/dev/null; sleep 0.5
# ── Launch ────────────────────────────────────────────────────────────────────
echo "[run-dev] Starting bootc-installer (Project Bluefin Dakota)"
echo " recipe : $RECIPE"
echo " fisherman: $FISHERMAN"
echo " run log : $RUN_LOG"
echo " debug log: $DEBUG_LOG"
if [[ -n "${BOOTC_PREVIEW_SCREEN:-}" ]]; then
echo " preview : $BOOTC_PREVIEW_SCREEN"
fi
echo ""
echo " To follow logs: ./run-dev.sh --logs"
echo ""
toolbox run --container dakota-lab bash << EOF &
export XDG_RUNTIME_DIR=/run/user/$(id -u)
export WAYLAND_DISPLAY=${WAYLAND_DISPLAY:-wayland-0}
export TUNA_FISHERMAN_PATH=$FISHERMAN
export GSETTINGS_SCHEMA_DIR=$PREFIX/share/glib-2.0/schemas:/usr/share/glib-2.0/schemas
export XDG_DATA_DIRS=$PREFIX/share:/usr/share
export VANILLA_CUSTOM_RECIPE=$RECIPE
export BOOTC_DEMO=1
if [[ -n "${BOOTC_PREVIEW_SCREEN:-}" ]]; then
export BOOTC_PREVIEW_SCREEN=$BOOTC_PREVIEW_SCREEN
fi
python3 $PREFIX/bin/bootc-installer >> $RUN_LOG 2>&1
EOF
disown
echo "[run-dev] Launched (PID $!). Tailing debug log..."
sleep 2
tail -f "$DEBUG_LOG"