Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 May 2022 09:59:23 +0900
From:      Tatsuki Makino <tatsuki_makino@hotmail.com>
To:        Rozhuk Ivan <rozhuk.im@gmail.com>, freebsd-ports@freebsd.org, manu@FreeBSD.org, pkubaj@FreeBSD.org
Subject:   Re: graphics/gpu-firmware-kmod and PORTS_MODULES - how to!?
Message-ID:  <PSAPR03MB563989DDA599C4385983791AFADB9@PSAPR03MB5639.apcprd03.prod.outlook.com>
In-Reply-To: <20220528032824.11638f38@rimwks.local>
References:  <20220528032824.11638f38@rimwks.local>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello.

My stable/12 was patched as follows.
And PORTS_MODULES is
PORTS_MODULES=\
	graphics/drm-fbsd12.0-kmod\
	graphics/gpu-firmware-radeon-kmod@caicos\
	graphics/gpu-firmware-radeon-kmod@btc\
	graphics/gpu-firmware-radeon-kmod@sumo

Regards.

diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk
index cce9fcfd1c6..f6217d38bb8 100644
--- a/sys/conf/kern.post.mk
+++ b/sys/conf/kern.post.mk
@@ -95,7 +95,12 @@ PORTSMODULESENV=\
 all:
 .for __i in ${PORTS_MODULES}
 	@${ECHO} "===> Ports module ${__i} (all)"
-	cd $${PORTSDIR:-/usr/ports}/${__i}; ${PORTSMODULESENV} ${MAKE} -B clean build
+	__i="${__i}" ;\
+	if [ "$${__i%@*}" = "$${__i}" ] ; then\
+	cd $${PORTSDIR:-/usr/ports}/$${__i}; ${PORTSMODULESENV} ${MAKE} -B clean build ;\
+	else\
+	cd $${PORTSDIR:-/usr/ports}/$${__i%@*}; ${PORTSMODULESENV} ${MAKE} -B "FLAVOR=$${__i##*@}" clean build ;\
+	fi
 .endfor

 .for __target in install reinstall clean
@@ -103,7 +108,12 @@ ${__target}: ports-${__target}
 ports-${__target}:
 .for __i in ${PORTS_MODULES}
 	@${ECHO} "===> Ports module ${__i} (${__target})"
-	cd $${PORTSDIR:-/usr/ports}/${__i}; ${PORTSMODULESENV} ${MAKE} -B ${__target:C/(re)?install/deinstall reinstall/}
+	__i="${__i}" ;\
+	if [ "$${__i%@*}" = "$${__i}" ] ; then\
+	cd $${PORTSDIR:-/usr/ports}/$${__i}; ${PORTSMODULESENV} ${MAKE} -B ${__target:C/(re)?install/deinstall reinstall/} ;\
+	else\
+	cd $${PORTSDIR:-/usr/ports}/$${__i%@*}; ${PORTSMODULESENV} ${MAKE} -B "FLAVOR=$${__i##*@}" ${__target:C/(re)?install/deinstall reinstall/} ;\
+	fi
 .endfor
 .endfor
 .endif




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?PSAPR03MB563989DDA599C4385983791AFADB9>