Alexander Afanasyev | c7c9900 | 2015-10-09 17:27:30 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | 423553e | 2022-08-19 20:46:06 -0400 | [diff] [blame] | 2 | set -eo pipefail |
Alexander Afanasyev | c7c9900 | 2015-10-09 17:27:30 -0700 | [diff] [blame] | 3 | |
Davide Pesavento | 423553e | 2022-08-19 20:46:06 -0400 | [diff] [blame] | 4 | APT_PKGS=(build-essential pkg-config python3-minimal |
| 5 | libboost-all-dev libssl-dev libsqlite3-dev) |
| 6 | FORMULAE=(boost openssl pkg-config) |
| 7 | PIP_PKGS=() |
| 8 | case $JOB_NAME in |
| 9 | *code-coverage) |
| 10 | APT_PKGS+=(lcov python3-pip) |
| 11 | PIP_PKGS+=('gcovr~=5.2') |
| 12 | ;; |
| 13 | *Docs) |
| 14 | APT_PKGS+=(doxygen graphviz python3-pip) |
Davide Pesavento | 90a632b | 2021-10-04 01:05:24 -0400 | [diff] [blame] | 15 | FORMULAE+=(doxygen graphviz) |
Davide Pesavento | 423553e | 2022-08-19 20:46:06 -0400 | [diff] [blame] | 16 | PIP_PKGS+=(sphinx sphinxcontrib-doxylink) |
| 17 | ;; |
| 18 | esac |
Alexander Afanasyev | c7c9900 | 2015-10-09 17:27:30 -0700 | [diff] [blame] | 19 | |
Davide Pesavento | 423553e | 2022-08-19 20:46:06 -0400 | [diff] [blame] | 20 | set -x |
| 21 | |
| 22 | if [[ $ID == macos ]]; then |
Davide Pesavento | 90a632b | 2021-10-04 01:05:24 -0400 | [diff] [blame] | 23 | if [[ -n $GITHUB_ACTIONS ]]; then |
Davide Pesavento | 423553e | 2022-08-19 20:46:06 -0400 | [diff] [blame] | 24 | export HOMEBREW_NO_INSTALL_UPGRADE=1 |
| 25 | fi |
| 26 | brew update |
| 27 | brew install --formula "${FORMULAE[@]}" |
| 28 | |
| 29 | if (( ${#PIP_PKGS[@]} )); then |
| 30 | pip3 install --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}" |
Davide Pesavento | fee7ee3 | 2020-04-15 02:45:07 -0400 | [diff] [blame] | 31 | fi |
| 32 | |
Davide Pesavento | 423553e | 2022-08-19 20:46:06 -0400 | [diff] [blame] | 33 | elif [[ $ID_LIKE == *debian* ]]; then |
Alexander Afanasyev | 984ca9d | 2016-12-19 13:09:14 -0800 | [diff] [blame] | 34 | sudo apt-get -qq update |
Davide Pesavento | 423553e | 2022-08-19 20:46:06 -0400 | [diff] [blame] | 35 | sudo apt-get -qy install "${APT_PKGS[@]}" |
Davide Pesavento | 4a315b3 | 2018-11-24 14:32:19 -0500 | [diff] [blame] | 36 | |
Davide Pesavento | 423553e | 2022-08-19 20:46:06 -0400 | [diff] [blame] | 37 | if (( ${#PIP_PKGS[@]} )); then |
| 38 | pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}" |
| 39 | fi |
| 40 | |
| 41 | elif [[ $ID_LIKE == *fedora* ]]; then |
| 42 | sudo dnf -y install gcc-c++ libasan pkgconf-pkg-config python3 \ |
| 43 | boost-devel openssl-devel sqlite-devel |
Alexander Afanasyev | c7c9900 | 2015-10-09 17:27:30 -0700 | [diff] [blame] | 44 | fi |