blob: b5671bc1e3a8b4b5dceeb78b568b0cb9e4f2b0a6 [file] [log] [blame]
Alexander Afanasyevf34a3552017-08-13 21:17:05 -04001#!/usr/bin/env bash
Davide Pesavento4a160042020-04-13 16:50:02 -04002set -ex
Alexander Afanasyevf34a3552017-08-13 21:17:05 -04003
4if has OSX $NODE_LABELS; then
Davide Pesaventob545aac2017-09-22 23:54:10 -04005 FORMULAE=(boost openssl pkg-config)
Davide Pesavento4a160042020-04-13 16:50:02 -04006 if has OSX-10.13 $NODE_LABELS || has OSX-10.14 $NODE_LABELS; then
7 FORMULAE+=(python)
8 fi
9
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040010 if [[ -n $TRAVIS ]]; then
Davide Pesavento4a160042020-04-13 16:50:02 -040011 # Travis images come with a large number of pre-installed
12 # brew packages, don't waste time upgrading all of them
13 brew list --versions "${FORMULAE[@]}" || brew update
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040014 for FORMULA in "${FORMULAE[@]}"; do
Davide Pesavento4a160042020-04-13 16:50:02 -040015 brew list --versions "$FORMULA" || brew install "$FORMULA"
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040016 done
Davide Pesavento4a160042020-04-13 16:50:02 -040017 # Ensure /usr/local/opt/openssl exists
18 brew reinstall openssl
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040019 else
Davide Pesavento4a160042020-04-13 16:50:02 -040020 brew update
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040021 brew upgrade
Davide Pesavento4a160042020-04-13 16:50:02 -040022 brew install "${FORMULAE[@]}"
23 brew cleanup
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040024 fi
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040025
Davide Pesavento4a160042020-04-13 16:50:02 -040026elif has Ubuntu $NODE_LABELS; then
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040027 sudo apt-get -qq update
Davide Pesavento4a160042020-04-13 16:50:02 -040028 sudo apt-get -qy install g++ pkg-config python3-minimal \
29 libboost-all-dev libssl-dev libsqlite3-dev
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040030fi