blob: 12b5de33765bc61007d7b9f20bf234a9ea5de9ba [file] [log] [blame]
Davide Pesavento0bd37312017-08-20 20:21:13 -04001#!/usr/bin/env bash
Davide Pesaventoede59632022-08-26 20:35:44 -04002set -eo pipefail
Davide Pesavento0bd37312017-08-20 20:21:13 -04003
Davide Pesaventoede59632022-08-26 20:35:44 -04004APT_PKGS=(build-essential pkg-config python3-minimal
5 libboost-all-dev libssl-dev libsqlite3-dev)
6FORMULAE=(boost openssl pkg-config)
7PIP_PKGS=()
8case $JOB_NAME in
9 *code-coverage)
10 APT_PKGS+=(lcov python3-pip)
11 PIP_PKGS+=('gcovr~=5.2')
12 ;;
13 *Docs)
14 APT_PKGS+=(doxygen graphviz python3-pip)
Davide Pesaventoba8a4ed2021-10-13 21:28:43 -040015 FORMULAE+=(doxygen graphviz)
Davide Pesaventoede59632022-08-26 20:35:44 -040016 PIP_PKGS+=(sphinx sphinxcontrib-doxylink)
17 ;;
18esac
Davide Pesavento0bd37312017-08-20 20:21:13 -040019
Davide Pesaventoede59632022-08-26 20:35:44 -040020set -x
21
22if [[ $ID == macos ]]; then
Davide Pesaventoba8a4ed2021-10-13 21:28:43 -040023 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesaventoede59632022-08-26 20:35:44 -040024 export HOMEBREW_NO_INSTALL_UPGRADE=1
25 fi
26 brew update
27 brew install --formula "${FORMULAE[@]}"
28
29 if (( ${#PIP_PKGS[@]} )); then
30 pip3 install --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
Davide Pesaventof6be8e32020-04-30 16:06:03 -040031 fi
32
Davide Pesaventoede59632022-08-26 20:35:44 -040033elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesavento0bd37312017-08-20 20:21:13 -040034 sudo apt-get -qq update
Davide Pesaventoede59632022-08-26 20:35:44 -040035 sudo apt-get -qy install "${APT_PKGS[@]}"
Davide Pesavento0bd37312017-08-20 20:21:13 -040036
Davide Pesaventoede59632022-08-26 20:35:44 -040037 if (( ${#PIP_PKGS[@]} )); then
38 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
39 fi
40
41elif [[ $ID_LIKE == *fedora* ]]; then
42 sudo dnf -y install gcc-c++ libasan pkgconf-pkg-config python3 \
43 boost-devel openssl-devel sqlite-devel
Davide Pesavento0bd37312017-08-20 20:21:13 -040044fi