fix ags: build deps separately with log capture, sync DB preflight
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
AGS_LOG_DIR="/tmp/omeron-ags-logs"
|
||||
|
||||
module_description() {
|
||||
printf "AGS (Aylur's Gtk Shell) - Widget system for Hyprland\n"
|
||||
}
|
||||
@@ -9,6 +11,30 @@ module_should_skip() {
|
||||
command -v ags >/dev/null 2>&1
|
||||
}
|
||||
|
||||
_ags_build_deps() {
|
||||
local deps=("libastal-io-git" "libastal-git" "libastal-4-git")
|
||||
local all_ok=0
|
||||
|
||||
mkdir -p "$AGS_LOG_DIR"
|
||||
|
||||
for dep in "${deps[@]}"; do
|
||||
if is_package_installed "$dep"; then
|
||||
tui_success "$dep already installed"
|
||||
continue
|
||||
fi
|
||||
tui_info "Building $dep from AUR (dependency for AGS)..."
|
||||
local log="$AGS_LOG_DIR/$dep.log"
|
||||
if paru -S --needed --noconfirm "$dep" > "$log" 2>&1; then
|
||||
tui_success "$dep built and installed"
|
||||
else
|
||||
tui_warn "$dep build failed — see $log"
|
||||
all_ok=1
|
||||
fi
|
||||
done
|
||||
|
||||
return $all_ok
|
||||
}
|
||||
|
||||
module_main() {
|
||||
log_section "AGS Installation"
|
||||
|
||||
@@ -17,28 +43,38 @@ module_main() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
if ! have paru && ! have yay; then
|
||||
tui_warn "No AUR helper found. Install ags manually: paru -S aylurs-gtk-shell-git"
|
||||
if ! have paru; then
|
||||
tui_warn "paru not available. Install ags manually: paru -S aylurs-gtk-shell-git"
|
||||
return 0
|
||||
fi
|
||||
|
||||
local aur_helper
|
||||
have paru && aur_helper="paru" || aur_helper="yay"
|
||||
local ags_pkg="aylurs-gtk-shell-git"
|
||||
|
||||
tui_warn "AGS must be built from source (npm install + Go + meson)."
|
||||
tui_warn "This can take several minutes."
|
||||
tui_warn "This will first build 3 libastal libraries, then AGS itself."
|
||||
tui_warn "Total time can be 5-15 minutes depending on your system."
|
||||
printf '\n'
|
||||
|
||||
if ! tui_confirm "Install AGS now?"; then
|
||||
tui_info "AGS installation skipped. Run later: $aur_helper -S $ags_pkg"
|
||||
tui_info "AGS installation skipped. Run later: paru -S aylurs-gtk-shell-git"
|
||||
return 0
|
||||
fi
|
||||
|
||||
tui_info "Installing $ags_pkg from AUR..."
|
||||
if "$aur_helper" -S --needed --noconfirm "$ags_pkg"; then
|
||||
if ! _ags_build_deps; then
|
||||
tui_warn "Some AGS dependencies failed to build."
|
||||
tui_info "Check logs in $AGS_LOG_DIR/ for details."
|
||||
if ! tui_confirm "Try to install AGS anyway?"; then
|
||||
tui_info "AGS installation aborted. Fix deps manually, then run: paru -S aylurs-gtk-shell-git"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
tui_info "Building aylurs-gtk-shell-git from AUR..."
|
||||
mkdir -p "$AGS_LOG_DIR"
|
||||
local log="$AGS_LOG_DIR/aylurs-gtk-shell-git.log"
|
||||
if paru -S --needed --noconfirm aylurs-gtk-shell-git > "$log" 2>&1; then
|
||||
tui_success "AGS installed"
|
||||
else
|
||||
tui_warn "AGS installation failed. Try manually: $aur_helper -S $ags_pkg"
|
||||
tui_warn "AGS build failed — see $log"
|
||||
tui_info "Check the last 30 lines: tail -30 $log"
|
||||
tui_info "Try manually: paru -S aylurs-gtk-shell-git"
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user