git: bb6a0eca39db - main - x11-fonts/webfonts: Improve port

From: Daniel Engberg <diizzy_at_FreeBSD.org>
Date: Sun, 13 Sep 2026 09:15:45 UTC
The branch main has been updated by diizzy:

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

commit bb6a0eca39dbcb62f61cc14947732488005dcfe8
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2026-09-13 09:06:47 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2026-09-13 09:15:28 +0000

    x11-fonts/webfonts: Improve port
    
    Make use of the framework instead of working around it
    
    PR:             298040
    Approved by:    maintainer timeout, 2+ weeks
---
 x11-fonts/webfonts/Makefile | 61 ++++++++++++++++++---------------------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/x11-fonts/webfonts/Makefile b/x11-fonts/webfonts/Makefile
index 96ae13857d7c..ba7e6c1cfbb0 100644
--- a/x11-fonts/webfonts/Makefile
+++ b/x11-fonts/webfonts/Makefile
@@ -8,7 +8,7 @@ MASTER_SITES=	SF/corefonts/the%20fonts/final:group1 \
 		SF/mscorefonts2/cabs:group3
 DISTFILES=	andale32.exe:group1 arialb32.exe:group1 comic32.exe:group1 \
 		courie32.exe:group1 georgi32.exe:group1 impact32.exe:group1 \
-		verdan32.exe:group1 webdin32.exe:group1 EUupdate.EXE:group3
+		verdan32.exe:group1 webdin32.exe:group1
 DIST_SUBDIR=	${PORTNAME}
 
 MAINTAINER=	olgeni@FreeBSD.org
@@ -23,12 +23,19 @@ LICENSE_PERMS=	dist-mirror pkg-mirror auto-accept
 
 USES=		fonts
 
+# Do not extract CLEARTYPE distfile
+EXTRACT_ONLY=	${_DISTFILES:M*32*} ${_DISTFILES:M*CAB*} ${_DISTFILES:M*EXE*}
+EXTRACT_AFTER_ARGS=	--include '*.[tT][tT][fF]' \
+			--no-same-owner --no-same-permissions
+
+NO_WRKSUBDIR=	yes
 NO_ARCH=	yes
 NO_BUILD=	yes
+
 SUB_FILES=	pkg-message
 
 OPTIONS_DEFINE=	EXTRAFONTS CLEARTYPE NEWVERDANA DOCS COMIC
-OPTIONS_DEFAULT=	COMIC
+OPTIONS_DEFAULT=COMIC
 OPTIONS_SUB=	yes
 
 CLEARTYPE_DESC=		Install ClearType fonts
@@ -38,46 +45,26 @@ NEWVERDANA_DESC=	Install y2006 version of Verdana (broken bold N, W)
 
 CLEARTYPE_DISTFILES=	PowerPointViewer.exe:group3
 EXTRAFONTS_DISTFILES=	IELPKTH.CAB:group2
+NEWVERDANA_DISTFILES=	EUupdate.EXE:group3
 
 .include <bsd.port.options.mk>
 
-# The distfiles are Microsoft self-extracting cabinets, which bsdtar reads
-# directly, so no external extraction tool is needed.  Note that --exclude
-# must precede the inclusion patterns: bsdtar stops parsing options at the
-# first pattern argument and would otherwise treat it as one.
-_FONT_CABS=	andale32.exe arialb32.exe comic32.exe courie32.exe \
-		georgi32.exe impact32.exe webdin32.exe EUupdate.EXE
-.if ${PORT_OPTIONS:MEXTRAFONTS}
-_FONT_CABS+=	IELPKTH.CAB
-.endif
-
-_EXTRACT_CAB=	${TAR} -x --no-same-owner --no-same-permissions -C ${WRKSRC} -f
-
-do-extract:
-	@${MKDIR} ${WRKSRC}
-# Verdana is held back here and taken from one of two sources below
-.for cab in ${_FONT_CABS}
-	@${_EXTRACT_CAB} ${_DISTDIR}/${cab} --exclude '[vV]*' '*.[tT][tT][fF]'
-.endfor
-	@${_EXTRACT_CAB} ${_DISTDIR}/webdin32.exe '*.[tT][xX][tT]'
-.if ${PORT_OPTIONS:MNEWVERDANA}
-	@${_EXTRACT_CAB} ${_DISTDIR}/EUupdate.EXE '[vV]*.[tT][tT][fF]'
-.else
-	@${_EXTRACT_CAB} ${_DISTDIR}/verdan32.exe '*.[tT][tT][fF]'
-.endif
-.if ${PORT_OPTIONS:MCLEARTYPE}
-	@${_EXTRACT_CAB} ${_DISTDIR}/PowerPointViewer.exe 'ppviewer.cab' '*.[tT][xX][tT]'
-	@${_EXTRACT_CAB} ${WRKSRC}/ppviewer.cab '*.[tT][tT][fF]'
-	@${RM} ${WRKSRC}/ppviewer.cab
-.endif
-# The cabinets store mixed case names, the package installs lowercase ones
+pre-extract-CLEARTYPE-on:
+	${MKDIR} ${EXTRACT_WRKDIR}
+	${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/${_DISTFILES:MPowerPointViewer*} --include eula.txt -C ${EXTRACT_WRKDIR} --no-same-owner --no-same-permissions
+	${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/${_DISTFILES:MPowerPointViewer*} -O --include ppviewer.cab | ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} - -C ${EXTRACT_WRKDIR} ${EXTRACT_AFTER_ARGS}
+
+post-extract:
+	${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/${_DISTFILES:Mwebdin32*} --include *.TXT -C ${EXTRACT_WRKDIR} --no-same-owner --no-same-permissions
 	@cd ${WRKSRC} && for f in *; do \
-		l=$$(${ECHO_CMD} $${f} | ${TR} '[:upper:]' '[:lower:]'); \
-		[ "$${f}" = "$${l}" ] || ${MV} -f "$${f}" "$${l}"; \
+	    ${MV} "$$f" `${ECHO_CMD} "$$f" | ${TR} '[:upper:]' '[:lower:]'`; \
 	done
-.if ! ${PORT_OPTIONS:MCOMIC}
-	@${RM} ${WRKSRC}/comic.ttf ${WRKSRC}/comicbd.ttf
-.endif
+
+post-extract-COMIC-off:
+	${RM} ${WRKSRC}/comic.ttf ${WRKSRC}/comicbd.ttf
+
+post-extract-EXTRAFONTS-off:
+	${RM} ${WRKSRC}/tahoma.ttf ${WRKSRC}/tahomabd.ttf
 
 do-install:
 	@${MKDIR} ${STAGEDIR}${FONTSDIR}