Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -0400 | [diff] [blame] | 2 | set -eo pipefail |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 3 | |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -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) |
Davide Pesavento | 87208f9 | 2022-08-30 19:51:23 -0400 | [diff] [blame^] | 11 | PIP_PKGS+=('gcovr~=5.2') |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -0400 | [diff] [blame] | 12 | ;; |
| 13 | *Docs) |
| 14 | APT_PKGS+=(doxygen graphviz python3-pip) |
Davide Pesavento | 30ed628 | 2021-07-25 20:05:06 -0400 | [diff] [blame] | 15 | FORMULAE+=(doxygen graphviz) |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -0400 | [diff] [blame] | 16 | PIP_PKGS+=(sphinx sphinxcontrib-doxylink) |
| 17 | ;; |
| 18 | esac |
Davide Pesavento | d776a93 | 2020-03-20 18:42:36 -0400 | [diff] [blame] | 19 | |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -0400 | [diff] [blame] | 20 | set -x |
| 21 | |
| 22 | if [[ $ID == macos ]]; then |
Davide Pesavento | 83f8d16 | 2021-09-26 21:58:36 -0400 | [diff] [blame] | 23 | if [[ -n $GITHUB_ACTIONS ]]; then |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -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 | d776a93 | 2020-03-20 18:42:36 -0400 | [diff] [blame] | 31 | fi |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 32 | |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -0400 | [diff] [blame] | 33 | elif [[ $ID_LIKE == *debian* ]]; then |
Davide Pesavento | e11c8d8 | 2016-04-16 14:32:07 +0200 | [diff] [blame] | 34 | sudo apt-get -qq update |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -0400 | [diff] [blame] | 35 | sudo apt-get -qy install "${APT_PKGS[@]}" |
Davide Pesavento | c44cc83 | 2017-04-03 22:11:48 -0400 | [diff] [blame] | 36 | |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -0400 | [diff] [blame] | 37 | if (( ${#PIP_PKGS[@]} )); then |
| 38 | pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}" |
| 39 | fi |
Md Ashiqur Rahman | 8bd3b8a | 2018-09-01 23:43:51 +0000 | [diff] [blame] | 40 | |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -0400 | [diff] [blame] | 41 | elif [[ $ID_LIKE == *fedora* ]]; then |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 42 | sudo dnf -y install gcc-c++ libasan pkgconf-pkg-config python3 \ |
| 43 | boost-devel openssl-devel sqlite-devel |
Md Ashiqur Rahman | 8bd3b8a | 2018-09-01 23:43:51 +0000 | [diff] [blame] | 44 | fi |