Zhiyi Zhang | 8617a79 | 2017-01-17 16:45:56 -0800 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | 6d1b672 | 2022-08-20 17:54:05 -0400 | [diff] [blame] | 2 | set -eo pipefail |
Zhiyi Zhang | 8617a79 | 2017-01-17 16:45:56 -0800 | [diff] [blame] | 3 | |
Davide Pesavento | 526d4c8 | 2024-02-09 18:56:05 -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 |
| 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 |
| 18 | python3-minimal |
| 19 | ) |
Davide Pesavento | 6d1b672 | 2022-08-20 17:54:05 -0400 | [diff] [blame] | 20 | FORMULAE=(boost openssl pkg-config) |
| 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+=(doxygen graphviz) |
Davide Pesavento | 725d3fc | 2021-11-19 23:37:03 -0500 | [diff] [blame] | 29 | FORMULAE+=(doxygen graphviz) |
Davide Pesavento | 6d1b672 | 2022-08-20 17:54:05 -0400 | [diff] [blame] | 30 | ;; |
| 31 | esac |
Zhiyi Zhang | 8617a79 | 2017-01-17 16:45:56 -0800 | [diff] [blame] | 32 | |
Davide Pesavento | 6d1b672 | 2022-08-20 17:54:05 -0400 | [diff] [blame] | 33 | set -x |
| 34 | |
| 35 | if [[ $ID == macos ]]; then |
Davide Pesavento | 725d3fc | 2021-11-19 23:37:03 -0500 | [diff] [blame] | 36 | if [[ -n $GITHUB_ACTIONS ]]; then |
Davide Pesavento | d78e77e | 2022-12-31 17:01:32 -0500 | [diff] [blame] | 37 | export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 |
Davide Pesavento | 6d1b672 | 2022-08-20 17:54:05 -0400 | [diff] [blame] | 38 | fi |
| 39 | brew update |
| 40 | brew install --formula "${FORMULAE[@]}" |
Davide Pesavento | 6d1b672 | 2022-08-20 17:54:05 -0400 | [diff] [blame] | 41 | elif [[ $ID_LIKE == *debian* ]]; then |
Davide Pesavento | 526d4c8 | 2024-02-09 18:56:05 -0500 | [diff] [blame] | 42 | sudo apt-get update -qq |
| 43 | sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}" |
Davide Pesavento | 6d1b672 | 2022-08-20 17:54:05 -0400 | [diff] [blame] | 44 | elif [[ $ID_LIKE == *fedora* ]]; then |
Davide Pesavento | 526d4c8 | 2024-02-09 18:56:05 -0500 | [diff] [blame] | 45 | sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \ |
Davide Pesavento | 573a621 | 2022-07-09 21:56:41 -0400 | [diff] [blame] | 46 | boost-devel openssl-devel sqlite-devel |
Zhiyi Zhang | 8617a79 | 2017-01-17 16:45:56 -0800 | [diff] [blame] | 47 | fi |
Davide Pesavento | f8fe685 | 2022-11-15 13:55:07 -0500 | [diff] [blame] | 48 | |
| 49 | if (( ${#PIP_PKGS[@]} )); then |
| 50 | pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}" |
| 51 | fi |