blob: 17b544adee2aa477982c8fccf6fc4a5d539f1cf3 [file] [log] [blame]
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -04001#!/usr/bin/env bash
Davide Pesavento27dd70c2022-08-19 16:24:28 -04002set -eo pipefail
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -04003
Davide Pesavento508d2cb2024-02-10 14:55:04 -05004APT_PKGS=(
Davide Pesavento44b0f8c2024-04-23 00:16:11 -04005 dpkg-dev
6 g++
Davide Pesavento508d2cb2024-02-10 14:55:04 -05007 libboost-chrono-dev
8 libboost-date-time-dev
9 libboost-dev
10 libboost-filesystem-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
Davide Pesavento44b0f8c2024-04-23 00:16:11 -040019 python3
Davide Pesavento508d2cb2024-02-10 14:55:04 -050020)
Davide Pesavento52dc9a62024-12-11 18:14:14 -050021FORMULAE=(boost openssl pkgconf)
Davide Pesavento27dd70c2022-08-19 16:24:28 -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+=(doxygen graphviz python3-pip)
Davide Pesavento3c7f6452021-10-02 04:06:26 -040030 FORMULAE+=(doxygen graphviz)
Davide Pesavento27dd70c2022-08-19 16:24:28 -040031 PIP_PKGS+=(sphinx sphinxcontrib-doxylink)
32 ;;
33esac
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040034
Davide Pesavento27dd70c2022-08-19 16:24:28 -040035set -x
36
37if [[ $ID == macos ]]; then
Davide Pesaventofb0d7cd2024-07-21 14:06:02 -040038 export HOMEBREW_NO_ENV_HINTS=1
Davide Pesavento3c7f6452021-10-02 04:06:26 -040039 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesaventod64a9d12023-01-01 16:30:03 -050040 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesavento27dd70c2022-08-19 16:24:28 -040041 fi
42 brew update
43 brew install --formula "${FORMULAE[@]}"
Davide Pesavento27dd70c2022-08-19 16:24:28 -040044elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesavento508d2cb2024-02-10 14:55:04 -050045 sudo apt-get update -qq
46 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesavento27dd70c2022-08-19 16:24:28 -040047elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento508d2cb2024-02-10 14:55:04 -050048 sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesavento7e7bd892022-07-10 00:30:06 -040049 boost-devel openssl-devel sqlite-devel
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040050fi
Davide Pesaventof5248012022-11-15 14:25:34 -050051
52if (( ${#PIP_PKGS[@]} )); then
53 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
54fi