add macOS support to install.sh (#361)

This commit is contained in:
alex 2021-08-14 10:35:23 +01:00 committed by GitHub
parent 3c887e6ac3
commit 5ba7b53d06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,6 +6,28 @@ else
SUDO=sudo
fi
uname=`uname`
if [[ "$uname" == "Darwin" ]]; then
echo "Installing packages for macOS"
if ! command -v brew >/dev/null 2>&1; then
# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" || exit 1
fi
# Install packages
brew install md5sha1sum ninja gcc nanaian/brew/mips-linux-gnu-binutils || exit 1
python3 -m pip install -U -r requirements.txt || exit 1
if [[ $1 == "--extra" ]]; then
echo "Installing extra"
python3 -m pip install -U -r requirements_extra.txt || exit 1
fi
echo "Done"
exit
fi
# Debian and derivatives (apt)
if cat /etc/os-release | grep -E 'ID=debian|ID_LIKE=debian' &> /dev/null; then
echo "Installing packages for Debian or derivative (apt)"