blob: 2bdc0406160a8ac8b2e63fa76a806b35a7df795a [file] [log] [blame]
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -05001#!/usr/bin/env bash
Davide Pesaventoda1a4d32022-08-19 19:03:24 -04002set -eo pipefail
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -05003
Davide Pesavento8d6192a2024-02-09 21:23:50 -05004APT_PKGS=(
Davide Pesavento6a562f02024-04-22 01:11:31 -04005 dpkg-dev
6 g++
Davide Pesavento8d6192a2024-02-09 21:23:50 -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 Pesavento6a562f02024-04-22 01:11:31 -040020 python3
Davide Pesavento8d6192a2024-02-09 21:23:50 -050021)
Davide Pesaventoda1a4d32022-08-19 19:03:24 -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 Pesavento8dce1942021-10-02 22:31:26 -040031 FORMULAE+=(doxygen graphviz)
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040032 PIP_PKGS+=(sphinx sphinxcontrib-doxylink)
33 ;;
34esac
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050035
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040036set -x
37
38if [[ $ID == macos ]]; then
Davide Pesavento8dce1942021-10-02 22:31:26 -040039 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesavento36651f12023-01-02 17:07:21 -050040 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040041 fi
42 brew update
43 brew install --formula "${FORMULAE[@]}"
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040044elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesavento8d6192a2024-02-09 21:23:50 -050045 sudo apt-get update -qq
46 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040047elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento8d6192a2024-02-09 21:23:50 -050048 sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesaventof2784382022-07-09 19:58:53 -040049 boost-devel openssl-devel sqlite-devel
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050050fi
Davide Pesaventob68f2842022-11-17 19:07:04 -050051
52if (( ${#PIP_PKGS[@]} )); then
53 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
54fi