git: a4ef19e1e1cb - main - x11-toolkits/gtk30: Introduce TEST option and fix 100 tests by employing USES=display

From: Gleb Popov <arrowd_at_FreeBSD.org>
Date: Sun, 05 Oct 2025 18:47:29 UTC
The branch main has been updated by arrowd:

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

commit a4ef19e1e1cb824efc6fde8e71c141fb0b388c8c
Author:     Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2025-10-05 18:46:36 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2025-10-05 18:47:15 +0000

    x11-toolkits/gtk30: Introduce TEST option and fix 100 tests by employing USES=display
---
 x11-toolkits/gtk30/Makefile | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/x11-toolkits/gtk30/Makefile b/x11-toolkits/gtk30/Makefile
index 204f5099e8a1..6ab2049212ea 100644
--- a/x11-toolkits/gtk30/Makefile
+++ b/x11-toolkits/gtk30/Makefile
@@ -17,6 +17,7 @@ LIB_DEPENDS=	libepoxy.so:graphics/libepoxy \
 		libharfbuzz.so:print/harfbuzz
 RUN_DEPENDS=	adwaita-icon-theme>=0:x11-themes/adwaita-icon-theme \
 		hicolor-icon-theme>=0:misc/hicolor-icon-theme
+TEST_DEPENDS=	Xvfb:x11-servers/xorg-server@xvfb
 
 USES=		compiler:c11 cpe gettext gnome localbase:ldflags meson ninja \
 		pathfix perl5 pkgconfig python shebangfix tar:xz
@@ -32,14 +33,13 @@ USE_LDCONFIG=	yes
 USE_PERL5=	build
 SHEBANG_GLOB=	*.py
 
-MESON_ARGS=	-Dtests=false
-
 PORTSCOUT=	limit:1,even
 
 LIBVERSION=	0.2419.32
 PLIST_SUB+=	LIBVERSION=${LIBVERSION}
+TEST_ENV=	DISPLAY=:0
 
-OPTIONS_DEFINE=		ATK_BRIDGE COLORD CUPS DOCS
+OPTIONS_DEFINE=		ATK_BRIDGE COLORD CUPS DOCS TEST
 OPTIONS_DEFAULT=	ATK_BRIDGE BROADWAY COLORD CUPS WAYLAND X11
 OPTIONS_MULTI=		BACKENDS
 OPTIONS_MULTI_BACKENDS=	BROADWAY WAYLAND X11
@@ -67,6 +67,9 @@ CUPS_MESON_OFF=		-Dprint_backends=file,lpr
 DOCS_BUILD_DEPENDS=	gtk-doc>0:textproc/gtk-doc
 DOCS_MESON_TRUE=	gtk_doc man
 
+TEST_USES=		display:test
+TEST_MESON_TRUE=	tests
+
 WAYLAND_BUILD_DEPENDS=	wayland-protocols>=0:graphics/wayland-protocols
 WAYLAND_LIB_DEPENDS=	libwayland-egl.so:graphics/wayland \
 			libxkbcommon.so:x11/libxkbcommon
@@ -77,7 +80,7 @@ X11_USES=	xorg
 X11_USE=	XORG=x11,xcomposite,xcursor,xdamage,xext,xfixes,xi,xinerama,xrandr,xrender
 X11_MESON_TRUE=	x11_backend
 
-TESTING_UNSAFE=	ld: error: unable to find library -lintl
+TESTING_UNSAFE=	some tests fail, requires investigation
 
 pre-build:
 	@${RM} -r ${WRKSRC}/docs/gtk.info*
@@ -87,8 +90,4 @@ post-install:
 	@${MKDIR} ${STAGEDIR}${PREFIX}/lib/gtk-3.0/${GTK3_VERSION}/engines
 	@${MKDIR} ${STAGEDIR}${PREFIX}/lib/gtk-3.0/${GTK3_VERSION}/loaders
 
-pre-test:
-	${RM} ${CONFIGURE_COOKIE} ${BUILD_COOKIE}
-	${MAKE} -C${.CURDIR} build MESON_ARGS="${MESON_ARGS} --reconfigure -Dtests=true"
-
 .include <bsd.port.mk>