Compare commits

...

2 Commits

2 changed files with 96 additions and 91 deletions

View File

@@ -127,38 +127,6 @@ install_pacman() {
fi fi
} }
install_aur() {
local packages=("$@")
local aur_helper=""
if have paru; then
aur_helper="paru"
elif have yay; then
aur_helper="yay"
else
log_error "No AUR helper found (install paru or yay)"
return 1
fi
local pkg
local rc=0
for pkg in "${packages[@]}"; do
if is_package_installed "$pkg"; then
continue
fi
tui_info "Installing $pkg from AUR..."
if "$aur_helper" -S --needed --noconfirm "$pkg"; then
tui_success "$pkg installed"
else
tui_warn "$pkg could not be installed"
rc=1
fi
done
return $rc
}
replace_home_paths() { replace_home_paths() {
local dir="$1" local dir="$1"
local original_home="${2:-/home/pascal}" local original_home="${2:-/home/pascal}"
@@ -270,6 +238,43 @@ system_summary() {
SUMMARY SUMMARY
} }
install_aur_package() {
local pkgname="$1"
local build_dir
build_dir="$(mktemp -d)"
tui_info "Cloning $pkgname from AUR directly..."
if ! git clone "https://aur.archlinux.org/$pkgname.git" "$build_dir/$pkgname" 2>/dev/null; then
rm -rf "$build_dir"
return 1
fi
tui_info "Building $pkgname..."
if (cd "$build_dir/$pkgname" && makepkg -si --needed --noconfirm); then
rm -rf "$build_dir"
return 0
fi
local rc=$?
rm -rf "$build_dir"
return $rc
}
_install_paru_bin() {
local build_dir="$1"
git clone https://aur.archlinux.org/paru-bin.git "$build_dir/paru-bin" 2>/dev/null || return 1
(cd "$build_dir/paru-bin" && makepkg -si --needed --noconfirm) 2>/dev/null || return 1
return 0
}
_install_paru_source() {
local build_dir="$1"
sudo_run pacman -S --needed --noconfirm go
git clone https://aur.archlinux.org/paru.git "$build_dir/paru" 2>/dev/null || return 1
(cd "$build_dir/paru" && makepkg -si --needed --noconfirm) 2>/dev/null || return 1
return 0
}
install_aur_helper() { install_aur_helper() {
if have paru || have yay; then if have paru || have yay; then
return 0 return 0
@@ -289,35 +294,69 @@ install_aur_helper() {
local build_dir local build_dir
build_dir="$(mktemp -d)" build_dir="$(mktemp -d)"
tui_info "Downloading paru-bin from AUR..." tui_info "Installing paru-bin (binary AUR helper)..."
if ! git clone https://aur.archlinux.org/paru-bin.git "$build_dir/paru-bin"; then if _install_paru_bin "$build_dir" && paru --version >/dev/null 2>&1; then
tui_error "Failed to download paru-bin. Check network connectivity." tui_success "paru works"
rm -rf "$build_dir"
return 1
fi
tui_info "Building paru-bin with makepkg..."
if (cd "$build_dir/paru-bin" && makepkg -si --needed --noconfirm); then
tui_success "paru installed successfully"
rm -rf "$build_dir" rm -rf "$build_dir"
return 0 return 0
fi fi
local rc=$? tui_warn "paru-bin failed or has library mismatch. Building paru from source..."
tui_warn "makepkg failed (exit $rc). Trying yay-bin..." rm -rf "$build_dir"/*
rm -rf "$build_dir/paru-bin" mkdir -p "$build_dir"
if git clone https://aur.archlinux.org/yay-bin.git "$build_dir/yay-bin"; then if _install_paru_source "$build_dir"; then
if (cd "$build_dir/yay-bin" && makepkg -si --needed --noconfirm); then tui_success "paru built and installed from source"
rm -rf "$build_dir"
return 0
fi
tui_warn "paru source build failed. Trying yay as fallback..."
rm -rf "$build_dir"/*
if git clone https://aur.archlinux.org/yay-bin.git "$build_dir/yay-bin" 2>/dev/null; then
if (cd "$build_dir/yay-bin" && makepkg -si --needed --noconfirm) 2>/dev/null; then
tui_success "yay installed successfully" tui_success "yay installed successfully"
rm -rf "$build_dir" rm -rf "$build_dir"
return 0 return 0
fi fi
fi fi
tui_warn "Could not install AUR helper. Install manually:" tui_warn "Could not install any AUR helper. Install manually:"
tui_info " cd /tmp && git clone https://aur.archlinux.org/paru-bin.git" tui_info " sudo pacman -S go && git clone https://aur.archlinux.org/paru.git"
tui_info " cd paru-bin && makepkg -si" tui_info " cd paru && makepkg -si"
rm -rf "$build_dir" rm -rf "$build_dir"
return 1 return 1
} }
install_aur() {
local packages=("$@")
local pkg
local rc=0
for pkg in "${packages[@]}"; do
if is_package_installed "$pkg"; then
continue
fi
if have paru && paru --version >/dev/null 2>&1; then
tui_info "Installing $pkg from AUR (via paru)..."
if paru -S --needed --noconfirm "$pkg"; then
tui_success "$pkg installed"
continue
fi
tui_warn "paru failed for $pkg. Trying direct AUR install..."
fi
if install_aur_package "$pkg"; then
tui_success "$pkg installed"
else
tui_warn "$pkg could not be installed. Try manually:"
tui_info " cd /tmp && git clone https://aur.archlinux.org/$pkg.git"
tui_info " cd $pkg && makepkg -si"
rc=1
fi
done
return $rc
}

View File

@@ -1,7 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
AGS_LOG_DIR="/tmp/omeron-ags-logs"
module_description() { module_description() {
printf "AGS (Aylur's Gtk Shell) - Widget system for Hyprland\n" printf "AGS (Aylur's Gtk Shell) - Widget system for Hyprland\n"
} }
@@ -11,30 +9,6 @@ module_should_skip() {
command -v ags >/dev/null 2>&1 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() { module_main() {
log_section "AGS Installation" log_section "AGS Installation"
@@ -43,8 +17,8 @@ module_main() {
return 0 return 0
fi fi
if ! have paru; then if ! have git; then
tui_warn "paru not available. Install ags manually: paru -S aylurs-gtk-shell-git" tui_warn "git not available. Install ags manually after installing git."
return 0 return 0
fi fi
@@ -54,27 +28,19 @@ module_main() {
printf '\n' printf '\n'
if ! tui_confirm "Install AGS now?"; then if ! tui_confirm "Install AGS now?"; then
tui_info "AGS installation skipped. Run later: paru -S aylurs-gtk-shell-git" tui_info "AGS installation skipped."
return 0 return 0
fi fi
if ! _ags_build_deps; then local deps=("libastal-io-git" "libastal-git" "libastal-4-git")
if ! install_aur "${deps[@]}"; then
tui_warn "Some AGS dependencies failed to build." 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 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" tui_info "AGS installation aborted."
return 0 return 0
fi fi
fi fi
tui_info "Building aylurs-gtk-shell-git from AUR..." tui_info "Building aylurs-gtk-shell-git from AUR..."
mkdir -p "$AGS_LOG_DIR" install_aur "aylurs-gtk-shell-git"
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 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
} }