Davide Pesavento | 29db0fd | 2017-08-29 13:32:00 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | f5006be | 2022-08-19 17:36:36 -0400 | [diff] [blame] | 2 | set -eo pipefail |
Davide Pesavento | 29db0fd | 2017-08-29 13:32:00 -0400 | [diff] [blame] | 3 | |
Davide Pesavento | 7227d64 | 2024-02-10 01:58:15 -0500 | [diff] [blame] | 4 | APT_PKGS=( |
Davide Pesavento | 9bec15a | 2024-04-22 23:00:03 -0400 | [diff] [blame] | 5 | dpkg-dev |
| 6 | g++ |
Davide Pesavento | 7227d64 | 2024-02-10 01:58:15 -0500 | [diff] [blame] | 7 | libboost-chrono-dev |
| 8 | libboost-date-time-dev |
| 9 | libboost-dev |
Davide Pesavento | 7227d64 | 2024-02-10 01:58:15 -0500 | [diff] [blame] | 10 | libboost-log-dev |
| 11 | libboost-program-options-dev |
| 12 | libboost-stacktrace-dev |
| 13 | libboost-test-dev |
| 14 | libboost-thread-dev |
| 15 | libsqlite3-dev |
| 16 | libssl-dev |
| 17 | pkg-config |
Davide Pesavento | 9bec15a | 2024-04-22 23:00:03 -0400 | [diff] [blame] | 18 | python3 |
Davide Pesavento | 7227d64 | 2024-02-10 01:58:15 -0500 | [diff] [blame] | 19 | ) |
Davide Pesavento | c12f915 | 2024-12-11 18:42:03 -0500 | [diff] [blame] | 20 | FORMULAE=(boost openssl pkgconf) |
Davide Pesavento | f5006be | 2022-08-19 17:36:36 -0400 | [diff] [blame] | 21 | PIP_PKGS=() |
| 22 | case $JOB_NAME in |
| 23 | *code-coverage) |
| 24 | APT_PKGS+=(lcov python3-pip) |
| 25 | PIP_PKGS+=('gcovr~=5.2') |
| 26 | ;; |
| 27 | *Docs) |
| 28 | APT_PKGS+=(python3-pip) |
| 29 | PIP_PKGS+=(sphinx) |
| 30 | ;; |
| 31 | esac |
Davide Pesavento | 29db0fd | 2017-08-29 13:32:00 -0400 | [diff] [blame] | 32 | |
Davide Pesavento | f5006be | 2022-08-19 17:36:36 -0400 | [diff] [blame] | 33 | set -x |
| 34 | |
| 35 | if [[ $ID == macos ]]; then |
Davide Pesavento | c12f915 | 2024-12-11 18:42:03 -0500 | [diff] [blame] | 36 | export HOMEBREW_NO_ENV_HINTS=1 |
Davide Pesavento | ab6ac5d | 2021-10-05 23:23:53 -0400 | [diff] [blame] | 37 | if [[ -n $GITHUB_ACTIONS ]]; then |
Davide Pesavento | 665f89c | 2023-02-14 16:45:07 -0500 | [diff] [blame] | 38 | export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 |
Davide Pesavento | f5006be | 2022-08-19 17:36:36 -0400 | [diff] [blame] | 39 | fi |
| 40 | brew update |
| 41 | brew install --formula "${FORMULAE[@]}" |
Davide Pesavento | f5006be | 2022-08-19 17:36:36 -0400 | [diff] [blame] | 42 | elif [[ $ID_LIKE == *debian* ]]; then |
Davide Pesavento | 7227d64 | 2024-02-10 01:58:15 -0500 | [diff] [blame] | 43 | sudo apt-get update -qq |
| 44 | sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}" |
Davide Pesavento | f5006be | 2022-08-19 17:36:36 -0400 | [diff] [blame] | 45 | elif [[ $ID_LIKE == *fedora* ]]; then |
Davide Pesavento | 7227d64 | 2024-02-10 01:58:15 -0500 | [diff] [blame] | 46 | sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \ |
Davide Pesavento | f5006be | 2022-08-19 17:36:36 -0400 | [diff] [blame] | 47 | boost-devel openssl-devel sqlite-devel |
Davide Pesavento | 29db0fd | 2017-08-29 13:32:00 -0400 | [diff] [blame] | 48 | fi |
Davide Pesavento | f855ec1 | 2022-11-16 16:08:35 -0500 | [diff] [blame] | 49 | |
| 50 | if (( ${#PIP_PKGS[@]} )); then |
| 51 | pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}" |
| 52 | fi |