Yingdi Yu | 1cc45d9 | 2015-02-09 14:19:54 -0800 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Varun Patil | a24bd3e | 2020-11-24 10:08:33 +0530 | [diff] [blame] | 2 | set -ex |
Yingdi Yu | 1cc45d9 | 2015-02-09 14:19:54 -0800 | [diff] [blame] | 3 | |
| 4 | if has OSX $NODE_LABELS; then |
Varun Patil | a24bd3e | 2020-11-24 10:08:33 +0530 | [diff] [blame] | 5 | 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 Yu | 1cc45d9 | 2015-02-09 14:19:54 -0800 | [diff] [blame] | 9 | |
Varun Patil | a24bd3e | 2020-11-24 10:08:33 +0530 | [diff] [blame] | 10 | if [[ -n $GITHUB_ACTIONS ]]; then |
Davide Pesavento | 7676b56 | 2020-12-14 00:41:26 -0500 | [diff] [blame] | 11 | # Don't waste time upgrading all pre-installed packages |
Varun Patil | a24bd3e | 2020-11-24 10:08:33 +0530 | [diff] [blame] | 12 | for FORMULA in "${FORMULAE[@]}"; do |
| 13 | brew list --versions "$FORMULA" || brew install "$FORMULA" |
| 14 | done |
| 15 | |
Davide Pesavento | 7676b56 | 2020-12-14 00:41:26 -0500 | [diff] [blame] | 16 | # 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 Patil | a24bd3e | 2020-11-24 10:08:33 +0530 | [diff] [blame] | 21 | else |
| 22 | brew update |
| 23 | brew upgrade |
| 24 | brew install "${FORMULAE[@]}" |
| 25 | brew cleanup |
| 26 | fi |
| 27 | |
| 28 | elif has Ubuntu $NODE_LABELS; then |
| 29 | sudo apt-get -qq update |
Davide Pesavento | 7676b56 | 2020-12-14 00:41:26 -0500 | [diff] [blame] | 30 | sudo apt-get -qy install build-essential pkg-config python3-minimal \ |
Varun Patil | a24bd3e | 2020-11-24 10:08:33 +0530 | [diff] [blame] | 31 | libboost-all-dev libssl-dev libsqlite3-dev \ |
Davide Pesavento | 7676b56 | 2020-12-14 00:41:26 -0500 | [diff] [blame] | 32 | qt5-default |
| 33 | fi |