Split dependency installation scripts into distro specific scripts. This is more reliable than the script trying to figure out which distro is running on its own.

This commit is contained in:
Storm Dragon
2025-08-01 14:27:44 -04:00
parent da065e5835
commit 15f90a7979
2 changed files with 35 additions and 36 deletions

View File

@ -3,12 +3,8 @@
# Immediately exit if errors are encountered. # Immediately exit if errors are encountered.
set -e set -e
# Installer/configuration tool for wine # Wine dependencies installer for Arch Linux
# If this fails on your system, please contact storm_dragon@linux-a11y.org # If this fails on your system, please contact storm_dragon@stormux.org
is_function() {
LC_ALL=C type "$1" 2> /dev/null | grep -q "$1 is a function"
}
configure_arch() { configure_arch() {
packageList=( packageList=(
@ -29,7 +25,7 @@ configure_arch() {
mpg123 mpg123
libpulse libpulse
libpng libpng
libjpeg-turbo libjpeg-turbo
gnutls gnutls
alsa-plugins alsa-plugins
alsa-lib alsa-lib
@ -70,36 +66,10 @@ configure_arch() {
# Some of these may fail, so do them in a for loop. # Some of these may fail, so do them in a for loop.
yay -Syy yay -Syy
for i in "${packageList[@]}" ; do for i in "${packageList[@]}" ; do
yay -S --needed --noconfirm $i yay -S --needed --noconfirm "$i" || true
done done
} }
configure_debian() { configure_arch
packageList=(
curl
dialog
gawk
gstreamer1.0-plugins-bad:i386
gstreamer1.0-plugins-good:i386
gstreamer1.0-plugins-ugly:i386
mono-complete
ncurses5-dev
w3m
winehq-stable
)
# make sure 32 bit libraries are available
sudo dpkg --add-architecture i386
sudo apt install --install-recommends ${packageList[*]}
}
distro="$(head -1 /etc/issue | cut -d ' ' -f1)"
distro="${distro,,}"
if is_function configure_${distro} ; then
configure_${distro}
else
echo "${distro^} is not yet supported. If you want it added, please contact storm_dragon@linux-a11y.org" | fold -s -w 72
fi
exit 0 exit 0

View File

@ -0,0 +1,29 @@
#!/bin/bash
# Immediately exit if errors are encountered.
set -e
# Wine dependencies installer for Debian/Ubuntu
# If this fails on your system, please contact storm_dragon@stormux.org
configure_debian() {
packageList=(
curl
dialog
gawk
gstreamer1.0-plugins-bad:i386
gstreamer1.0-plugins-good:i386
gstreamer1.0-plugins-ugly:i386
mono-complete
ncurses5-dev
w3m
winehq-stable
)
# make sure 32 bit libraries are available
sudo dpkg --add-architecture i386
sudo apt install --install-recommends "${packageList[@]}"
}
configure_debian
exit 0