blob: a45615bf7f6c9128843e0486d4afedd31594cb28 [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[@]}"
Davide Pesavento72517b52022-08-13 18:50:55 -040029elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesaventocc7bee72016-04-22 02:21:13 +020030 sudo apt-get -qq update
Davide Pesavento72517b52022-08-13 18:50:55 -040031 sudo apt-get -qy install "${APT_PKGS[@]}"
Davide Pesavento72517b52022-08-13 18:50:55 -040032elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento6d6f2072022-09-12 23:08:34 -040033 sudo dnf -y install gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesavento8f290fc2020-04-12 13:20:07 -040034 boost-devel openssl-devel sqlite-devel \
35 libpcap-devel systemd-devel
Md Ashiqur Rahman922330b2018-09-04 17:55:18 +000036fi
Davide Pesaventoa42efcb2022-11-15 02:43:16 -050037
38if (( ${#PIP_PKGS[@]} )); then
39 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
40fi