blob: d21e972075d74baf7c57de6f8e044faad9e22808 [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 Pesavento543f2b62024-02-10 16:22:24 -05004APT_PKGS=(
5 build-essential
6 libboost-chrono-dev
7 libboost-date-time-dev
8 libboost-dev
9 libboost-filesystem-dev
10 libboost-iostreams-dev
11 libboost-log-dev
12 libboost-program-options-dev
13 libboost-stacktrace-dev
14 libboost-test-dev
15 libboost-thread-dev
16 libsqlite3-dev
17 libssl-dev
18 pkg-config
19 python3-minimal
20)
Davide Pesaventoede59632022-08-26 20:35:44 -040021FORMULAE=(boost openssl pkg-config)
22PIP_PKGS=()
23case $JOB_NAME in
24 *code-coverage)
25 APT_PKGS+=(lcov python3-pip)
26 PIP_PKGS+=('gcovr~=5.2')
27 ;;
28 *Docs)
29 APT_PKGS+=(doxygen graphviz python3-pip)
Davide Pesaventoba8a4ed2021-10-13 21:28:43 -040030 FORMULAE+=(doxygen graphviz)
Davide Pesaventoede59632022-08-26 20:35:44 -040031 PIP_PKGS+=(sphinx sphinxcontrib-doxylink)
32 ;;
33esac
Davide Pesavento0bd37312017-08-20 20:21:13 -040034
Davide Pesaventoede59632022-08-26 20:35:44 -040035set -x
36
37if [[ $ID == macos ]]; then
Davide Pesaventoba8a4ed2021-10-13 21:28:43 -040038 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesavento1b640fd2023-01-04 21:00:05 -050039 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesaventoede59632022-08-26 20:35:44 -040040 fi
41 brew update
42 brew install --formula "${FORMULAE[@]}"
Davide Pesaventoede59632022-08-26 20:35:44 -040043elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesavento543f2b62024-02-10 16:22:24 -050044 sudo apt-get update -qq
45 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesaventoede59632022-08-26 20:35:44 -040046elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento543f2b62024-02-10 16:22:24 -050047 sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesaventoede59632022-08-26 20:35:44 -040048 boost-devel openssl-devel sqlite-devel
Davide Pesavento0bd37312017-08-20 20:21:13 -040049fi
Davide Pesavento65ee9922022-11-16 00:21:43 -050050
51if (( ${#PIP_PKGS[@]} )); then
52 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
53fi