linux

 1#!/usr/bin/bash -e
 2
 3# if sudo is not installed, define an empty alias
 4maysudo=$(command -v sudo || true)
 5
 6# Ubuntu, Debian, etc.
 7# https://packages.ubuntu.com/
 8apt=$(command -v apt-get || true)
 9if [[ -n $apt ]]; then
10  deps=(
11    libasound2-dev
12    libfontconfig-dev
13    vulkan-validationlayers*
14    libwayland-dev
15  )
16  $maysudo "$apt" install -y "${deps[@]}"
17  exit 0
18fi
19
20# Fedora, CentOS, RHEL, etc.
21# https://packages.fedoraproject.org/
22dnf=$(command -v dnf || true)
23if [[ -n $dnf ]]; then
24  deps=(
25    alsa-lib-devel
26    fontconfig-devel
27    vulkan-validation-layers
28    wayland-devel
29  )
30  $maysudo "$dnf" install -y "${deps[@]}"
31  exit 0
32fi
33
34# Arch, Manjaro, etc.
35# https://archlinux.org/packages
36pacman=$(command -v pacman || true)
37if [[ -n $pacman ]]; then
38  deps=(
39    alsa-lib
40    fontconfig
41    vulkan-validation-layers
42    wayland
43  )
44  $maysudo "$pacman" -S --needed --noconfirm "${deps[@]}"
45  exit 0
46fi
47
48echo "Unsupported Linux distribution in script/linux"