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 )
15 $maysudo "$apt" install -y "${deps[@]}"
16 exit 0
17fi
18
19# Fedora, CentOS, RHEL, etc.
20# https://packages.fedoraproject.org/
21dnf=$(command -v dnf || true)
22if [[ -n $dnf ]]; then
23 deps=(
24 alsa-lib-devel
25 fontconfig-devel
26 vulkan-validation-layers
27 )
28 $maysudo "$dnf" install -y "${deps[@]}"
29 exit 0
30fi
31
32# Arch, Manjaro, etc.
33# https://archlinux.org/packages
34pacman=$(command -v pacman || true)
35if [[ -n $pacman ]]; then
36 deps=(
37 alsa-lib
38 fontconfig
39 vulkan-validation-layers
40 )
41 $maysudo "$pacman" -S --needed --noconfirm "${deps[@]}"
42 exit 0
43fi
44
45echo "Unsupported Linux distribution in script/linux"