Junxiao Shi | 439d972 | 2015-03-20 15:08:44 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | d839882 | 2020-03-29 18:46:19 -0400 | [diff] [blame^] | 2 | set -ex |
Davide Pesavento | 956ac31 | 2016-09-20 19:11:30 +0200 | [diff] [blame] | 3 | |
Junxiao Shi | 439d972 | 2015-03-20 15:08:44 -0700 | [diff] [blame] | 4 | if has OSX $NODE_LABELS; then |
Davide Pesavento | 07238e8 | 2017-08-26 13:21:57 -0400 | [diff] [blame] | 5 | FORMULAE=(boost openssl pkg-config) |
Davide Pesavento | a1a9d70 | 2020-03-29 00:58:15 -0400 | [diff] [blame] | 6 | if has OSX-10.13 $NODE_LABELS || has OSX-10.14 $NODE_LABELS; then |
| 7 | FORMULAE+=(python) |
Davide Pesavento | 1eecc17 | 2017-06-24 14:30:42 -0400 | [diff] [blame] | 8 | fi |
Junxiao Shi | 439d972 | 2015-03-20 15:08:44 -0700 | [diff] [blame] | 9 | |
Davide Pesavento | a1a9d70 | 2020-03-29 00:58:15 -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 |
Davide Pesavento | 0e8edde | 2016-05-03 18:08:39 +0200 | [diff] [blame] | 27 | sudo apt-get -qq update |
Davide Pesavento | a1a9d70 | 2020-03-29 00:58:15 -0400 | [diff] [blame] | 28 | sudo apt-get -qy install g++ pkg-config python3-minimal \ |
| 29 | libboost-all-dev libssl-dev libsqlite3-dev \ |
| 30 | libpcap-dev |
Davide Pesavento | 931dfe8 | 2017-04-29 20:33:45 -0400 | [diff] [blame] | 31 | |
| 32 | if [[ $JOB_NAME == *"code-coverage" ]]; then |
ashiqopu | 1f0cad7 | 2018-11-25 01:22:54 +0000 | [diff] [blame] | 33 | sudo apt-get -qy install gcovr lcov libgd-perl |
Davide Pesavento | 931dfe8 | 2017-04-29 20:33:45 -0400 | [diff] [blame] | 34 | fi |
Md Ashiqur Rahman | 25c37f1 | 2018-10-12 17:59:20 +0000 | [diff] [blame] | 35 | |
Davide Pesavento | d839882 | 2020-03-29 18:46:19 -0400 | [diff] [blame^] | 36 | elif has CentOS-8 $NODE_LABELS; then |
| 37 | sudo dnf config-manager --enable PowerTools |
| 38 | sudo dnf -y install gcc-c++ libasan pkgconf-pkg-config python3 \ |
| 39 | boost-devel openssl-devel sqlite-devel \ |
| 40 | libpcap-devel |
Md Ashiqur Rahman | 25c37f1 | 2018-10-12 17:59:20 +0000 | [diff] [blame] | 41 | fi |