CI: run all test flavors on BSDs
authorKirill Isakov <bootctl@gmail.com>
Sun, 1 May 2022 12:56:23 +0000 (18:56 +0600)
committerKirill Isakov <bootctl@gmail.com>
Sun, 1 May 2022 12:56:23 +0000 (18:56 +0600)
.builds/freebsd.yml
.builds/netbsd.yml
.builds/openbsd.yml
.ci/bsd/run.sh [new file with mode: 0755]
src/meson.build

index b7d0681..8658895 100644 (file)
@@ -1,32 +1,22 @@
 image: freebsd/13.x
 
 packages:
-  - coreutils
+  - cmocka
+  - libgcrypt
+  - liblz4
+  - lzo2
   - meson
   - pkgconf
-  - openssl
-  - lzo2
-  - liblz4
-  - ncurses
-  - miniupnpc
-  - readline
   - texinfo
   - vde2
-  - libgcrypt
-  - cmocka
 
 sources:
   - https://github.com/gsliepen/tinc
 
-tasks:
-  - configure: |
-      cd tinc
-      meson setup build -Dpkg_config_path=/usr/local/lib/pkgconfig
+environment:
+  PKG_CONFIG_PATH: /usr/local/libdata/pkgconfig
 
-  - build: |
-      cd tinc
-      ninja -C build
-
-  - test: |
-      cd tinc
-      meson test -C build --verbose
+tasks:
+  - openssl: sh tinc/.ci/bsd/run.sh openssl
+  - nolegacy: sh tinc/.ci/bsd/run.sh nolegacy
+  - gcrypt: sh tinc/.ci/bsd/run.sh gcrypt
index 7fbaca4..41e5895 100644 (file)
@@ -1,28 +1,22 @@
 image: netbsd/9.x
 
 packages:
-  - meson
-  - pkgconf
-  - openssl
-  - lzo
+  - cmocka
+  - gtexinfo
+  - libgcrypt
   - lz4
+  - lzo
+  - meson
   - miniupnpc
-  - readline
-  - gtexinfo
-  - cmocka
+  - pkgconf
 
 sources:
   - https://github.com/gsliepen/tinc
 
-tasks:
-  - configure: |
-      cd tinc
-      meson setup build -Dpkg_config_path=/usr/pkg/lib/pkgconfig -Dminiupnpc=auto
-
-  - build: |
-      cd tinc
-      ninja -C build
+environment:
+  PKG_CONFIG_PATH: /usr/pkg/lib/pkgconfig
 
-  - test: |
-      cd tinc
-      meson test -C build --verbose
+tasks:
+  - openssl: sh tinc/.ci/bsd/run.sh openssl
+  - nolegacy: sh tinc/.ci/bsd/run.sh nolegacy
+  - gcrypt: sh tinc/.ci/bsd/run.sh gcrypt
index f931ca4..cd5183e 100644 (file)
@@ -1,27 +1,19 @@
 image: openbsd/7.0
 
 packages:
-  - meson
-  - pkgconf
-  - lzo2
+  - cmocka
+  - libgcrypt
   - lz4
+  - lzo2
+  - meson
   - miniupnpc
-  - readline
+  - pkgconf
   - texinfo
-  - cmocka
 
 sources:
   - https://github.com/gsliepen/tinc
 
 tasks:
-  - configure: |
-      cd tinc
-      meson setup build -Dminiupnpc=auto
-
-  - build: |
-      cd tinc
-      ninja -C build
-
-  - test: |
-      cd tinc
-      meson test -C build --verbose
+  - openssl: sh tinc/.ci/bsd/run.sh openssl
+  - nolegacy: sh tinc/.ci/bsd/run.sh nolegacy
+  - gcrypt: sh tinc/.ci/bsd/run.sh gcrypt
diff --git a/.ci/bsd/run.sh b/.ci/bsd/run.sh
new file mode 100755 (executable)
index 0000000..2620441
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -eu
+
+flavor=$1
+
+cd tinc
+
+meson setup "$flavor" -D crypto="$flavor" -D miniupnpc=auto
+
+meson test -C "$flavor" --verbose
index 1d195cf..351124e 100644 (file)
@@ -278,6 +278,9 @@ else
   if not dep_readline.found()
     dep_readline = cc.find_library('readline', required: opt_readline, static: static)
   endif
+  if not dep_readline.found()
+    dep_readline = cc.find_library('libedit', required: opt_readline, static: static)
+  endif
   if dep_readline.found() and \
      cc.has_header('readline/readline.h', dependencies: dep_readline) and \
      cc.has_header('readline/history.h', dependencies: dep_readline)