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 | 1df2cff | 2024-02-09 19:40:03 -0500 | [diff] [blame] | 4 | APT_PKGS=( |
| 5 | build-essential |
| 6 | libboost-chrono-dev |
| 7 | libboost-date-time-dev |
| 8 | libboost-dev |
| 9 | libboost-filesystem-dev |
| 10 | libboost-log-dev |
| 11 | libboost-program-options-dev |
| 12 | libboost-stacktrace-dev |
| 13 | libboost-test-dev |
| 14 | libboost-thread-dev |
| 15 | libpcap-dev |
| 16 | libsqlite3-dev |
| 17 | libssl-dev |
| 18 | pkg-config |
| 19 | python3-minimal |
| 20 | ) |
Davide Pesavento | bd3642f | 2022-08-12 18:19:31 -0400 | [diff] [blame] | 21 | FORMULAE=(boost openssl pkg-config) |
| 22 | PIP_PKGS=() |
| 23 | case $JOB_NAME in |
| 24 | *code-coverage) |
| 25 | APT_PKGS+=(lcov python3-pip) |
| 26 | PIP_PKGS+=('gcovr~=5.2') |
| 27 | ;; |
| 28 | *Docs) |
| 29 | APT_PKGS+=(python3-pip) |
| 30 | PIP_PKGS+=(sphinx) |
| 31 | ;; |
| 32 | esac |
Junxiao Shi | 439d972 | 2015-03-20 15:08:44 -0700 | [diff] [blame] | 33 | |
Davide Pesavento | bd3642f | 2022-08-12 18:19:31 -0400 | [diff] [blame] | 34 | set -x |
| 35 | |
| 36 | if [[ $ID == macos ]]; then |
Davide Pesavento | 2c8ec07 | 2021-09-30 00:04:23 -0400 | [diff] [blame] | 37 | if [[ -n $GITHUB_ACTIONS ]]; then |
Davide Pesavento | 3b4ee2f | 2022-12-31 01:55:06 -0500 | [diff] [blame] | 38 | export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 |
Davide Pesavento | bd3642f | 2022-08-12 18:19:31 -0400 | [diff] [blame] | 39 | fi |
| 40 | brew update |
| 41 | brew install --formula "${FORMULAE[@]}" |
Davide Pesavento | bd3642f | 2022-08-12 18:19:31 -0400 | [diff] [blame] | 42 | elif [[ $ID_LIKE == *debian* ]]; then |
Davide Pesavento | 1df2cff | 2024-02-09 19:40:03 -0500 | [diff] [blame] | 43 | sudo apt-get update -qq |
| 44 | sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}" |
Davide Pesavento | bd3642f | 2022-08-12 18:19:31 -0400 | [diff] [blame] | 45 | elif [[ $ID_LIKE == *fedora* ]]; then |
Davide Pesavento | 1df2cff | 2024-02-09 19:40:03 -0500 | [diff] [blame] | 46 | sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \ |
Davide Pesavento | d839882 | 2020-03-29 18:46:19 -0400 | [diff] [blame] | 47 | boost-devel openssl-devel sqlite-devel \ |
| 48 | libpcap-devel |
Md Ashiqur Rahman | 25c37f1 | 2018-10-12 17:59:20 +0000 | [diff] [blame] | 49 | fi |
Davide Pesavento | 6f16856 | 2022-11-13 15:57:02 -0500 | [diff] [blame] | 50 | |
| 51 | if (( ${#PIP_PKGS[@]} )); then |
| 52 | pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}" |
| 53 | fi |