Alexander Afanasyev | b81cff9 | 2015-07-09 09:45:09 +0800 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | 72517b5 | 2022-08-13 18:50:55 -0400 | [diff] [blame] | 2 | set -eo pipefail |
Alexander Afanasyev | b81cff9 | 2015-07-09 09:45:09 +0800 | [diff] [blame] | 3 | |
Davide Pesavento | a1b1519 | 2024-02-09 19:27:34 -0500 | [diff] [blame] | 4 | APT_PKGS=( |
Davide Pesavento | e76d7b5 | 2024-04-09 16:54:01 -0400 | [diff] [blame] | 5 | dpkg-dev |
| 6 | g++ |
Davide Pesavento | a1b1519 | 2024-02-09 19:27:34 -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 | libsystemd-dev |
| 20 | pkg-config |
Davide Pesavento | e76d7b5 | 2024-04-09 16:54:01 -0400 | [diff] [blame] | 21 | python3 |
Davide Pesavento | a1b1519 | 2024-02-09 19:27:34 -0500 | [diff] [blame] | 22 | ) |
Davide Pesavento | 72517b5 | 2022-08-13 18:50:55 -0400 | [diff] [blame] | 23 | FORMULAE=(boost openssl pkg-config) |
| 24 | PIP_PKGS=() |
| 25 | case $JOB_NAME in |
| 26 | *code-coverage) |
| 27 | APT_PKGS+=(lcov python3-pip) |
| 28 | PIP_PKGS+=('gcovr~=5.2') |
| 29 | ;; |
| 30 | *Docs) |
| 31 | APT_PKGS+=(doxygen graphviz python3-pip) |
Davide Pesavento | 8f0028d | 2021-07-27 20:01:06 -0400 | [diff] [blame] | 32 | FORMULAE+=(doxygen graphviz) |
Davide Pesavento | 72517b5 | 2022-08-13 18:50:55 -0400 | [diff] [blame] | 33 | PIP_PKGS+=(sphinx sphinxcontrib-doxylink) |
| 34 | ;; |
| 35 | esac |
Alexander Afanasyev | b81cff9 | 2015-07-09 09:45:09 +0800 | [diff] [blame] | 36 | |
Davide Pesavento | 72517b5 | 2022-08-13 18:50:55 -0400 | [diff] [blame] | 37 | set -x |
| 38 | |
| 39 | if [[ $ID == macos ]]; then |
Davide Pesavento | a1480a7 | 2024-07-28 00:24:25 -0400 | [diff] [blame^] | 40 | export HOMEBREW_NO_ENV_HINTS=1 |
Davide Pesavento | f28a061 | 2021-09-29 23:13:32 -0400 | [diff] [blame] | 41 | if [[ -n $GITHUB_ACTIONS ]]; then |
Davide Pesavento | 3bc8e19 | 2022-12-31 01:40:11 -0500 | [diff] [blame] | 42 | export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 |
Davide Pesavento | 72517b5 | 2022-08-13 18:50:55 -0400 | [diff] [blame] | 43 | fi |
| 44 | brew update |
| 45 | brew install --formula "${FORMULAE[@]}" |
Davide Pesavento | 72517b5 | 2022-08-13 18:50:55 -0400 | [diff] [blame] | 46 | elif [[ $ID_LIKE == *debian* ]]; then |
Davide Pesavento | a1b1519 | 2024-02-09 19:27:34 -0500 | [diff] [blame] | 47 | sudo apt-get update -qq |
| 48 | sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}" |
Davide Pesavento | 72517b5 | 2022-08-13 18:50:55 -0400 | [diff] [blame] | 49 | elif [[ $ID_LIKE == *fedora* ]]; then |
Davide Pesavento | a1b1519 | 2024-02-09 19:27:34 -0500 | [diff] [blame] | 50 | sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \ |
Davide Pesavento | 8f290fc | 2020-04-12 13:20:07 -0400 | [diff] [blame] | 51 | boost-devel openssl-devel sqlite-devel \ |
| 52 | libpcap-devel systemd-devel |
Md Ashiqur Rahman | 922330b | 2018-09-04 17:55:18 +0000 | [diff] [blame] | 53 | fi |
Davide Pesavento | a42efcb | 2022-11-15 02:43:16 -0500 | [diff] [blame] | 54 | |
| 55 | if (( ${#PIP_PKGS[@]} )); then |
| 56 | pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}" |
| 57 | fi |