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