blob: 7e03e98ab415e8a0b299230a709b639fcd4280d8 [file] [log] [blame]
Alexander Afanasyevc7c99002015-10-09 17:27:30 -07001#!/usr/bin/env bash
Davide Pesavento423553e2022-08-19 20:46:06 -04002set -eo pipefail
Alexander Afanasyevc7c99002015-10-09 17:27:30 -07003
Davide Pesavento16479f32024-02-10 17:10:35 -05004APT_PKGS=(
5 build-essential
6 libboost-chrono-dev
7 libboost-date-time-dev
8 libboost-dev
9 libboost-filesystem-dev
10 libboost-log-dev
11 libboost-program-options-dev
12 libboost-stacktrace-dev
13 libboost-test-dev
14 libboost-thread-dev
15 libsqlite3-dev
16 libssl-dev
17 pkg-config
18 python3-minimal
19)
Davide Pesavento423553e2022-08-19 20:46:06 -040020FORMULAE=(boost openssl pkg-config)
21PIP_PKGS=()
22case $JOB_NAME in
23 *code-coverage)
24 APT_PKGS+=(lcov python3-pip)
25 PIP_PKGS+=('gcovr~=5.2')
26 ;;
27 *Docs)
28 APT_PKGS+=(doxygen graphviz python3-pip)
Davide Pesavento90a632b2021-10-04 01:05:24 -040029 FORMULAE+=(doxygen graphviz)
Davide Pesavento423553e2022-08-19 20:46:06 -040030 PIP_PKGS+=(sphinx sphinxcontrib-doxylink)
31 ;;
32esac
Alexander Afanasyevc7c99002015-10-09 17:27:30 -070033
Davide Pesavento423553e2022-08-19 20:46:06 -040034set -x
35
36if [[ $ID == macos ]]; then
Davide Pesavento90a632b2021-10-04 01:05:24 -040037 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesaventodadbc3e2023-02-14 02:32:36 -050038 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesavento423553e2022-08-19 20:46:06 -040039 fi
40 brew update
41 brew install --formula "${FORMULAE[@]}"
Davide Pesavento423553e2022-08-19 20:46:06 -040042elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesavento16479f32024-02-10 17:10:35 -050043 sudo apt-get update -qq
44 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesavento423553e2022-08-19 20:46:06 -040045elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento16479f32024-02-10 17:10:35 -050046 sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesavento423553e2022-08-19 20:46:06 -040047 boost-devel openssl-devel sqlite-devel
Alexander Afanasyevc7c99002015-10-09 17:27:30 -070048fi
Davide Pesaventob2034db2022-11-16 17:21:22 -050049
50if (( ${#PIP_PKGS[@]} )); then
51 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
52fi