CI: add checks for basic compatibility with muon
[tinc] / .ci / deps.sh
index 523e7aa..e297fb1 100755 (executable)
@@ -2,13 +2,19 @@
 
 set -eu
 
+SKIP_OPENSSL3="${SKIP_OPENSSL3:-}"
+SKIP_MESON="${SKIP_MESON:-}"
+
 deps_linux_alpine() {
   apk upgrade
 
   apk add \
-    git binutils meson pkgconf gcc linux-headers diffutils \
-    procps socat shadow sudo libgcrypt-dev texinfo 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
+
+  if [ -z "$SKIP_MESON" ]; then
+    apk add meson
+  fi
 }
 
 deps_linux_debian_mingw() {
@@ -37,6 +43,7 @@ deps_linux_debian_linux() {
     libgcrypt-dev:"$HOST" \
     libminiupnpc-dev:"$HOST" \
     libvdeplug-dev:"$HOST" \
+    libcmocka-dev:"$HOST" \
     "$@"
 
   if [ -n "$HOST" ]; then
@@ -51,8 +58,7 @@ deps_linux_debian() {
 
   apt-get update
   apt-get upgrade -y
-  apt-get install -y git pkgconf diffutils sudo texinfo \
-    netcat-openbsd procps socat
+  apt-get install -y git pkgconf sudo texinfo ninja-build
 
   HOST=${HOST:-}
   if [ "$HOST" = mingw ]; then
@@ -61,6 +67,10 @@ deps_linux_debian() {
     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).
@@ -75,20 +85,25 @@ deps_linux_debian() {
 }
 
 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 meson pkgconf 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
@@ -102,6 +117,11 @@ deps_linux_rhel() {
 }
 
 linux_openssl3() {
+  if [ -n "$SKIP_OPENSSL3" ]; then
+    echo >&2 "skipping openssl3 installation in this job"
+    return
+  fi
+
   src=/usr/local/src/openssl
   ssl3=/opt/ssl3
 
@@ -136,9 +156,16 @@ deps_linux() {
     deps_linux_debian "$@"
     ;;
 
-  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 ;;
@@ -146,8 +173,11 @@ deps_linux() {
 }
 
 deps_macos() {
-  brew install coreutils netcat lzo lz4 miniupnpc libgcrypt openssl meson "$@"
-  pip3 install --user compiledb
+  brew install lzo lz4 miniupnpc libgcrypt openssl "$@"
+
+  if [ -z "$SKIP_MESON" ]; then
+    brew install meson
+  fi
 }
 
 case "$(uname -s)" in