git: 7868dab103d5 - 2024Q2 - graphics/glfw: fix build with EXAMPLES and PREEDIT enabled

From: Vladimir Druzenko <vvd_at_FreeBSD.org>
Date: Mon, 29 Apr 2024 13:32:18 UTC
The branch 2024Q2 has been updated by vvd:

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

commit 7868dab103d546bab76462dd37759020125c1400
Author:     Vladimir Druzenko <vvd@FreeBSD.org>
AuthorDate: 2024-04-28 13:56:54 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2024-04-29 13:31:31 +0000

    graphics/glfw: fix build with EXAMPLES and PREEDIT enabled
    
    Reported by:    Alexander88207 (discord)
    Tested by:      nxjoseph (discord)
    Approved by:    eduardo (maintainer)
    
    (cherry picked from commit f4bd1ce2e80ab85cf0c19713f41a0a917a65789b)
---
 graphics/glfw/Makefile | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/graphics/glfw/Makefile b/graphics/glfw/Makefile
index 39b600a824c8..d6a45b65f78c 100644
--- a/graphics/glfw/Makefile
+++ b/graphics/glfw/Makefile
@@ -10,7 +10,7 @@ WWW=		https://www.glfw.org/
 LICENSE=	ZLIB
 LICENSE_FILE=	${WRKSRC}/LICENSE.md
 
-USES=		cmake:insource localbase zip
+USES=		cmake:insource localbase:ldflags zip
 USE_LDCONFIG=	yes
 
 CMAKE_ON=	BUILD_SHARED_LIBS
@@ -61,6 +61,12 @@ X11_USES=	xorg
 X11_USE=	XORG=x11,xcursor,xi,xinerama,xrandr,xxf86vm
 X11_CMAKE_BOOL=	GLFW_BUILD_X11
 
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MEXAMPLES} && ${PORT_OPTIONS:MPREEDIT}
+LIB_DEPENDS+=	libfontconfig.so:x11-fonts/fontconfig
+.endif
+
 do-install-DOCS-on:
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}/docs/html/search
 	${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR}
@@ -77,8 +83,8 @@ do-install-EXAMPLES-on:
 		${STAGEDIR}${EXAMPLESDIR}
 	cd ${WRKSRC}/tests && ${INSTALL_PROGRAM} \
 		allocator clipboard cursor empty events gamma glfwinfo icon \
-		iconify inputlag joysticks monitors msaa reopen tearing threads \
-		timeout title triangle-vulkan window \
+		iconify input_text inputlag joysticks monitors msaa reopen \
+		tearing threads timeout title triangle-vulkan window \
 		${STAGEDIR}${EXAMPLESDIR}/tests
 
 .include <bsd.port.mk>