Junxiao Shi | 439d972 | 2015-03-20 15:08:44 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | bd3642f | 2022-08-12 18:19:31 -0400 | [diff] [blame] | 2 | set -eo pipefail |
Davide Pesavento | 956ac31 | 2016-09-20 19:11:30 +0200 | [diff] [blame] | 3 | |
Davide Pesavento | bd3642f | 2022-08-12 18:19:31 -0400 | [diff] [blame] | 4 | APT_PKGS=(build-essential pkg-config python3-minimal |
| 5 | libboost-all-dev libssl-dev libsqlite3-dev |
| 6 | libpcap-dev) |
| 7 | FORMULAE=(boost openssl pkg-config) |
| 8 | PIP_PKGS=() |
| 9 | case $JOB_NAME in |
| 10 | *code-coverage) |
| 11 | APT_PKGS+=(lcov python3-pip) |
| 12 | PIP_PKGS+=('gcovr~=5.2') |
| 13 | ;; |
| 14 | *Docs) |
| 15 | APT_PKGS+=(python3-pip) |
| 16 | PIP_PKGS+=(sphinx) |
| 17 | ;; |
| 18 | esac |
Junxiao Shi | 439d972 | 2015-03-20 15:08:44 -0700 | [diff] [blame] | 19 | |
Davide Pesavento | bd3642f | 2022-08-12 18:19:31 -0400 | [diff] [blame] | 20 | set -x |
| 21 | |
| 22 | if [[ $ID == macos ]]; then |
Davide Pesavento | 2c8ec07 | 2021-09-30 00:04:23 -0400 | [diff] [blame] | 23 | if [[ -n $GITHUB_ACTIONS ]]; then |
Davide Pesavento | 3b4ee2f | 2022-12-31 01:55:06 -0500 | [diff] [blame^] | 24 | export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 |
Davide Pesavento | bd3642f | 2022-08-12 18:19:31 -0400 | [diff] [blame] | 25 | fi |
| 26 | brew update |
| 27 | brew install --formula "${FORMULAE[@]}" |
Davide Pesavento | bd3642f | 2022-08-12 18:19:31 -0400 | [diff] [blame] | 28 | elif [[ $ID_LIKE == *debian* ]]; then |
Davide Pesavento | 0e8edde | 2016-05-03 18:08:39 +0200 | [diff] [blame] | 29 | sudo apt-get -qq update |
Davide Pesavento | bd3642f | 2022-08-12 18:19:31 -0400 | [diff] [blame] | 30 | sudo apt-get -qy install "${APT_PKGS[@]}" |
Davide Pesavento | bd3642f | 2022-08-12 18:19:31 -0400 | [diff] [blame] | 31 | elif [[ $ID_LIKE == *fedora* ]]; then |
Davide Pesavento | 6f16856 | 2022-11-13 15:57:02 -0500 | [diff] [blame] | 32 | sudo dnf -y install gcc-c++ libasan lld pkgconf-pkg-config python3 \ |
Davide Pesavento | d839882 | 2020-03-29 18:46:19 -0400 | [diff] [blame] | 33 | boost-devel openssl-devel sqlite-devel \ |
| 34 | libpcap-devel |
Md Ashiqur Rahman | 25c37f1 | 2018-10-12 17:59:20 +0000 | [diff] [blame] | 35 | fi |
Davide Pesavento | 6f16856 | 2022-11-13 15:57:02 -0500 | [diff] [blame] | 36 | |
| 37 | if (( ${#PIP_PKGS[@]} )); then |
| 38 | pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}" |
| 39 | fi |