From 21ada2c73b21f13533c5686bafe45a7d2e16f8ab Mon Sep 17 00:00:00 2001 From: Levon Date: Wed, 3 Apr 2024 08:03:56 -0500 Subject: [PATCH] support pacman --- scripts/install_deps.sh | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/scripts/install_deps.sh b/scripts/install_deps.sh index d58fefa..70b8065 100755 --- a/scripts/install_deps.sh +++ b/scripts/install_deps.sh @@ -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"