Page MenuHomeFreeBSD

D45369.id139109.diff
No OneTemporary

D45369.id139109.diff

diff --git a/net/wifi-firmware-kmod/Makefile.inc b/net/wifi-firmware-kmod/Makefile.inc
--- a/net/wifi-firmware-kmod/Makefile.inc
+++ b/net/wifi-firmware-kmod/Makefile.inc
@@ -11,7 +11,7 @@
FWDRV?= base
LICENSE_NAME?= firmware license (${FWDRV})
-LICENSE_FILE?= ${WRKSRC}/${FLAVOR}/${LICENSE}
+LICENSE_FILE?= ${WRKSRC}/${LICENSE}
LICENSE_PERMS?= dist-mirror no-dist-sell pkg-mirror no-pkg-sell auto-accept
EXTRACT_SUFX=
@@ -27,13 +27,23 @@
FILESDIR= ${BASEDIR}/files
+# Record extra licenses files in plist.
+.if !defined (DISABLE_LICENSES)
+PLIST_FILES+= ${_LICENSE_DIR}/WHENCE
+.for _f in ${DISTFILES_${FLAVOR}_lic}
+PLIST_FILES+= ${_LICENSE_DIR}/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,/,_,g}
+.endfor
+.endif
+
+# Add firmware files to plist.
+.for _f in ${DISTFILES_${FLAVOR}}
+PLIST_FILES+= ${KMODDIR}/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,.,_,g:S,-,_,g:S,/,_,g}.ko
+.endfor
+
# Split things into the full package (driver name) and more specific flavors.
FLAVORS= ${FWDRV} \
${FWSUBS}
-# What a kludge.... thanks https://docs.freebsd.org/en/books/porters-handbook/flavors/ !
-FLAVOR?= ${FLAVORS:[1]}
-
# Generate the conflicts list.
.for f in ${FWSUBS}
${FWDRV}_CONFLICTS_INSTALL+= ${PORTNAME}-${f}
@@ -41,14 +51,10 @@
${f}_CONFLICTS_INSTALL= ${PORTNAME}
.endfor
-DISTFILES_FLAVOR:= ${DISTFILES_${FLAVOR}}
-DISTFILES_FLAVOR_lic:= ${DISTFILES_${FLAVOR}_lic}
-
-DISTFILES= \
- ${DISTFILES_FLAVOR} \
- ${DISTFILES_FLAVOR_lic} \
- ${LICENSE}${DISTURL_SUFFIX} \
- WHENCE${DISTURL_SUFFIX}
+DISTFILES= ${DISTFILES_${FLAVOR}} \
+ ${DISTFILES_${FLAVOR}_lic} \
+ ${LICENSE}${DISTURL_SUFFIX} \
+ WHENCE${DISTURL_SUFFIX}
DIST_SUBDIR= linux-firmware/${FWDRV}fw
EXTRACT_ONLY=
@@ -58,64 +64,53 @@
USES= kmod uidfix
+MAKE_ENV+= FWSRCDIR=${WRKSRC}/fw
+
post-extract:
- @${MKDIR} ${WRKSRC}/${FLAVOR}/fw
+ @${MKDIR} ${WRKSRC}/fw
# Deal with supplementary licenses files.
- @${CP} ${DISTDIR}/${DIST_SUBDIR}/${LICENSE}${DISTURL_SUFFIX} ${WRKSRC}/${FLAVOR}/${LICENSE}
- @${CP} ${DISTDIR}/${DIST_SUBDIR}/WHENCE${DISTURL_SUFFIX} ${WRKSRC}/${FLAVOR}/WHENCE.in
- @${SED} -e "s@%%XXX%%@${WHENCE_REGEX:Q}@g" ${FILESDIR}/WHENCE.awk.in > ${WRKSRC}/${FLAVOR}/WHENCE.awk
- @${AWK} -f ${WRKSRC}/${FLAVOR}/WHENCE.awk ${WRKSRC}/${FLAVOR}/WHENCE.in > ${WRKSRC}/${FLAVOR}/WHENCE
+ @${CP} ${DISTDIR}/${DIST_SUBDIR}/${LICENSE}${DISTURL_SUFFIX} ${WRKSRC}/${LICENSE}
+ @${CP} ${DISTDIR}/${DIST_SUBDIR}/WHENCE${DISTURL_SUFFIX} ${WRKSRC}/WHENCE.in
+ @${SED} -e "s@%%XXX%%@${WHENCE_REGEX:Q}@g" ${FILESDIR}/WHENCE.awk.in > ${WRKSRC}/WHENCE.awk
+ @${AWK} -f ${WRKSRC}/WHENCE.awk ${WRKSRC}/WHENCE.in > ${WRKSRC}/WHENCE
# Prepare toplevel Makefile and Makefile.inc.
- @${ECHO_CMD} "SUBDIR=" > ${WRKSRC}/${FLAVOR}/Makefile
+ @${ECHO_CMD} "SUBDIR=" > ${WRKSRC}/Makefile
@${SED} -e "s@%%FWDRV%%@${FWDRV}@g" \
-e "s@%%FWSUBDIR%%@${FWSUBDIR}@g" \
- ${FILESDIR}/Makefile.inc.in > ${WRKSRC}/${FLAVOR}/Makefile.inc
-.for _f in ${DISTFILES_FLAVOR}
+ ${FILESDIR}/Makefile.inc.in > ${WRKSRC}/Makefile.inc
+.for _f in ${DISTFILES_${FLAVOR}}
# We remove '.' and '-' as well as '/' as they don't work well in loader.conf.
- @${MKDIR} ${WRKSRC}/${FLAVOR}/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,.,_,g:S,-,_,g:S,/,_,g}
+ @${MKDIR} ${WRKSRC}/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,.,_,g:S,-,_,g:S,/,_,g}
# Create subdir (firmware file) Makefile.
- @${ECHO_CMD} "FWNAME=${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:T}" > ${WRKSRC}/${FLAVOR}/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,.,_,g:S,-,_,g:S,/,_,g}/Makefile
+ @${ECHO_CMD} "FWNAME=${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:T}" > ${WRKSRC}/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,.,_,g:S,-,_,g:S,/,_,g}/Makefile
.if (${_f:H:C,^[^/]*,,1:C,^/,,} != "")
- @${ECHO_CMD} "FWSUBSUBDIR=${_f:H:C,^[^/]*,,1:C,^/,,}" >> ${WRKSRC}/${FLAVOR}/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,.,_,g:S,-,_,g:S,/,_,g}/Makefile
+ @${ECHO_CMD} "FWSUBSUBDIR=${_f:H:C,^[^/]*,,1:C,^/,,}" >> ${WRKSRC}/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,.,_,g:S,-,_,g:S,/,_,g}/Makefile
.endif
# XXX-BZ recover firmware versions later again from somewhere? Pain to keep track though, else use 0 or ${FWDRV_VERSION}?
- @${ECHO_CMD} "VERSION=0" >> ${WRKSRC}/${FLAVOR}/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,.,_,g:S,-,_,g:S,/,_,g}/Makefile
- @${ECHO_CMD} '.include <bsd.kmod.mk>' >> ${WRKSRC}/${FLAVOR}/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,.,_,g:S,-,_,g:S,/,_,g}/Makefile
+ @${ECHO_CMD} "VERSION=0" >> ${WRKSRC}/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,.,_,g:S,-,_,g:S,/,_,g}/Makefile
+ @${ECHO_CMD} '.include <bsd.kmod.mk>' >> ${WRKSRC}/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,.,_,g:S,-,_,g:S,/,_,g}/Makefile
# Add subdir to top-level Makefile.
- @${ECHO_CMD} "SUBDIR+=${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,.,_,g:S,-,_,g:S,/,_,g}" >> ${WRKSRC}/${FLAVOR}/Makefile
+ @${ECHO_CMD} "SUBDIR+=${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,.,_,g:S,-,_,g:S,/,_,g}" >> ${WRKSRC}/Makefile
# Create firmware source directory and copy in distfile.
- @${MKDIR} ${WRKSRC}/${FLAVOR}/fw/${_f:H}
- ${CP} ${DISTDIR}/${DIST_SUBDIR}/${_f} ${WRKSRC}/${FLAVOR}/fw/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@}
+ @${MKDIR} ${WRKSRC}/fw/${_f:H}
+ ${CP} ${DISTDIR}/${DIST_SUBDIR}/${_f} ${WRKSRC}/fw/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@}
.endfor
- @${ECHO_CMD} '.include <bsd.subdir.mk>' >> ${WRKSRC}/${FLAVOR}/Makefile
+ @${ECHO_CMD} '.include <bsd.subdir.mk>' >> ${WRKSRC}/Makefile
# Copy in additional licenses files.
-.for _f in ${DISTFILES_FLAVOR_lic}
- ${CP} ${DISTDIR}/${DIST_SUBDIR}/${_f} ${WRKSRC}/${FLAVOR}/fw/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,/,_,g}
+.for _f in ${DISTFILES_${FLAVOR}_lic}
+ ${CP} ${DISTDIR}/${DIST_SUBDIR}/${_f} ${WRKSRC}/fw/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,/,_,g}
.endfor
# Internal hack we should probably upstream.
# Add WHENCE file next to license where it makes sense despite not being a license.
+.if !defined (DISABLE_LICENSES)
_USES_stage+= 881:post-install-license
post-install-license:
- ${INSTALL_DATA} ${WRKSRC}/${FLAVOR}/WHENCE ${STAGEDIR}${_LICENSE_DIR}/
-.for _f in ${DISTFILES_FLAVOR_lic}
- ${INSTALL_DATA} ${WRKSRC}/${FLAVOR}/fw/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,/,_,g} \
+ ${INSTALL_DATA} ${WRKSRC}/WHENCE ${STAGEDIR}${_LICENSE_DIR}/
+.for _f in ${DISTFILES_${FLAVOR}_lic}
+ ${INSTALL_DATA} ${WRKSRC}/fw/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,/,_,g} \
${STAGEDIR}${_LICENSE_DIR}/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,/,_,g}
.endfor
+.endif
-.include <bsd.port.pre.mk>
-
-MAKE_ENV+= FWSRCDIR=${WRKSRC}/${FLAVOR}/fw
-MAKE_FLAGS+= -C ${WRKSRC}/${FLAVOR}
-
-# Add firmware files to plist.
-.for _f in ${DISTFILES_FLAVOR}
-PLIST_FILES+= ${KMODDIR}/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,.,_,g:S,-,_,g:S,/,_,g}.ko
-.endfor
-# Record extra licenses files in plist.
-PLIST_FILES+= ${_LICENSE_DIR}/WHENCE
-.for _f in ${DISTFILES_FLAVOR_lic}
-PLIST_FILES+= ${_LICENSE_DIR}/${_f:C@(^[^?]*)${DISTURL_SUFFIX:Q}@\1@:S,/,_,g}
-.endfor
-
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>

File Metadata

Mime Type
text/plain
Expires
Sat, Jan 25, 5:48 PM (13 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16156032
Default Alt Text
D45369.id139109.diff (6 KB)

Event Timeline