X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=.ci%2Fdeps.sh;h=e297fb13f2fc4afa89872d4d907f0a8747d0b034;hb=1287fc13ccdf96cd18a391d53ce9b47c29b198e2;hp=2f0dab2d816968868606edaf08e7ce9aa96c6a40;hpb=e1d5459339d7417cda45a7fa0d3c47db555ae6a9;p=tinc diff --git a/.ci/deps.sh b/.ci/deps.sh index 2f0dab2d..e297fb13 100755 --- a/.ci/deps.sh +++ b/.ci/deps.sh @@ -2,29 +2,38 @@ set -eu +SKIP_OPENSSL3="${SKIP_OPENSSL3:-}" +SKIP_MESON="${SKIP_MESON:-}" + deps_linux_alpine() { apk upgrade apk add \ - git binutils make autoconf automake gcc linux-headers diffutils \ - procps socat shadow sudo libgcrypt-dev texinfo texlive gzip \ - openssl-dev zlib-dev lzo-dev ncurses-dev readline-dev musl-dev lz4-dev vde2-dev -} + git binutils ninja pkgconf gcc linux-headers shadow sudo libgcrypt-dev texinfo gzip \ + openssl-dev zlib-dev lzo-dev ncurses-dev readline-dev musl-dev lz4-dev vde2-dev cmocka-dev -deps_linux_debian() { - export DEBIAN_FRONTEND=noninteractive + if [ -z "$SKIP_MESON" ]; then + apk add meson + fi +} - HOST=${HOST:-} +deps_linux_debian_mingw() { + apt-get install -y \ + mingw-w64 mingw-w64-tools \ + wine wine-binfmt \ + libgcrypt-mingw-w64-dev \ + "$@" +} +deps_linux_debian_linux() { if [ -n "$HOST" ]; then dpkg --add-architecture "$HOST" fi apt-get update - apt-get upgrade -y apt-get install -y \ - git binutils make autoconf automake gcc diffutils sudo texinfo texlive netcat-openbsd procps socat \ + binutils make gcc \ zlib1g-dev:"$HOST" \ libssl-dev:"$HOST" \ liblzo2-dev:"$HOST" \ @@ -34,28 +43,67 @@ deps_linux_debian() { libgcrypt-dev:"$HOST" \ libminiupnpc-dev:"$HOST" \ libvdeplug-dev:"$HOST" \ + libcmocka-dev:"$HOST" \ "$@" if [ -n "$HOST" ]; then apt-get install -y crossbuild-essential-"$HOST" qemu-user + else + linux_openssl3 + fi +} + +deps_linux_debian() { + export DEBIAN_FRONTEND=noninteractive + + apt-get update + apt-get upgrade -y + apt-get install -y git pkgconf sudo texinfo ninja-build + + HOST=${HOST:-} + if [ "$HOST" = mingw ]; then + deps_linux_debian_mingw "$@" + else + deps_linux_debian_linux "$@" + fi + + if [ -n "$SKIP_MESON" ]; then + return + fi + + . /etc/os-release + + # Debian Buster ships an old version of meson (0.49). + # MinGW cross-compilation requires something newer than 0.55 that ships in Bullseye, + # or it fails when looking for dependencies in the OpenSSL wrap. + if [ "${ID:-}/${VERSION_CODENAME:-}" = debian/buster ] || [ "$HOST" = mingw ]; then + apt-get install -y python3 python3-pip ninja-build + pip3 install meson + else + apt-get install -y meson fi } deps_linux_rhel() { + yum upgrade -y + if [ "$ID" != fedora ]; then yum install -y epel-release if type dnf; then dnf install -y 'dnf-command(config-manager)' - dnf config-manager --enable powertools + dnf config-manager --enable powertools || true + dnf config-manager --enable crb || true fi fi - yum upgrade -y - yum install -y \ - git binutils make autoconf automake gcc diffutils sudo texinfo-tex netcat procps systemd perl-IPC-Cmd \ - findutils socat lzo-devel zlib-devel lz4-devel ncurses-devel readline-devel libgcrypt-devel "$@" + git binutils make ninja-build pkgconf gcc sudo texinfo-tex systemd perl-IPC-Cmd \ + lzo-devel zlib-devel lz4-devel ncurses-devel readline-devel libgcrypt-devel "$@" + + if [ -z "$SKIP_MESON" ]; then + yum install -y meson + fi if yum info openssl11-devel; then yum install -y openssl11-devel @@ -69,8 +117,8 @@ deps_linux_rhel() { } linux_openssl3() { - if [ -n "${HOST:-}" ]; then - echo >&2 "Not installing OpenSSL 3 to a cross-compilation job" + if [ -n "$SKIP_OPENSSL3" ]; then + echo >&2 "skipping openssl3 installation in this job" return fi @@ -86,7 +134,12 @@ linux_openssl3() { make -j"$(nproc)" make install_sw - ldconfig -v $ssl3/lib64 + if [ -f /etc/ld.so.conf ]; then + echo $ssl3/lib64 >>/etc/ld.so.conf + ldconfig -v + else + ldconfig -v $ssl3/lib64 + fi cd - } @@ -101,12 +154,18 @@ deps_linux() { debian | ubuntu) deps_linux_debian "$@" - linux_openssl3 ;; - centos | almalinux | fedora) + fedora) deps_linux_rhel "$@" - linux_openssl3 + ;; + + centos | almalinux) + deps_linux_rhel "$@" + + if [ "${PLATFORM_ID:-}" != platform:el9 ]; then + linux_openssl3 + fi ;; *) exit 1 ;; @@ -114,8 +173,11 @@ deps_linux() { } deps_macos() { - brew install coreutils netcat automake lzo lz4 miniupnpc libgcrypt openssl "$@" - pip3 install --user compiledb + brew install lzo lz4 miniupnpc libgcrypt openssl "$@" + + if [ -z "$SKIP_MESON" ]; then + brew install meson + fi } case "$(uname -s)" in