blob: 2bdc0406160a8ac8b2e63fa76a806b35a7df795a [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=(
Davide Pesavento50213142024-04-22 03:44:05 -04005 dpkg-dev
6 g++
Davide Pesavento543f2b62024-02-10 16:22:24 -05007 libboost-chrono-dev
8 libboost-date-time-dev
9 libboost-dev
10 libboost-filesystem-dev
11 libboost-iostreams-dev
12 libboost-log-dev
13 libboost-program-options-dev
14 libboost-stacktrace-dev
15 libboost-test-dev
16 libboost-thread-dev
17 libsqlite3-dev
18 libssl-dev
19 pkg-config
Davide Pesavento50213142024-04-22 03:44:05 -040020 python3
Davide Pesavento543f2b62024-02-10 16:22:24 -050021)
Davide Pesaventoede59632022-08-26 20:35:44 -040022FORMULAE=(boost openssl pkg-config)
23PIP_PKGS=()
24case $JOB_NAME in
25 *code-coverage)
26 APT_PKGS+=(lcov python3-pip)
27 PIP_PKGS+=('gcovr~=5.2')
28 ;;
29 *Docs)
30 APT_PKGS+=(doxygen graphviz python3-pip)
Davide Pesaventoba8a4ed2021-10-13 21:28:43 -040031 FORMULAE+=(doxygen graphviz)
Davide Pesaventoede59632022-08-26 20:35:44 -040032 PIP_PKGS+=(sphinx sphinxcontrib-doxylink)
33 ;;
34esac
Davide Pesavento0bd37312017-08-20 20:21:13 -040035
Davide Pesaventoede59632022-08-26 20:35:44 -040036set -x
37
38if [[ $ID == macos ]]; then
Davide Pesaventoba8a4ed2021-10-13 21:28:43 -040039 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesavento1b640fd2023-01-04 21:00:05 -050040 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesaventoede59632022-08-26 20:35:44 -040041 fi
42 brew update
43 brew install --formula "${FORMULAE[@]}"
Davide Pesaventoede59632022-08-26 20:35:44 -040044elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesavento543f2b62024-02-10 16:22:24 -050045 sudo apt-get update -qq
46 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesaventoede59632022-08-26 20:35:44 -040047elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento543f2b62024-02-10 16:22:24 -050048 sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesaventoede59632022-08-26 20:35:44 -040049 boost-devel openssl-devel sqlite-devel
Davide Pesavento0bd37312017-08-20 20:21:13 -040050fi
Davide Pesavento65ee9922022-11-16 00:21:43 -050051
52if (( ${#PIP_PKGS[@]} )); then
53 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
54fi