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=( |
Davide Pesavento | cf9feb4 | 2024-04-22 23:08:25 -0400 | [diff] [blame] | 5 | dpkg-dev |
| 6 | g++ |
Davide Pesavento | 4fb8430 | 2024-02-10 15:45:06 -0500 | [diff] [blame] | 7 | libboost-chrono-dev |
| 8 | libboost-date-time-dev |
| 9 | libboost-dev |
| 10 | libboost-filesystem-dev |
Davide Pesavento | 43cf7c4 | 2024-02-10 18:28:36 -0500 | [diff] [blame] | 11 | libboost-iostreams-dev |
Davide Pesavento | 4fb8430 | 2024-02-10 15:45:06 -0500 | [diff] [blame] | 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 Pesavento | cf9feb4 | 2024-04-22 23:08:25 -0400 | [diff] [blame] | 20 | python3 |
Davide Pesavento | 4fb8430 | 2024-02-10 15:45:06 -0500 | [diff] [blame] | 21 | ) |
Davide Pesavento | c1f1362 | 2024-12-13 13:35:01 -0500 | [diff] [blame^] | 22 | FORMULAE=(boost openssl pkgconf) |
Davide Pesavento | 1d48453 | 2022-08-19 22:08:31 -0400 | [diff] [blame] | 23 | PIP_PKGS=() |
| 24 | case $JOB_NAME in |
| 25 | *code-coverage) |
| 26 | APT_PKGS+=(lcov python3-pip) |
| 27 | PIP_PKGS+=('gcovr~=5.2') |
| 28 | ;; |
| 29 | *Docs) |
| 30 | APT_PKGS+=(python3-pip) |
| 31 | PIP_PKGS+=(sphinx) |
| 32 | ;; |
| 33 | esac |
Davide Pesavento | 4a16004 | 2020-04-13 16:50:02 -0400 | [diff] [blame] | 34 | |
Davide Pesavento | 1d48453 | 2022-08-19 22:08:31 -0400 | [diff] [blame] | 35 | set -x |
| 36 | |
| 37 | if [[ $ID == macos ]]; then |
Davide Pesavento | 34acd1d | 2024-07-21 13:45:02 -0400 | [diff] [blame] | 38 | export HOMEBREW_NO_ENV_HINTS=1 |
Davide Pesavento | 333e3eb | 2021-10-12 19:30:51 -0400 | [diff] [blame] | 39 | if [[ -n $GITHUB_ACTIONS ]]; then |
Davide Pesavento | e9b09b8 | 2023-01-19 13:30:07 -0500 | [diff] [blame] | 40 | export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 |
Davide Pesavento | 1d48453 | 2022-08-19 22:08:31 -0400 | [diff] [blame] | 41 | fi |
| 42 | brew update |
| 43 | brew install --formula "${FORMULAE[@]}" |
Davide Pesavento | 1d48453 | 2022-08-19 22:08:31 -0400 | [diff] [blame] | 44 | elif [[ $ID_LIKE == *debian* ]]; then |
Davide Pesavento | 4fb8430 | 2024-02-10 15:45:06 -0500 | [diff] [blame] | 45 | sudo apt-get update -qq |
| 46 | sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}" |
Davide Pesavento | 1d48453 | 2022-08-19 22:08:31 -0400 | [diff] [blame] | 47 | elif [[ $ID_LIKE == *fedora* ]]; then |
Davide Pesavento | 4fb8430 | 2024-02-10 15:45:06 -0500 | [diff] [blame] | 48 | sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \ |
Davide Pesavento | 1d48453 | 2022-08-19 22:08:31 -0400 | [diff] [blame] | 49 | boost-devel openssl-devel sqlite-devel |
Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 50 | fi |
Davide Pesavento | c241475 | 2022-11-16 16:56:45 -0500 | [diff] [blame] | 51 | |
| 52 | if (( ${#PIP_PKGS[@]} )); then |
| 53 | pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}" |
| 54 | fi |