blob: 7e03e98ab415e8a0b299230a709b639fcd4280d8 [file] [log] [blame]
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -04001#!/usr/bin/env bash
Davide Pesavento27dd70c2022-08-19 16:24:28 -04002set -eo pipefail
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -04003
Davide Pesavento508d2cb2024-02-10 14:55:04 -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 Pesavento27dd70c2022-08-19 16:24:28 -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 Pesavento3c7f6452021-10-02 04:06:26 -040029 FORMULAE+=(doxygen graphviz)
Davide Pesavento27dd70c2022-08-19 16:24:28 -040030 PIP_PKGS+=(sphinx sphinxcontrib-doxylink)
31 ;;
32esac
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040033
Davide Pesavento27dd70c2022-08-19 16:24:28 -040034set -x
35
36if [[ $ID == macos ]]; then
Davide Pesavento3c7f6452021-10-02 04:06:26 -040037 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesaventod64a9d12023-01-01 16:30:03 -050038 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesavento27dd70c2022-08-19 16:24:28 -040039 fi
40 brew update
41 brew install --formula "${FORMULAE[@]}"
Davide Pesavento27dd70c2022-08-19 16:24:28 -040042elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesavento508d2cb2024-02-10 14:55:04 -050043 sudo apt-get update -qq
44 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesavento27dd70c2022-08-19 16:24:28 -040045elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento508d2cb2024-02-10 14:55:04 -050046 sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesavento7e7bd892022-07-10 00:30:06 -040047 boost-devel openssl-devel sqlite-devel
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040048fi
Davide Pesaventof5248012022-11-15 14:25:34 -050049
50if (( ${#PIP_PKGS[@]} )); then
51 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
52fi