blob: d55a1871574d6680a9f1a7306dc92facbc986759 [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
Davide Pesavento43cf7c42024-02-10 18:28:36 -050010 libboost-iostreams-dev
Davide Pesavento4fb84302024-02-10 15:45:06 -050011 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
Davide Pesaventocf9feb42024-04-22 23:08:25 -040019 python3
Davide Pesavento4fb84302024-02-10 15:45:06 -050020)
Davide Pesaventoc1f13622024-12-13 13:35:01 -050021FORMULAE=(boost openssl pkgconf)
Davide Pesavento1d484532022-08-19 22:08:31 -040022PIP_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+=(python3-pip)
30 PIP_PKGS+=(sphinx)
31 ;;
32esac
Davide Pesavento4a160042020-04-13 16:50:02 -040033
Davide Pesavento1d484532022-08-19 22:08:31 -040034set -x
35
36if [[ $ID == macos ]]; then
Davide Pesavento34acd1d2024-07-21 13:45:02 -040037 export HOMEBREW_NO_ENV_HINTS=1
Davide Pesavento333e3eb2021-10-12 19:30:51 -040038 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesaventoe9b09b82023-01-19 13:30:07 -050039 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesavento1d484532022-08-19 22:08:31 -040040 fi
41 brew update
42 brew install --formula "${FORMULAE[@]}"
Davide Pesavento1d484532022-08-19 22:08:31 -040043elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesavento4fb84302024-02-10 15:45:06 -050044 sudo apt-get update -qq
45 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesavento1d484532022-08-19 22:08:31 -040046elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento4fb84302024-02-10 15:45:06 -050047 sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesavento1d484532022-08-19 22:08:31 -040048 boost-devel openssl-devel sqlite-devel
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040049fi
Davide Pesaventoc2414752022-11-16 16:56:45 -050050
51if (( ${#PIP_PKGS[@]} )); then
52 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
53fi