git: 48495a1f33ab - main - x11-toolkits/gtk-layer-shell: abort early non-Wayland builds

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Tue, 18 Feb 2025 10:03:25 UTC
The branch main has been updated by jbeich:

URL: https://cgit.FreeBSD.org/ports/commit/?id=48495a1f33ab5af2131fc475c110c2c8a3165b29

commit 48495a1f33ab5af2131fc475c110c2c8a3165b29
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2025-02-18 09:51:15 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2025-02-18 10:02:45 +0000

    x11-toolkits/gtk-layer-shell: abort early non-Wayland builds
    
    ../src/api.c:19:10: fatal error: 'gdk/gdkwayland.h' file not found
       19 | #include <gdk/gdkwayland.h>
          |          ^~~~~~~~~~~~~~~~~~
    
    PR:             281771
---
 x11-toolkits/gtk-layer-shell/Makefile | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/x11-toolkits/gtk-layer-shell/Makefile b/x11-toolkits/gtk-layer-shell/Makefile
index cf2f1abb5fe1..892130d5c4af 100644
--- a/x11-toolkits/gtk-layer-shell/Makefile
+++ b/x11-toolkits/gtk-layer-shell/Makefile
@@ -30,6 +30,13 @@ DOCS_MESON_TRUE=	docs
 
 EXAMPLES_MESON_TRUE=	examples
 
+pre-configure:
+# .if !exists() evaluates too early before gtk3 has a chance to be installed
+	@if ! pkg-config --exists gdk-wayland-3.0; then \
+		${ECHO_MSG} "${PKGNAME}: Needs gtk3 with WAYLAND support enabled."; \
+		${FALSE}; \
+	fi
+
 pre-test:
 	@if [ ! -e ${WRKDIR}/.meson_build_tests ]; then \
 		${RM} ${CONFIGURE_COOKIE} ${BUILD_COOKIE}; \