blob: 32278a11858835e9238a0cfe523c14c14eef5315 [file] [log] [blame]
Yingdi Yu1cc45d92015-02-09 14:19:54 -08001#!/usr/bin/env bash
Varun Patila24bd3e2020-11-24 10:08:33 +05302set -ex
Yingdi Yu1cc45d92015-02-09 14:19:54 -08003
4if has OSX $NODE_LABELS; then
Varun Patila24bd3e2020-11-24 10:08:33 +05305 FORMULAE=(boost openssl pkg-config qt)
6 if has OSX-10.13 $NODE_LABELS || has OSX-10.14 $NODE_LABELS; then
7 FORMULAE+=(python)
8 fi
Yingdi Yu1cc45d92015-02-09 14:19:54 -08009
Varun Patila24bd3e2020-11-24 10:08:33 +053010 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesavento7676b562020-12-14 00:41:26 -050011 # Don't waste time upgrading all pre-installed packages
Varun Patila24bd3e2020-11-24 10:08:33 +053012 for FORMULA in "${FORMULAE[@]}"; do
13 brew list --versions "$FORMULA" || brew install "$FORMULA"
14 done
15
Davide Pesavento7676b562020-12-14 00:41:26 -050016 # Ensure /usr/local/opt/openssl exists
17 brew reinstall openssl
18
19 # Homebrew qt is keg-only, force symlinking it into /usr/local
20 brew link --force qt
Varun Patila24bd3e2020-11-24 10:08:33 +053021 else
22 brew update
23 brew upgrade
24 brew install "${FORMULAE[@]}"
25 brew cleanup
26 fi
27
28elif has Ubuntu $NODE_LABELS; then
29 sudo apt-get -qq update
Davide Pesavento7676b562020-12-14 00:41:26 -050030 sudo apt-get -qy install build-essential pkg-config python3-minimal \
Varun Patila24bd3e2020-11-24 10:08:33 +053031 libboost-all-dev libssl-dev libsqlite3-dev \
Davide Pesavento7676b562020-12-14 00:41:26 -050032 qt5-default
33fi