git: 155a1013e551 - main - net/wifi-firmware-kmod: add STRIP_FWSUBDIR logic

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Thu, 11 Dec 2025 23:26:27 UTC
The branch main has been updated by bz:

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

commit 155a1013e551f568f1a436ee619e30ef9b1d4346
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2025-11-11 01:20:54 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2025-12-11 23:26:09 +0000

    net/wifi-firmware-kmod: add STRIP_FWSUBDIR logic
    
    iwlwififw(4) got moved into a subdirectory in the linux-firmware.git
    but the driver still expects the firmware at the toplevel.
    The longer-term solution would be to create symlinks as the WHENCE
    file indicates but for the moment use the less intrusive version
    simply stripping the subdir during 'extract'.
    
    Sponsored by:   The FreeBSD Foundation
    Reported by:    jrm
    Differential Revision: https://reviews.freebsd.org/D53680
---
 net/wifi-firmware-kmod/Makefile.inc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/wifi-firmware-kmod/Makefile.inc b/net/wifi-firmware-kmod/Makefile.inc
index 0aca6067f1d1..7719f65847d2 100644
--- a/net/wifi-firmware-kmod/Makefile.inc
+++ b/net/wifi-firmware-kmod/Makefile.inc
@@ -130,9 +130,9 @@ post-extract:
 ################################################################################
 .for _f in ${DISTFILES_${FLAVOR}:O:u}
 	# Create firmware source directory and copy in distfile.
-	@${MKDIR} ${WRKSRC}/fw/${_f:H}
-	${CP} ${DISTDIR}/${DIST_SUBDIR}/${_f} ${WRKSRC}/fw/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@}
-	@${ECHO_CMD} ${BOOTFWDIR}/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@} >> ${PLIST}.tmp
+	@${MKDIR} ${WRKSRC}/fw/${_f:S@${STRIP_FWSUBDIR:Q}@@:H}
+	${CP} ${DISTDIR}/${DIST_SUBDIR}/${_f} ${WRKSRC}/fw/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S@${STRIP_FWSUBDIR:Q}@@}
+	@${ECHO_CMD} ${BOOTFWDIR}/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S@${STRIP_FWSUBDIR:Q}@@} >> ${PLIST}.tmp
 .endfor
 	# Create PLIST for firmware files.
 	(cd ${WRKSRC}/fw/ && ${FIND} . -type d -mindepth 1 | \