git: 39f7031c79eb - main - emulators/virtualbox-ose-legacy: Fix build on head

From: Guido Falsi <madpilot_at_FreeBSD.org>
Date: Wed, 09 Feb 2022 14:25:08 UTC
The branch main has been updated by madpilot:

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

commit 39f7031c79eb0da62240461fe830b9df08545f55
Author:     Guido Falsi <madpilot@FreeBSD.org>
AuthorDate: 2022-02-09 14:20:54 +0000
Commit:     Guido Falsi <madpilot@FreeBSD.org>
CommitDate: 2022-02-09 14:20:54 +0000

    emulators/virtualbox-ose-legacy: Fix build on head
    
    The legacy version of virtualbox fails to build on head with
    clang > 11, so force using clang 11 there.
    
    PR:             254616 (suggested in)
---
 emulators/virtualbox-ose-legacy/Makefile | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/emulators/virtualbox-ose-legacy/Makefile b/emulators/virtualbox-ose-legacy/Makefile
index 7d0e5812f01a..9276da479d50 100644
--- a/emulators/virtualbox-ose-legacy/Makefile
+++ b/emulators/virtualbox-ose-legacy/Makefile
@@ -206,6 +206,16 @@ KMK_FLAGS+=	-j${MAKE_JOBS_NUMBER}
 
 .include <bsd.port.pre.mk>
 
+.if ${CHOSEN_COMPILER_TYPE} == clang && ${OPSYS} == FreeBSD && ${OSVERSION} > 1400022
+# clang > 11 included in FreeBSD 14 fails to compile this legacy version
+# of virtualbox-ose, force clang 11 on FreeBSD 14 where a newer clang is
+# included.
+BUILD_DEPENDS+=	clang${VBOX_LLVM_VER}:devel/llvm${VBOX_LLVM_VER}
+CC=		clang${VBOX_LLVM_VER}
+CXX=		clang++${VBOX_LLVM_VER}
+VBOX_LLVM_VER?=	11
+.endif
+
 .if ${PYTHON_MAJOR_VER} >= 3
 PLIST_SUB+=	PYTHON_PYCDIR=/__pycache__/ \
 		PYTHON_PYCEXT=.cpython-${PYTHON_SUFFIX}.pyc