Alexander Afanasyev | c7c9900 | 2015-10-09 17:27:30 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | fee7ee3 | 2020-04-15 02:45:07 -0400 | [diff] [blame] | 2 | set -ex |
Alexander Afanasyev | c7c9900 | 2015-10-09 17:27:30 -0700 | [diff] [blame] | 3 | |
Alexander Afanasyev | 984ca9d | 2016-12-19 13:09:14 -0800 | [diff] [blame] | 4 | if has OSX $NODE_LABELS; then |
Davide Pesavento | 4a315b3 | 2018-11-24 14:32:19 -0500 | [diff] [blame] | 5 | FORMULAE=(boost openssl pkg-config) |
Davide Pesavento | fee7ee3 | 2020-04-15 02:45:07 -0400 | [diff] [blame] | 6 | if has OSX-10.13 $NODE_LABELS || has OSX-10.14 $NODE_LABELS; then |
| 7 | FORMULAE+=(python) |
Davide Pesavento | 4a315b3 | 2018-11-24 14:32:19 -0500 | [diff] [blame] | 8 | fi |
Alexander Afanasyev | c7c9900 | 2015-10-09 17:27:30 -0700 | [diff] [blame] | 9 | |
Davide Pesavento | fee7ee3 | 2020-04-15 02:45:07 -0400 | [diff] [blame] | 10 | if [[ -n $TRAVIS ]]; then |
| 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 |
| 14 | for FORMULA in "${FORMULAE[@]}"; do |
| 15 | brew list --versions "$FORMULA" || brew install "$FORMULA" |
| 16 | done |
| 17 | # Ensure /usr/local/opt/openssl exists |
| 18 | brew reinstall openssl |
| 19 | else |
| 20 | brew update |
| 21 | brew upgrade |
| 22 | brew install "${FORMULAE[@]}" |
| 23 | brew cleanup |
| 24 | fi |
| 25 | |
| 26 | elif has Ubuntu $NODE_LABELS; then |
Alexander Afanasyev | 984ca9d | 2016-12-19 13:09:14 -0800 | [diff] [blame] | 27 | sudo apt-get -qq update |
Davide Pesavento | bdd88c1 | 2020-11-26 00:35:08 -0500 | [diff] [blame^] | 28 | sudo apt-get -qy install build-essential pkg-config python3-minimal \ |
Davide Pesavento | fee7ee3 | 2020-04-15 02:45:07 -0400 | [diff] [blame] | 29 | libboost-all-dev libssl-dev libsqlite3-dev |
Davide Pesavento | 4a315b3 | 2018-11-24 14:32:19 -0500 | [diff] [blame] | 30 | |
| 31 | if [[ $JOB_NAME == *"code-coverage" ]]; then |
Davide Pesavento | 4473c7b | 2020-08-07 17:21:13 -0400 | [diff] [blame] | 32 | sudo apt-get -qy install gcovr lcov |
Davide Pesavento | 4a315b3 | 2018-11-24 14:32:19 -0500 | [diff] [blame] | 33 | fi |
Alexander Afanasyev | c7c9900 | 2015-10-09 17:27:30 -0700 | [diff] [blame] | 34 | fi |