support pacman

This commit is contained in:
2024-04-03 08:03:56 -05:00
parent f7bb66efc3
commit 21ada2c73b

View File

@@ -1,15 +1,31 @@
#!/bin/bash
PKG_MNG="apt-get"
sudo "$PKG_MNG" update
sudo "$PKG_MNG" upgrade -qy
sudo "$PKG_MNG" install autoconf automake build-essential cmake git-core g++-12 \
DEPENDENCY_LIST="autoconf automake build-essential cmake git-core g++-12 \
libass-dev libfreetype6-dev libsdl2-dev libtool libva-dev libvdpau-dev gcc-12 \
libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev pkg-config bc \
texinfo wget zlib1g-dev nasm yasm libssl-dev time python3 meson ninja-build gobjc++ \
doxygen xxd jq lshw gnuplot python3-pip curl clang valgrind ccache gawk mawk -y || exit 1
doxygen xxd jq lshw gnuplot python3-pip curl clang valgrind ccache gawk mawk"
USING_NALA=$(which nala > /dev/null; echo $?)
USING_APT=$(which apt > /dev/null; echo $?)
USING_PACMAN=$(which pacman > /dev/null; echo $?)
if [[ "$USING_NALA" == "0" ]]; then
# if nala fails, try apt
USING_APT="1"
echo "Installing with nala"
sudo nala update
sudo nala install -y $DEPENDENCY_LIST || USING_APT="0"
fi
if [[ "$USING_APT" == "0" ]]; then
echo "Installing with apt"
sudo apt-get update
sudo apt-get install -y $DEPENDENCY_LIST || exit 1
fi
if [[ "$USING_PACMAN" == "0" ]]; then
echo "Installing with pacman"
sudo pacman -S $DEPENDENCY_LIST --no-confirm || exit 1
fi
curl https://sh.rustup.rs -sSf | sh -s -- -y
source "$HOME/.cargo/env"