blob: d21e972075d74baf7c57de6f8e044faad9e22808 [file] [log] [blame]
Alexander Afanasyevf3192eb2016-12-19 17:11:20 -08001#!/usr/bin/env bash
Davide Pesavento15a74422022-08-19 15:48:45 -04002set -eo pipefail
Alexander Afanasyevf3192eb2016-12-19 17:11:20 -08003
Davide Pesaventoc6cfed62024-02-09 21:18:06 -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 Pesavento15a74422022-08-19 15:48:45 -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 Pesavento22eeb292021-10-01 21:20:53 -040030 FORMULAE+=(doxygen graphviz)
Davide Pesavento15a74422022-08-19 15:48:45 -040031 PIP_PKGS+=(sphinx sphinxcontrib-doxylink)
32 ;;
33esac
Alexander Afanasyevf3192eb2016-12-19 17:11:20 -080034
Davide Pesavento15a74422022-08-19 15:48:45 -040035set -x
36
37if [[ $ID == macos ]]; then
Davide Pesavento22eeb292021-10-01 21:20:53 -040038 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesavento3fb27eb2022-12-31 14:00:51 -050039 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesavento15a74422022-08-19 15:48:45 -040040 fi
41 brew update
42 brew install --formula "${FORMULAE[@]}"
Davide Pesavento15a74422022-08-19 15:48:45 -040043elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesaventoc6cfed62024-02-09 21:18:06 -050044 sudo apt-get update -qq
45 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesavento15a74422022-08-19 15:48:45 -040046elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesaventoc6cfed62024-02-09 21:18:06 -050047 sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesavento9c4bd6d2022-07-26 15:28:08 -040048 boost-devel openssl-devel sqlite-devel
Alexander Afanasyevf3192eb2016-12-19 17:11:20 -080049fi
Davide Pesaventocda44892022-11-15 13:40:33 -050050
51if (( ${#PIP_PKGS[@]} )); then
52 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
53fi