blob: 3f3235ad1ba09d5f36b776b2aaa823a2df095609 [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
Davide Pesavento8d6192a2024-02-09 21:23:50 -050010 libboost-iostreams-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 Pesavento6a562f02024-04-22 01:11:31 -040019 python3
Davide Pesavento8d6192a2024-02-09 21:23:50 -050020)
Davide Pesaventof4571e82024-12-14 15:15:34 -050021FORMULAE=(boost openssl pkgconf)
Davide Pesaventoda1a4d32022-08-19 19:03:24 -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 Pesavento8dce1942021-10-02 22:31:26 -040030 FORMULAE+=(doxygen graphviz)
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040031 PIP_PKGS+=(sphinx sphinxcontrib-doxylink)
32 ;;
33esac
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050034
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040035set -x
36
37if [[ $ID == macos ]]; then
awlane880e7152024-07-26 18:48:05 -050038 export HOMEBREW_NO_ENV_HINTS=1
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