From 6c3cf84b07077ece99a956cf0a9983233054fe48 Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Fri, 8 Aug 2025 19:17:22 +0100 Subject: [PATCH] labnag: fix FreeBSD signalfd() build error --- .github/workflows/build.yml | 3 ++- clients/labnag.c | 3 +++ clients/meson.build | 8 ++++++++ scripts/checkpatch.pl | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 892d8867..b0ff3053 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -103,7 +103,8 @@ jobs: sed -i '' 's/quarterly/latest/' /etc/pkg/FreeBSD.conf pkg set -yn pkg:mesa-dri # hack to skip llvm dependency pkg install -y git meson gcc pkgconf cairo pango evdev-proto \ - hwdata wayland-protocols wlroots019 libdisplay-info + hwdata wayland-protocols libdisplay-info libepoll-shim \ + wlroots019 run: echo "setup done" - name: Install Void Linux dependencies diff --git a/clients/labnag.c b/clients/labnag.c index 514ac864..fa3c3aea 100644 --- a/clients/labnag.c +++ b/clients/labnag.c @@ -17,6 +17,9 @@ #include #include #include +#ifdef __FreeBSD__ +#include /* For signalfd() */ +#endif #include #include #include diff --git a/clients/meson.build b/clients/meson.build index 7c6fa5a5..3a80a4f0 100644 --- a/clients/meson.build +++ b/clients/meson.build @@ -30,6 +30,13 @@ foreach xml : protocols ) endforeach +if host_machine.system() in ['freebsd', 'openbsd'] + # For signalfd() + epoll_dep = dependency('epoll-shim') +else + epoll_dep = [] +endif + executable( 'labnag', nag_sources, @@ -41,6 +48,7 @@ executable( wayland_cursor, wlroots, server_protos, + epoll_dep, ], install: true ) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index f9e9d1d9..933dbc59 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5659,6 +5659,7 @@ sub process { $var !~ /^(?:_?Pango\w+)/ && $var !~ /^(?:xml\w+)/ && $var !~ /^(?:GString|GError|GHashTable)/ && + $var !~ /^(?:__FreeBSD__)/ && $var !~ /^(?:RsvgRectangle|RsvgHandle)/ && $var !~ /^(?:XKB_KEY_XF86Switch_VT_1)/ &&