zed/script/linux
aryal 37ffa86043
Add libzstd to script/linux (#8780)
add a missing dependency to linux script
2024-03-03 11:21:36 -08:00

87 lines
1.6 KiB
Bash
Executable file

#!/usr/bin/bash -e
# if sudo is not installed, define an empty alias
maysudo=$(command -v sudo || true)
# Ubuntu, Debian, etc.
# https://packages.ubuntu.com/
apt=$(command -v apt-get || true)
if [[ -n $apt ]]; then
deps=(
libasound2-dev
libfontconfig-dev
libwayland-dev
libxkbcommon-x11-dev
libssl-dev
libzstd-dev
)
$maysudo "$apt" install -y "${deps[@]}"
exit 0
fi
# Fedora, CentOS, RHEL, etc.
# https://packages.fedoraproject.org/
dnf=$(command -v dnf || true)
if [[ -n $dnf ]]; then
deps=(
alsa-lib-devel
fontconfig-devel
wayland-devel
libxkbcommon-x11-devel
openssl-devel
libzstd-devel
)
$maysudo "$dnf" install -y "${deps[@]}"
exit 0
fi
# 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
libzstd-devel
)
$maysudo "$zyp" install -y "${deps[@]}"
exit 0
fi
# Arch, Manjaro, etc.
# https://archlinux.org/packages
pacman=$(command -v pacman || true)
if [[ -n $pacman ]]; then
deps=(
alsa-lib
fontconfig
wayland
libxkbcommon-x11
openssl
libzstd
)
$maysudo "$pacman" -S --needed --noconfirm "${deps[@]}"
exit 0
fi
# Void
# https://voidlinux.org/packages/
xbps=$(command -v xbps-install || true)
if [[ -n $xbps ]]; then
deps=(
alsa-lib-devel
fontconfig-devel
wayland-devel
libxkbcommon-devel
openssl-devel
libzstd-devel
)
$maysudo "$xbps" -Syu "${deps[@]}"
exit 0
fi
echo "Unsupported Linux distribution in script/linux"