2024-03-19 21:22:26 +03:00
|
|
|
#!/usr/bin/bash
|
|
|
|
|
|
|
|
set -e
|
2024-01-30 05:04:15 +03:00
|
|
|
|
|
|
|
# if sudo is not installed, define an empty alias
|
2024-03-04 00:44:39 +03:00
|
|
|
maysudo=$(command -v sudo || command -v doas || true)
|
2024-01-30 05:04:15 +03:00
|
|
|
|
|
|
|
# Ubuntu, Debian, etc.
|
2024-02-05 10:08:05 +03:00
|
|
|
# https://packages.ubuntu.com/
|
2024-01-30 05:04:15 +03:00
|
|
|
apt=$(command -v apt-get || true)
|
|
|
|
if [[ -n $apt ]]; then
|
2024-02-05 10:08:05 +03:00
|
|
|
deps=(
|
|
|
|
libasound2-dev
|
|
|
|
libfontconfig-dev
|
2024-02-15 01:50:11 +03:00
|
|
|
libwayland-dev
|
2024-02-15 22:58:47 +03:00
|
|
|
libxkbcommon-x11-dev
|
2024-02-29 02:06:11 +03:00
|
|
|
libssl-dev
|
2024-03-03 22:21:36 +03:00
|
|
|
libzstd-dev
|
2024-03-11 18:29:06 +03:00
|
|
|
libvulkan1
|
2024-02-05 10:08:05 +03:00
|
|
|
)
|
2024-01-30 05:04:15 +03:00
|
|
|
$maysudo "$apt" install -y "${deps[@]}"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Fedora, CentOS, RHEL, etc.
|
2024-02-05 10:08:05 +03:00
|
|
|
# https://packages.fedoraproject.org/
|
2024-01-30 05:04:15 +03:00
|
|
|
dnf=$(command -v dnf || true)
|
|
|
|
if [[ -n $dnf ]]; then
|
2024-02-05 10:08:05 +03:00
|
|
|
deps=(
|
|
|
|
alsa-lib-devel
|
|
|
|
fontconfig-devel
|
2024-02-15 01:50:11 +03:00
|
|
|
wayland-devel
|
2024-02-15 22:58:47 +03:00
|
|
|
libxkbcommon-x11-devel
|
2024-02-22 00:57:39 +03:00
|
|
|
openssl-devel
|
2024-03-03 22:21:36 +03:00
|
|
|
libzstd-devel
|
2024-03-11 18:29:06 +03:00
|
|
|
vulkan-loader
|
2024-02-05 10:08:05 +03:00
|
|
|
)
|
2024-01-30 05:04:15 +03:00
|
|
|
$maysudo "$dnf" install -y "${deps[@]}"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2024-02-22 02:01:33 +03:00
|
|
|
# openSuse
|
|
|
|
# https://software.opensuse.org/
|
|
|
|
zyp=$(command -v zypper || true)
|
|
|
|
if [[ -n $zyp ]]; then
|
|
|
|
deps=(
|
|
|
|
alsa-devel
|
|
|
|
fontconfig-devel
|
|
|
|
wayland-devel
|
|
|
|
libxkbcommon-x11-devel
|
|
|
|
openssl-devel
|
2024-03-03 22:21:36 +03:00
|
|
|
libzstd-devel
|
2024-03-11 18:29:06 +03:00
|
|
|
vulkan-loader
|
2024-02-22 02:01:33 +03:00
|
|
|
)
|
|
|
|
$maysudo "$zyp" install -y "${deps[@]}"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2024-01-30 05:04:15 +03:00
|
|
|
# Arch, Manjaro, etc.
|
2024-02-05 10:08:05 +03:00
|
|
|
# https://archlinux.org/packages
|
2024-01-30 05:04:15 +03:00
|
|
|
pacman=$(command -v pacman || true)
|
|
|
|
if [[ -n $pacman ]]; then
|
2024-02-05 10:08:05 +03:00
|
|
|
deps=(
|
|
|
|
alsa-lib
|
|
|
|
fontconfig
|
2024-02-15 01:50:11 +03:00
|
|
|
wayland
|
2024-02-15 22:58:47 +03:00
|
|
|
libxkbcommon-x11
|
2024-02-22 00:57:39 +03:00
|
|
|
openssl
|
2024-03-04 00:26:09 +03:00
|
|
|
zstd
|
2024-02-05 10:08:05 +03:00
|
|
|
)
|
2024-02-15 01:28:29 +03:00
|
|
|
$maysudo "$pacman" -S --needed --noconfirm "${deps[@]}"
|
2024-01-30 05:04:15 +03:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2024-03-02 03:47:59 +03:00
|
|
|
# Void
|
|
|
|
# https://voidlinux.org/packages/
|
|
|
|
xbps=$(command -v xbps-install || true)
|
|
|
|
if [[ -n $xbps ]]; then
|
|
|
|
deps=(
|
|
|
|
alsa-lib-devel
|
|
|
|
fontconfig-devel
|
2024-03-05 20:16:08 +03:00
|
|
|
libxcb-devel
|
2024-03-02 03:47:59 +03:00
|
|
|
libxkbcommon-devel
|
2024-03-03 22:21:36 +03:00
|
|
|
libzstd-devel
|
2024-03-05 20:16:08 +03:00
|
|
|
openssl-devel
|
|
|
|
wayland-devel
|
2024-03-11 18:29:06 +03:00
|
|
|
vulkan-loader
|
2024-03-02 03:47:59 +03:00
|
|
|
)
|
|
|
|
$maysudo "$xbps" -Syu "${deps[@]}"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2024-01-30 05:04:15 +03:00
|
|
|
echo "Unsupported Linux distribution in script/linux"
|