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