Junxiao Shi | 439d972 | 2015-03-20 15:08:44 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | bd3642f | 2022-08-12 18:19:31 -0400 | [diff] [blame] | 2 | set -eo pipefail |
Davide Pesavento | 956ac31 | 2016-09-20 19:11:30 +0200 | [diff] [blame] | 3 | |
Davide Pesavento | 1df2cff | 2024-02-09 19:40:03 -0500 | [diff] [blame] | 4 | APT_PKGS=( |
Davide Pesavento | 164414b | 2024-04-22 23:14:03 -0400 | [diff] [blame] | 5 | dpkg-dev |
| 6 | g++ |
Davide Pesavento | 1df2cff | 2024-02-09 19:40:03 -0500 | [diff] [blame] | 7 | libboost-chrono-dev |
| 8 | libboost-date-time-dev |
| 9 | libboost-dev |
Davide Pesavento | 1df2cff | 2024-02-09 19:40:03 -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 | libpcap-dev |
| 16 | libsqlite3-dev |
| 17 | libssl-dev |
Davide Pesavento | 4b465b5 | 2025-03-18 02:20:32 -0400 | [diff] [blame] | 18 | pkgconf |
Davide Pesavento | 164414b | 2024-04-22 23:14:03 -0400 | [diff] [blame] | 19 | python3 |
Davide Pesavento | 1df2cff | 2024-02-09 19:40:03 -0500 | [diff] [blame] | 20 | ) |
Davide Pesavento | 4b465b5 | 2025-03-18 02:20:32 -0400 | [diff] [blame] | 21 | DNF_PKGS=( |
| 22 | boost-devel |
| 23 | gcc-c++ |
| 24 | libasan |
| 25 | libpcap-devel |
| 26 | lld |
| 27 | openssl-devel |
| 28 | pkgconf |
| 29 | python3 |
| 30 | sqlite-devel |
| 31 | ) |
Davide Pesavento | 3253152 | 2024-12-10 15:42:44 -0500 | [diff] [blame] | 32 | FORMULAE=(boost openssl pkgconf) |
Davide Pesavento | bd3642f | 2022-08-12 18:19:31 -0400 | [diff] [blame] | 33 | case $JOB_NAME in |
| 34 | *code-coverage) |
Davide Pesavento | 0771dc5 | 2025-03-25 01:15:30 -0400 | [diff] [blame^] | 35 | APT_PKGS+=(lcov) |
Davide Pesavento | bd3642f | 2022-08-12 18:19:31 -0400 | [diff] [blame] | 36 | ;; |
| 37 | *Docs) |
Davide Pesavento | bd3642f | 2022-08-12 18:19:31 -0400 | [diff] [blame] | 38 | ;; |
| 39 | esac |
Junxiao Shi | 439d972 | 2015-03-20 15:08:44 -0700 | [diff] [blame] | 40 | |
Davide Pesavento | 0771dc5 | 2025-03-25 01:15:30 -0400 | [diff] [blame^] | 41 | install_uv() { |
| 42 | if [[ -z $GITHUB_ACTIONS && $ID_LIKE == *debian* ]]; then |
| 43 | sudo apt-get install -qy --no-install-recommends pipx |
| 44 | pipx upgrade uv || pipx install uv |
| 45 | fi |
| 46 | } |
| 47 | |
Davide Pesavento | bd3642f | 2022-08-12 18:19:31 -0400 | [diff] [blame] | 48 | set -x |
| 49 | |
| 50 | if [[ $ID == macos ]]; then |
Davide Pesavento | 0771dc5 | 2025-03-25 01:15:30 -0400 | [diff] [blame^] | 51 | export HOMEBREW_COLOR=1 |
Davide Pesavento | 435d201 | 2024-07-28 01:24:25 -0400 | [diff] [blame] | 52 | export HOMEBREW_NO_ENV_HINTS=1 |
Davide Pesavento | 2c8ec07 | 2021-09-30 00:04:23 -0400 | [diff] [blame] | 53 | if [[ -n $GITHUB_ACTIONS ]]; then |
Davide Pesavento | 3b4ee2f | 2022-12-31 01:55:06 -0500 | [diff] [blame] | 54 | export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 |
Davide Pesavento | bd3642f | 2022-08-12 18:19:31 -0400 | [diff] [blame] | 55 | fi |
| 56 | brew update |
| 57 | brew install --formula "${FORMULAE[@]}" |
Davide Pesavento | bd3642f | 2022-08-12 18:19:31 -0400 | [diff] [blame] | 58 | elif [[ $ID_LIKE == *debian* ]]; then |
Davide Pesavento | 1df2cff | 2024-02-09 19:40:03 -0500 | [diff] [blame] | 59 | sudo apt-get update -qq |
| 60 | sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}" |
Davide Pesavento | bd3642f | 2022-08-12 18:19:31 -0400 | [diff] [blame] | 61 | elif [[ $ID_LIKE == *fedora* ]]; then |
Davide Pesavento | 4b465b5 | 2025-03-18 02:20:32 -0400 | [diff] [blame] | 62 | sudo dnf install -y "${DNF_PKGS[@]}" |
Md Ashiqur Rahman | 25c37f1 | 2018-10-12 17:59:20 +0000 | [diff] [blame] | 63 | fi |
Davide Pesavento | 6f16856 | 2022-11-13 15:57:02 -0500 | [diff] [blame] | 64 | |
Davide Pesavento | 0771dc5 | 2025-03-25 01:15:30 -0400 | [diff] [blame^] | 65 | case $JOB_NAME in |
| 66 | *code-coverage) |
| 67 | install_uv |
| 68 | ;; |
| 69 | *Docs) |
| 70 | install_uv |
| 71 | export FORCE_COLOR=1 |
| 72 | export UV_NO_MANAGED_PYTHON=1 |
| 73 | uv tool install sphinx --upgrade --with-requirements manpages/requirements.txt |
| 74 | ;; |
| 75 | esac |