blob: d16fe418b1b41b6ad38adeef675c7e7cfd90b64c [file] [log] [blame]
Alexander Afanasyevf34a3552017-08-13 21:17:05 -04001#!/usr/bin/env bash
Davide Pesavento1d484532022-08-19 22:08:31 -04002set -eo pipefail
Alexander Afanasyevf34a3552017-08-13 21:17:05 -04003
Davide Pesavento4fb84302024-02-10 15:45:06 -05004APT_PKGS=(
Davide Pesaventocf9feb42024-04-22 23:08:25 -04005 dpkg-dev
6 g++
Davide Pesavento4fb84302024-02-10 15:45:06 -05007 libboost-chrono-dev
8 libboost-date-time-dev
9 libboost-dev
10 libboost-filesystem-dev
Davide Pesavento43cf7c42024-02-10 18:28:36 -050011 libboost-iostreams-dev
Davide Pesavento4fb84302024-02-10 15:45:06 -050012 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 Pesaventocf9feb42024-04-22 23:08:25 -040020 python3
Davide Pesavento4fb84302024-02-10 15:45:06 -050021)
Davide Pesaventoc1f13622024-12-13 13:35:01 -050022FORMULAE=(boost openssl pkgconf)
Davide Pesavento1d484532022-08-19 22:08:31 -040023PIP_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+=(python3-pip)
31 PIP_PKGS+=(sphinx)
32 ;;
33esac
Davide Pesavento4a160042020-04-13 16:50:02 -040034
Davide Pesavento1d484532022-08-19 22:08:31 -040035set -x
36
37if [[ $ID == macos ]]; then
Davide Pesavento34acd1d2024-07-21 13:45:02 -040038 export HOMEBREW_NO_ENV_HINTS=1
Davide Pesavento333e3eb2021-10-12 19:30:51 -040039 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesaventoe9b09b82023-01-19 13:30:07 -050040 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesavento1d484532022-08-19 22:08:31 -040041 fi
42 brew update
43 brew install --formula "${FORMULAE[@]}"
Davide Pesavento1d484532022-08-19 22:08:31 -040044elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesavento4fb84302024-02-10 15:45:06 -050045 sudo apt-get update -qq
46 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesavento1d484532022-08-19 22:08:31 -040047elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento4fb84302024-02-10 15:45:06 -050048 sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesavento1d484532022-08-19 22:08:31 -040049 boost-devel openssl-devel sqlite-devel
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040050fi
Davide Pesaventoc2414752022-11-16 16:56:45 -050051
52if (( ${#PIP_PKGS[@]} )); then
53 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
54fi