blob: 1e36384c3f05542deecfcc80250ab60de79d86de [file] [log] [blame]
Alexander Afanasyevb81cff92015-07-09 09:45:09 +08001#!/usr/bin/env bash
Davide Pesavento72517b52022-08-13 18:50:55 -04002set -eo pipefail
Alexander Afanasyevb81cff92015-07-09 09:45:09 +08003
Davide Pesavento72517b52022-08-13 18:50:55 -04004APT_PKGS=(build-essential pkg-config python3-minimal
5 libboost-all-dev libssl-dev libsqlite3-dev
6 libpcap-dev libsystemd-dev)
7FORMULAE=(boost openssl pkg-config)
8PIP_PKGS=()
9case $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 Pesavento8f0028d2021-07-27 20:01:06 -040016 FORMULAE+=(doxygen graphviz)
Davide Pesavento72517b52022-08-13 18:50:55 -040017 PIP_PKGS+=(sphinx sphinxcontrib-doxylink)
18 ;;
19esac
Alexander Afanasyevb81cff92015-07-09 09:45:09 +080020
Davide Pesavento72517b52022-08-13 18:50:55 -040021set -x
22
23if [[ $ID == macos ]]; then
Davide Pesaventof28a0612021-09-29 23:13:32 -040024 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesavento72517b52022-08-13 18:50:55 -040025 export HOMEBREW_NO_INSTALL_UPGRADE=1
26 fi
27 brew update
28 brew install --formula "${FORMULAE[@]}"
29
30 if (( ${#PIP_PKGS[@]} )); then
31 pip3 install --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
Davide Pesavento69857c32020-04-05 16:36:26 -040032 fi
33
Davide Pesavento72517b52022-08-13 18:50:55 -040034elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesaventocc7bee72016-04-22 02:21:13 +020035 sudo apt-get -qq update
Davide Pesavento72517b52022-08-13 18:50:55 -040036 sudo apt-get -qy install "${APT_PKGS[@]}"
Davide Pesavento8d61c032017-04-29 20:06:33 -040037
Davide Pesavento72517b52022-08-13 18:50:55 -040038 if (( ${#PIP_PKGS[@]} )); then
39 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
40 fi
Md Ashiqur Rahman922330b2018-09-04 17:55:18 +000041
Davide Pesavento72517b52022-08-13 18:50:55 -040042elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento6d6f2072022-09-12 23:08:34 -040043 sudo dnf -y install gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesavento8f290fc2020-04-12 13:20:07 -040044 boost-devel openssl-devel sqlite-devel \
45 libpcap-devel systemd-devel
Md Ashiqur Rahman922330b2018-09-04 17:55:18 +000046fi