2024-02-05 10:32:51 +03:00
|
|
|
#!/usr/bin/bash -e
|
2024-01-30 05:04:15 +03:00
|
|
|
|
|
|
|
# if sudo is not installed, define an empty alias
|
|
|
|
maysudo=$(command -v sudo || true)
|
|
|
|
|
|
|
|
# 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-07 09:54:40 +03:00
|
|
|
vulkan-validationlayers*
|
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-07 09:54:40 +03:00
|
|
|
vulkan-validation-layers
|
2024-02-05 10:08:05 +03:00
|
|
|
)
|
2024-01-30 05:04:15 +03:00
|
|
|
$maysudo "$dnf" install -y "${deps[@]}"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
# 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-07 09:54:40 +03:00
|
|
|
vulkan-validation-layers
|
2024-02-05 10:08:05 +03:00
|
|
|
)
|
2024-01-30 05:04:15 +03:00
|
|
|
$maysudo "$pacman" -S --noconfirm "${deps[@]}"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Unsupported Linux distribution in script/linux"
|