git: 9cf99b07da34 - main - science/dlib-cpp: Make the GUI support optional

From: Gleb Popov <arrowd_at_FreeBSD.org>
Date: Wed, 30 Sep 2026 14:33:50 UTC
The branch main has been updated by arrowd:

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

commit 9cf99b07da34615bbd2a174ff66606c66596ae99
Author:     Alexander Leidinger <netchild@FreeBSD.org>
AuthorDate: 2026-09-29 17:49:13 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2026-09-30 14:32:23 +0000

    science/dlib-cpp: Make the GUI support optional
    
    Without X11, dlib is built with DLIB_NO_GUI_SUPPORT and links no X11
    library, so consumers of its numerical parts no longer pull in X11.
    The default stays on.
---
 science/dlib-cpp/Makefile | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/science/dlib-cpp/Makefile b/science/dlib-cpp/Makefile
index 6eb169202232..d75cbc9eedf7 100644
--- a/science/dlib-cpp/Makefile
+++ b/science/dlib-cpp/Makefile
@@ -14,9 +14,8 @@ LICENSE_FILE=	${WRKSRC}/dlib/LICENSE.txt
 LIB_DEPENDS=	libpng.so:graphics/png \
 		libgif.so:graphics/giflib
 
-USES=			cmake compiler:c++11-lang jpeg pkgconfig sqlite tar:bzip2 xorg
+USES=			cmake compiler:c++11-lang jpeg pkgconfig sqlite tar:bzip2
 USE_LDCONFIG=		yes
-USE_XORG=		ice sm x11 xext
 
 USE_GITHUB=		yes
 GH_ACCOUNT=		davisking
@@ -26,7 +25,8 @@ EXTRACT_AFTER_ARGS=	--exclude=${PORTNAME}-${DISTVERSION}/dlib/external \
 
 CMAKE_ON=		BUILD_SHARED_LIBS
 
-OPTIONS_DEFINE=		BLASLAPACK FFMPEG
+OPTIONS_DEFINE=		BLASLAPACK FFMPEG X11
+OPTIONS_DEFAULT=	X11
 
 BLASLAPACK_DESC=	Use OpenBLAS for matrix operations
 FFMPEG_DESC=		Build with the FFMPEG wrappers
@@ -35,4 +35,8 @@ BLASLAPACK_USES=	blaslapack:openblas
 BLASLAPACK_CMAKE_OFF=	-DDLIB_USE_BLAS=0 -DDLIB_USE_LAPACK=0
 FFMPEG_LIB_DEPENDS=	libavcodec.so:multimedia/ffmpeg
 
+X11_USES=		xorg
+X11_USE=		XORG=ice,sm,x11,xext
+X11_CMAKE_BOOL_OFF=	DLIB_NO_GUI_SUPPORT
+
 .include <bsd.port.mk>