183 lines
6.5 KiB
Bash
Executable File
183 lines
6.5 KiB
Bash
Executable File
install_package() {
|
|
# If for some reason we have to change AUR helpers, this function should make it easy to update everything all at once.
|
|
# make sure system is up to date
|
|
yay --sudoflags "${sudoFlags[@]}" --sudoloop --noconfirm -Syu
|
|
yay --sudoflags "${sudoFlags[@]}" --sudoloop --needed --noconfirm -Sy "$@"
|
|
}
|
|
|
|
url_install() {
|
|
local url="$1"
|
|
local tmpfile
|
|
tmpfile=$(mktemp /tmp/pkg.XXXXXX.pkg.tar.xz)
|
|
# Make sure system is up to date
|
|
yay --sudoflags "${sudoFlags[@]}" --sudoloop --noconfirm -Syu
|
|
if curl -fL --retry 10 -o "$tmpfile" "$url"; then
|
|
yay --sudoflags "${sudoFlags[@]}" --sudoloop --noconfirm -U "$tmpfile"
|
|
fi
|
|
rm -f "$tmpfile"
|
|
}
|
|
|
|
restart() {
|
|
if dialog --clear --backtitle "Stormux" --yesno "Would you like to reboot now to apply changes?" 10 80 ; then
|
|
sudo "${sudoFlags[@]}" reboot
|
|
fi
|
|
}
|
|
|
|
attention() {
|
|
play -qnV0 synth 3 pluck D3 pluck A3 pluck D4 pluck F4 pluck A4 delay 0 .1 .2 .3 .4 remix - chorus 0.9 0.9 38 0.75 0.3 0.5 -t
|
|
}
|
|
|
|
install_xlibre() {
|
|
local buildDir="/tmp/xlibre-build-$$"
|
|
local success=true
|
|
|
|
# Check if we have internet connectivity
|
|
if ! ping -c 1 aur.archlinux.org &>/dev/null; then
|
|
msgbox "No internet connection detected. X11Libre installation requires internet access."
|
|
return 1
|
|
fi
|
|
|
|
# Check available disk space (need at least 2GB for building)
|
|
local available_space=$(df /tmp | awk 'NR==2 {print $4}')
|
|
if [[ $available_space -lt 2097152 ]]; then
|
|
msgbox "Insufficient disk space in /tmp. Need at least 2GB free for X11Libre build."
|
|
return 1
|
|
fi
|
|
|
|
infobox "Setting up X11Libre build environment..."
|
|
mkdir -p "$buildDir"
|
|
cd "$buildDir" || {
|
|
msgbox "Failed to create build directory. Installation aborted."
|
|
return 1
|
|
}
|
|
|
|
# Download PKGBUILDs with error checking
|
|
infobox "Downloading X11Libre PKGBUILDs..."
|
|
if ! yay -G xlibre-server-git; then
|
|
msgbox "Failed to download xlibre-server-git PKGBUILD from AUR."
|
|
cd / && rm -rf "$buildDir"
|
|
return 1
|
|
fi
|
|
|
|
if ! yay -G xf86-input-libinput-xlibre; then
|
|
msgbox "Failed to download xf86-input-libinput-xlibre PKGBUILD from AUR."
|
|
cd / && rm -rf "$buildDir"
|
|
return 1
|
|
fi
|
|
|
|
if ! yay -G xf86-video-dummy-with-vt; then
|
|
msgbox "Failed to download xf86-video-dummy-with-vt PKGBUILD from AUR."
|
|
cd / && rm -rf "$buildDir"
|
|
return 1
|
|
fi
|
|
|
|
# Build X11Libre server first
|
|
infobox "Building X11Libre server (this may take 10-15 minutes)..."
|
|
cd "$buildDir/xlibre-server-git"
|
|
if ! makepkg -crs --noconfirm; then
|
|
msgbox "Failed to build X11Libre server. Installation aborted."
|
|
cd / && rm -rf "$buildDir"
|
|
return 1
|
|
fi
|
|
|
|
# Modify and build input driver
|
|
infobox "Building X11Libre input driver..."
|
|
cd "$buildDir/xf86-input-libinput-xlibre"
|
|
|
|
# Update PKGBUILD for correct dependencies
|
|
sed -i "s/makedepends=.*/makedepends=('xlibre-server-devel' 'X-ABI-XINPUT_VERSION=26.0')/" PKGBUILD
|
|
sed -i "s/conflicts=.*/conflicts=('xf86-input-libinput' 'xorg-server<1.19.0' 'X-ABI-XINPUT_VERSION<26' 'X-ABI-XINPUT_VERSION>=27')/" PKGBUILD
|
|
|
|
if ! makepkg -crs --noconfirm; then
|
|
msgbox "Failed to build X11Libre input driver. Installation aborted."
|
|
cd / && rm -rf "$buildDir"
|
|
return 1
|
|
fi
|
|
|
|
# Modify and build dummy video driver
|
|
infobox "Building X11Libre dummy video driver..."
|
|
cd "$buildDir/xf86-video-dummy-with-vt"
|
|
|
|
# Update PKGBUILD for X11Libre compatibility
|
|
sed -i "s/makedepends=.*/makedepends=('xlibre-server-devel-git' 'X-ABI-VIDEODRV_VERSION=28.0' 'xorgproto')/" PKGBUILD
|
|
sed -i "s/conflicts=.*/conflicts=('xorg-server<21.1.1' 'X-ABI-VIDEODRV_VERSION<28' 'X-ABI-VIDEODRV_VERSION>=29')/" PKGBUILD
|
|
sed -i 's/{,\.sig}//' PKGBUILD
|
|
sed -i "/'SKIP'/d" PKGBUILD
|
|
sed -i '/validpgpkeys=/s/^/#/' PKGBUILD
|
|
|
|
if ! makepkg -crs --noconfirm; then
|
|
msgbox "Failed to build X11Libre dummy video driver. Installation aborted."
|
|
cd / && rm -rf "$buildDir"
|
|
return 1
|
|
fi
|
|
|
|
# Remove conflicting packages
|
|
infobox "Removing conflicting Xorg packages..."
|
|
sudo "${sudoFlags[@]}" pacman -R --noconfirm xorg-server xf86-input-libinput xf86-video-fbdev 2>/dev/null || true
|
|
|
|
# Install X11Libre core
|
|
infobox "Installing X11Libre server..."
|
|
cd "$buildDir/xlibre-server-git"
|
|
if ! sudo "${sudoFlags[@]}" pacman -U --noconfirm xlibre-server-common-git-*.pkg.tar.* xlibre-server-devel-git-*.pkg.tar.*; then
|
|
msgbox "Failed to install X11Libre server components."
|
|
cd / && rm -rf "$buildDir"
|
|
return 1
|
|
fi
|
|
|
|
if ! sudo "${sudoFlags[@]}" pacman -Udd --noconfirm xlibre-server-git-*.pkg.tar.*; then
|
|
msgbox "Failed to install X11Libre server main package."
|
|
cd / && rm -rf "$buildDir"
|
|
return 1
|
|
fi
|
|
|
|
# Install input driver
|
|
infobox "Installing X11Libre input driver..."
|
|
cd "$buildDir/xf86-input-libinput-xlibre"
|
|
if ! sudo "${sudoFlags[@]}" pacman -U --noconfirm *.pkg.tar.*; then
|
|
msgbox "Failed to install X11Libre input driver."
|
|
cd / && rm -rf "$buildDir"
|
|
return 1
|
|
fi
|
|
|
|
# Install dummy video driver
|
|
infobox "Installing X11Libre dummy video driver..."
|
|
cd "$buildDir/xf86-video-dummy-with-vt"
|
|
if ! sudo "${sudoFlags[@]}" pacman -U --noconfirm *.pkg.tar.*; then
|
|
msgbox "Failed to install X11Libre dummy video driver."
|
|
cd / && rm -rf "$buildDir"
|
|
return 1
|
|
fi
|
|
|
|
# Build and install fbdev driver
|
|
infobox "Building and installing fbdev driver for X11Libre..."
|
|
cd "$buildDir"
|
|
if ! yay -G xf86-video-fbdev; then
|
|
msgbox "Failed to download fbdev driver PKGBUILD."
|
|
cd / && rm -rf "$buildDir"
|
|
return 1
|
|
fi
|
|
|
|
cd "$buildDir/xf86-video-fbdev"
|
|
sed -i "s/makedepends=.*/makedepends=('xlibre-server-devel-git' 'X-ABI-VIDEODRV_VERSION=28.0')/" PKGBUILD
|
|
sed -i "s/conflicts=.*/conflicts=('xorg-server<21.1.1' 'X-ABI-VIDEODRV_VERSION<28' 'X-ABI-VIDEODRV_VERSION>=29')/" PKGBUILD
|
|
|
|
if ! makepkg -crs --noconfirm; then
|
|
msgbox "Failed to build fbdev driver for X11Libre."
|
|
cd / && rm -rf "$buildDir"
|
|
return 1
|
|
fi
|
|
|
|
if ! sudo "${sudoFlags[@]}" pacman -U --noconfirm *.pkg.tar.*; then
|
|
msgbox "Failed to install fbdev driver for X11Libre."
|
|
cd / && rm -rf "$buildDir"
|
|
return 1
|
|
fi
|
|
|
|
# Cleanup
|
|
cd /
|
|
rm -rf "$buildDir"
|
|
|
|
infobox "X11Libre installation completed successfully!"
|
|
return 0
|
|
}
|