Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | 1d48453 | 2022-08-19 22:08:31 -0400 | [diff] [blame] | 2 | set -eo pipefail |
Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 3 | |
Davide Pesavento | 4fb8430 | 2024-02-10 15:45:06 -0500 | [diff] [blame] | 4 | APT_PKGS=( |
| 5 | build-essential |
| 6 | libboost-chrono-dev |
| 7 | libboost-date-time-dev |
| 8 | libboost-dev |
| 9 | libboost-filesystem-dev |
Davide Pesavento | 43cf7c4 | 2024-02-10 18:28:36 -0500 | [diff] [blame] | 10 | libboost-iostreams-dev |
Davide Pesavento | 4fb8430 | 2024-02-10 15:45:06 -0500 | [diff] [blame] | 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 |
| 19 | python3-minimal |
| 20 | ) |
Davide Pesavento | 1d48453 | 2022-08-19 22:08:31 -0400 | [diff] [blame] | 21 | FORMULAE=(boost openssl pkg-config) |
| 22 | PIP_PKGS=() |
| 23 | case $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 | ;; |
| 32 | esac |
Davide Pesavento | 4a16004 | 2020-04-13 16:50:02 -0400 | [diff] [blame] | 33 | |
Davide Pesavento | 1d48453 | 2022-08-19 22:08:31 -0400 | [diff] [blame] | 34 | set -x |
| 35 | |
| 36 | if [[ $ID == macos ]]; then |
Davide Pesavento | 333e3eb | 2021-10-12 19:30:51 -0400 | [diff] [blame] | 37 | if [[ -n $GITHUB_ACTIONS ]]; then |
Davide Pesavento | e9b09b8 | 2023-01-19 13:30:07 -0500 | [diff] [blame] | 38 | export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 |
Davide Pesavento | 1d48453 | 2022-08-19 22:08:31 -0400 | [diff] [blame] | 39 | fi |
| 40 | brew update |
| 41 | brew install --formula "${FORMULAE[@]}" |
Davide Pesavento | 1d48453 | 2022-08-19 22:08:31 -0400 | [diff] [blame] | 42 | elif [[ $ID_LIKE == *debian* ]]; then |
Davide Pesavento | 4fb8430 | 2024-02-10 15:45:06 -0500 | [diff] [blame] | 43 | sudo apt-get update -qq |
| 44 | sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}" |
Davide Pesavento | 1d48453 | 2022-08-19 22:08:31 -0400 | [diff] [blame] | 45 | elif [[ $ID_LIKE == *fedora* ]]; then |
Davide Pesavento | 4fb8430 | 2024-02-10 15:45:06 -0500 | [diff] [blame] | 46 | sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \ |
Davide Pesavento | 1d48453 | 2022-08-19 22:08:31 -0400 | [diff] [blame] | 47 | boost-devel openssl-devel sqlite-devel |
Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 48 | fi |
Davide Pesavento | c241475 | 2022-11-16 16:56:45 -0500 | [diff] [blame] | 49 | |
| 50 | if (( ${#PIP_PKGS[@]} )); then |
| 51 | pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}" |
| 52 | fi |