diff --git a/install.sh b/install.sh index ba473a2e01..2fcd5d69d2 100755 --- a/install.sh +++ b/install.sh @@ -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)"