From e6b89850902c56076ea15197501d3cb5a1cc47f0 Mon Sep 17 00:00:00 2001 From: Thomas von Dein Date: Fri, 21 Nov 2025 00:21:26 +0100 Subject: [PATCH] add error if no db lib found, add better ci build and test --- .woodpecker/build.yaml | 16 +++++++++++++++- meson.build | 8 ++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.woodpecker/build.yaml b/.woodpecker/build.yaml index ff6b4de..b3be1be 100644 --- a/.woodpecker/build.yaml +++ b/.woodpecker/build.yaml @@ -6,7 +6,7 @@ labels: platform: ${platform} steps: - build-n-test: + build-berkeley: when: event: [push] image: alpine:latest @@ -15,3 +15,17 @@ steps: - apk add --no-cache bash build-base words-en gdb perl pcre2 pcre2-dev db db-dev pkgconfig meson ninja - meson setup --reconfigure build - ninja -C build + - build/dbtool -d test.db -i -k "test" -v "blah blah blah" + - build/dbtool -d test.db -D | grep blah + + build-gdbm: + when: + event: [push] + image: alpine:latest + commands: + - apk update + - apk add --no-cache bash build-base words-en gdb perl pcre2 pcre2-dev gdbm gdbm-dev pkgconfig meson ninja + - meson setup --reconfigure build + - ninja -C build + - build/dbtool -d test.db -i -k "test" -v "blah blah blah" + - build/dbtool -d test.db -D | grep blah diff --git a/meson.build b/meson.build index 7d90d37..cf64010 100644 --- a/meson.build +++ b/meson.build @@ -46,15 +46,19 @@ pcre2 = dependency('libpcre2-8') # manually check for libraries -lib_berkeley = cpp.find_library('db_cxx', +lib_berkeley = cpp.find_library('db_cxx', required: false, dirs : ['/usr', '/usr/local']) inc_berkeley = include_directories('/usr', '/usr/local') -lib_gdbm = cpp.find_library('gdbm', +lib_gdbm = cpp.find_library('gdbm', required: false, dirs : ['/usr', '/usr/local']) inc_gdbm = include_directories('/usr', '/usr/local') +if not lib_gdbm.found() and not lib_berkeley.found() + error('neither GDBM nor BerkeleyDB are installed') +endif + # check commandline options prefix = get_option('prefix')