blob: 7e03e98ab415e8a0b299230a709b639fcd4280d8 [file] [log] [blame]
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -04001#!/usr/bin/env bash
Davide Pesavento73e946e2022-08-06 16:44:54 -04002set -eo pipefail
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -04003
Davide Pesaventoe3710032024-02-05 19:57:05 -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 Pesavento73e946e2022-08-06 16:44:54 -040020FORMULAE=(boost openssl pkg-config)
21PIP_PKGS=()
22case $JOB_NAME in
23 *code-coverage)
24 APT_PKGS+=(lcov python3-pip)
Davide Pesavento87208f92022-08-30 19:51:23 -040025 PIP_PKGS+=('gcovr~=5.2')
Davide Pesavento73e946e2022-08-06 16:44:54 -040026 ;;
27 *Docs)
28 APT_PKGS+=(doxygen graphviz python3-pip)
Davide Pesavento30ed6282021-07-25 20:05:06 -040029 FORMULAE+=(doxygen graphviz)
Davide Pesavento73e946e2022-08-06 16:44:54 -040030 PIP_PKGS+=(sphinx sphinxcontrib-doxylink)
31 ;;
32esac
Davide Pesaventod776a932020-03-20 18:42:36 -040033
Davide Pesavento73e946e2022-08-06 16:44:54 -040034set -x
35
36if [[ $ID == macos ]]; then
Davide Pesavento83f8d162021-09-26 21:58:36 -040037 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesavento81de5d92022-12-30 01:08:05 -050038 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesavento73e946e2022-08-06 16:44:54 -040039 fi
40 brew update
41 brew install --formula "${FORMULAE[@]}"
Davide Pesavento73e946e2022-08-06 16:44:54 -040042elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesaventoe3710032024-02-05 19:57:05 -050043 sudo apt-get update -qq
44 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesavento73e946e2022-08-06 16:44:54 -040045elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesaventoe3710032024-02-05 19:57:05 -050046 sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesavento2349e282020-03-24 14:28:03 -040047 boost-devel openssl-devel sqlite-devel
Md Ashiqur Rahman8bd3b8a2018-09-01 23:43:51 +000048fi
Davide Pesavento83faec72022-11-14 19:44:41 -050049
50if (( ${#PIP_PKGS[@]} )); then
51 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
52fi