blob: bb9d8cc0945a574ecf9cc0f9a7956c85c27975fb [file] [log] [blame]
Junxiao Shi439d9722015-03-20 15:08:44 -07001#!/usr/bin/env bash
Davide Pesaventobd3642f2022-08-12 18:19:31 -04002set -eo pipefail
Davide Pesavento956ac312016-09-20 19:11:30 +02003
Davide Pesavento1df2cff2024-02-09 19:40:03 -05004APT_PKGS=(
Davide Pesavento164414b2024-04-22 23:14:03 -04005 dpkg-dev
6 g++
Davide Pesavento1df2cff2024-02-09 19:40:03 -05007 libboost-chrono-dev
8 libboost-date-time-dev
9 libboost-dev
Davide Pesavento1df2cff2024-02-09 19:40:03 -050010 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 Pesavento4b465b52025-03-18 02:20:32 -040018 pkgconf
Davide Pesavento164414b2024-04-22 23:14:03 -040019 python3
Davide Pesavento1df2cff2024-02-09 19:40:03 -050020)
Davide Pesavento4b465b52025-03-18 02:20:32 -040021DNF_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 Pesavento32531522024-12-10 15:42:44 -050032FORMULAE=(boost openssl pkgconf)
Davide Pesaventobd3642f2022-08-12 18:19:31 -040033case $JOB_NAME in
34 *code-coverage)
Davide Pesavento0771dc52025-03-25 01:15:30 -040035 APT_PKGS+=(lcov)
Davide Pesaventobd3642f2022-08-12 18:19:31 -040036 ;;
37 *Docs)
Davide Pesaventobd3642f2022-08-12 18:19:31 -040038 ;;
39esac
Junxiao Shi439d9722015-03-20 15:08:44 -070040
Davide Pesavento0771dc52025-03-25 01:15:30 -040041install_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 Pesaventobd3642f2022-08-12 18:19:31 -040048set -x
49
50if [[ $ID == macos ]]; then
Davide Pesavento0771dc52025-03-25 01:15:30 -040051 export HOMEBREW_COLOR=1
Davide Pesavento435d2012024-07-28 01:24:25 -040052 export HOMEBREW_NO_ENV_HINTS=1
Davide Pesavento2c8ec072021-09-30 00:04:23 -040053 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesavento3b4ee2f2022-12-31 01:55:06 -050054 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesaventobd3642f2022-08-12 18:19:31 -040055 fi
56 brew update
57 brew install --formula "${FORMULAE[@]}"
Davide Pesaventobd3642f2022-08-12 18:19:31 -040058elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesavento1df2cff2024-02-09 19:40:03 -050059 sudo apt-get update -qq
60 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesaventobd3642f2022-08-12 18:19:31 -040061elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento4b465b52025-03-18 02:20:32 -040062 sudo dnf install -y "${DNF_PKGS[@]}"
Md Ashiqur Rahman25c37f12018-10-12 17:59:20 +000063fi
Davide Pesavento6f168562022-11-13 15:57:02 -050064
Davide Pesavento0771dc52025-03-25 01:15:30 -040065case $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 ;;
75esac