Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | 4a16004 | 2020-04-13 16:50:02 -0400 | [diff] [blame^] | 2 | set -ex |
Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 3 | |
| 4 | if has OSX $NODE_LABELS; then |
Davide Pesavento | b545aac | 2017-09-22 23:54:10 -0400 | [diff] [blame] | 5 | FORMULAE=(boost openssl pkg-config) |
Davide Pesavento | 4a16004 | 2020-04-13 16:50:02 -0400 | [diff] [blame^] | 6 | if has OSX-10.13 $NODE_LABELS || has OSX-10.14 $NODE_LABELS; then |
| 7 | FORMULAE+=(python) |
| 8 | fi |
| 9 | |
Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 10 | if [[ -n $TRAVIS ]]; then |
Davide Pesavento | 4a16004 | 2020-04-13 16:50:02 -0400 | [diff] [blame^] | 11 | # 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 Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 14 | for FORMULA in "${FORMULAE[@]}"; do |
Davide Pesavento | 4a16004 | 2020-04-13 16:50:02 -0400 | [diff] [blame^] | 15 | brew list --versions "$FORMULA" || brew install "$FORMULA" |
Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 16 | done |
Davide Pesavento | 4a16004 | 2020-04-13 16:50:02 -0400 | [diff] [blame^] | 17 | # Ensure /usr/local/opt/openssl exists |
| 18 | brew reinstall openssl |
Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 19 | else |
Davide Pesavento | 4a16004 | 2020-04-13 16:50:02 -0400 | [diff] [blame^] | 20 | brew update |
Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 21 | brew upgrade |
Davide Pesavento | 4a16004 | 2020-04-13 16:50:02 -0400 | [diff] [blame^] | 22 | brew install "${FORMULAE[@]}" |
| 23 | brew cleanup |
Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 24 | fi |
Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 25 | |
Davide Pesavento | 4a16004 | 2020-04-13 16:50:02 -0400 | [diff] [blame^] | 26 | elif has Ubuntu $NODE_LABELS; then |
Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 27 | sudo apt-get -qq update |
Davide Pesavento | 4a16004 | 2020-04-13 16:50:02 -0400 | [diff] [blame^] | 28 | sudo apt-get -qy install g++ pkg-config python3-minimal \ |
| 29 | libboost-all-dev libssl-dev libsqlite3-dev |
Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 30 | fi |