git: f58e5c3241f4 - main - x11/bosd: Add EXAMPLES option

From: Devin Teske <dteske_at_FreeBSD.org>
Date: Sat, 26 Sep 2026 18:13:06 UTC
The branch main has been updated by dteske:

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

commit f58e5c3241f42684b15d9408c9288148a251c880
Author:     Devin Teske <dteske@FreeBSD.org>
AuthorDate: 2026-09-26 18:03:31 +0000
Commit:     Devin Teske <dteske@FreeBSD.org>
CommitDate: 2026-09-26 18:03:31 +0000

    x11/bosd: Add EXAMPLES option
    
    Install the sample glyph scripts only when EXAMPLES is on. The
    glyph PNGs stay in the icon directory.
    
    Suggested by:   fuz (mentor)
    Approved by:    fuz (mentor), jrm (mentor)
    Reviewed by:    fuz (mentor), jrm (mentor)
    Differential Revision:  https://reviews.freebsd.org/D59989
---
 x11/bosd/Makefile  | 12 ++++++++++--
 x11/bosd/pkg-plist | 16 ++++++++--------
 2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/x11/bosd/Makefile b/x11/bosd/Makefile
index cdd055aa2c41..85982d9e5ecc 100644
--- a/x11/bosd/Makefile
+++ b/x11/bosd/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	bosd
 DISTVERSION=	10.4
+PORTREVISION=	1
 CATEGORIES=	x11
 
 MAINTAINER=	dteske@FreeBSD.org
@@ -11,7 +12,7 @@ LICENSE_FILE=	${WRKSRC}/LICENSE
 LIB_DEPENDS=	libfontconfig.so:x11-fonts/fontconfig \
 		libpng16.so:graphics/png
 
-USES=		localbase:ldflags pkgconfig python:build,run shebangfix xorg
+USES=		localbase:ldflags pkgconfig shebangfix xorg
 USE_GITHUB=	yes
 GH_ACCOUNT=	FrauBSD
 USE_LDCONFIG=	yes
@@ -25,10 +26,13 @@ MAKE_ARGS=	PKGCONFIGDIR="${PREFIX}/libdata/pkgconfig" \
 		PYTHON="${PYTHON_CMD}"
 ALL_TARGET=	all example
 
-OPTIONS_DEFINE=		TESTS
+OPTIONS_DEFINE=		EXAMPLES TESTS
 OPTIONS_DEFAULT=	TESTS
 OPTIONS_SUB=		yes
 
+TESTS_DESC=		Install the test suite
+EXAMPLES_USES=		python:build,run
+EXAMPLES_USES_OFF=	python:build
 TESTS_MAKE_ARGS=	INSTALL_TESTS=yes
 TESTS_MAKE_ARGS_OFF=	INSTALL_TESTS=no
 
@@ -38,4 +42,8 @@ post-install:
 	${INSTALL_DATA} ${WRKSRC}/CHANGELOG.md ${STAGEDIR}${DOCSDIR}
 	${INSTALL_DATA} ${WRKSRC}/examples/*.png ${STAGEDIR}${DATADIR}
 
+# Upstream install always copies the example scripts.
+post-install-EXAMPLES-off:
+	${RM} -r ${STAGEDIR}${EXAMPLESDIR}
+
 .include <bsd.port.mk>
diff --git a/x11/bosd/pkg-plist b/x11/bosd/pkg-plist
index c4d25996ca42..902a8366f739 100644
--- a/x11/bosd/pkg-plist
+++ b/x11/bosd/pkg-plist
@@ -21,14 +21,14 @@ share/bosd/tile-float.png
 share/bosd/tile-on.png
 share/doc/bosd/CHANGELOG.md
 share/doc/bosd/README.md
-share/examples/bosd/airplane.py
-share/examples/bosd/audio.py
-share/examples/bosd/auto-rotate.py
-share/examples/bosd/bsd.py
-share/examples/bosd/glyph.py
-share/examples/bosd/lid.py
-share/examples/bosd/mirror.py
-share/examples/bosd/tile.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/airplane.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/audio.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/auto-rotate.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/bsd.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/glyph.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/lid.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/mirror.py
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/tile.py
 share/man/man1/bosd.1.gz
 share/man/man3/bosd.3.gz
 %%TESTS%%share/bosd/tests/run