zed/script/linux
Conrad Irwin ac4c6c60f1
Make it (a tiny bit) easier to run your own collab (#9557)
* Allow creating channels when seeding
* Allow configuring a custom `SEED_PATH`
* Seed the database when creating/migrating it so you don't need a
  separate step for this.

Release Notes:

- N/A
2024-03-20 21:00:02 -06:00

103 lines
1.9 KiB
Bash
Executable File

#!/usr/bin/bash
set -e
# install the wasm toolchain
rustup target add wasm32-wasi
# if sudo is not installed, define an empty alias
maysudo=$(command -v sudo || command -v doas || 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
libvulkan1
)
$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=(
gcc
g++
alsa-lib-devel
fontconfig-devel
wayland-devel
libxkbcommon-x11-devel
openssl-devel
libzstd-devel
vulkan-loader
)
# libxkbcommon-x11-devel is in the crb repo
$maysudo "$dnf" config-manager --set-enabled crb
$maysudo "$dnf" install epel-release epel-next-release
$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
vulkan-loader
)
$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
zstd
)
$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
libxcb-devel
libxkbcommon-devel
libzstd-devel
openssl-devel
wayland-devel
vulkan-loader
)
$maysudo "$xbps" -Syu "${deps[@]}"
exit 0
fi
echo "Unsupported Linux distribution in script/linux"