git: 1d9be2809284 - main - virtualbox*-kmod: fix cross building

From: Baptiste Daroussin <bapt_at_FreeBSD.org>
Date: Tue, 13 May 2025 13:07:57 UTC
The branch main has been updated by bapt:

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

commit 1d9be28092845e6ecea85a37a30770fc5895deba
Author:     Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2025-05-13 13:05:46 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2025-05-13 13:05:46 +0000

    virtualbox*-kmod: fix cross building
    
    Apply the same fix as 8b659812a21508795778a345dbbf7d08b7fcbb38 to allow
    cross buidling and make it appear in kmods repositories
---
 emulators/virtualbox-ose-kmod-70/Makefile     | 2 +-
 emulators/virtualbox-ose-kmod-legacy/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/emulators/virtualbox-ose-kmod-70/Makefile b/emulators/virtualbox-ose-kmod-70/Makefile
index 4ad6ad62ca85..411534590df1 100644
--- a/emulators/virtualbox-ose-kmod-70/Makefile
+++ b/emulators/virtualbox-ose-kmod-70/Makefile
@@ -90,7 +90,7 @@ post-patch:
 .if ${PORT_OPTIONS:MVIMAGE}
 	@${ECHO_CMD} 'VBOX_WITH_NETFLT_VIMAGE = 1' >> ${WRKSRC}/LocalConfig.kmk
 .endif
-	@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \
+	@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g; s|which \$$\*|which \$$1|g' \
 	    ${WRKSRC}/Config.kmk ${WRKSRC}/configure
 	@${REINPLACE_CMD} \
 	    -e 's|\$$KBUILDDIR_BIN/kmk_sed|${LOCALBASE}/bin/kmk_sed|g' \
diff --git a/emulators/virtualbox-ose-kmod-legacy/Makefile b/emulators/virtualbox-ose-kmod-legacy/Makefile
index c3770f902d8e..424fd42ee14f 100644
--- a/emulators/virtualbox-ose-kmod-legacy/Makefile
+++ b/emulators/virtualbox-ose-kmod-legacy/Makefile
@@ -99,7 +99,7 @@ post-patch:
 .if ${PORT_OPTIONS:MPAE}
 	@${ECHO_CMD} 'VBOX_FREEBSD = -DPAE' >> ${WRKSRC}/LocalConfig.kmk
 .endif
-	@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \
+	@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g; s|which \$$\*|which \$$1|g' \
 	    ${WRKSRC}/Config.kmk ${WRKSRC}/configure
 	@${REINPLACE_CMD} \
 	    -e 's|\$$KBUILDDIR_BIN/kmk_sed|${LOCALBASE}/bin/kmk_sed|g' \