blob: 2bdc0406160a8ac8b2e63fa76a806b35a7df795a [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=(
Davide Pesavento34a0b3f2024-04-21 19:01:26 -04005 dpkg-dev
6 g++
Davide Pesaventoc6cfed62024-02-09 21:18:06 -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 Pesavento34a0b3f2024-04-21 19:01:26 -040020 python3
Davide Pesaventoc6cfed62024-02-09 21:18:06 -050021)
Davide Pesavento15a74422022-08-19 15:48:45 -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 Pesavento22eeb292021-10-01 21:20:53 -040031 FORMULAE+=(doxygen graphviz)
Davide Pesavento15a74422022-08-19 15:48:45 -040032 PIP_PKGS+=(sphinx sphinxcontrib-doxylink)
33 ;;
34esac
Alexander Afanasyevf3192eb2016-12-19 17:11:20 -080035
Davide Pesavento15a74422022-08-19 15:48:45 -040036set -x
37
38if [[ $ID == macos ]]; then
Davide Pesavento22eeb292021-10-01 21:20:53 -040039 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesavento3fb27eb2022-12-31 14:00:51 -050040 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesavento15a74422022-08-19 15:48:45 -040041 fi
42 brew update
43 brew install --formula "${FORMULAE[@]}"
Davide Pesavento15a74422022-08-19 15:48:45 -040044elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesaventoc6cfed62024-02-09 21:18:06 -050045 sudo apt-get update -qq
46 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesavento15a74422022-08-19 15:48:45 -040047elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesaventoc6cfed62024-02-09 21:18:06 -050048 sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesavento9c4bd6d2022-07-26 15:28:08 -040049 boost-devel openssl-devel sqlite-devel
Alexander Afanasyevf3192eb2016-12-19 17:11:20 -080050fi
Davide Pesaventocda44892022-11-15 13:40:33 -050051
52if (( ${#PIP_PKGS[@]} )); then
53 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
54fi