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