git: 9ddbf1f6fcac - main - www/foreign-cdm: Support both rl9 and c7

From: Gleb Popov <arrowd_at_FreeBSD.org>
Date: Wed, 05 Mar 2025 15:15:05 UTC
The branch main has been updated by arrowd:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9ddbf1f6fcac4aa161cb7b85f49128e160a46468

commit 9ddbf1f6fcac4aa161cb7b85f49128e160a46468
Author:     Thibault Payet <monwarez@mailoo.org>
AuthorDate: 2025-03-05 15:13:50 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2025-03-05 15:14:57 +0000

    www/foreign-cdm: Support both rl9 and c7
    
    PR:             285163
    Co-authored-by: Gleb Popov <arrowd@FreeBSD.org>
---
 www/foreign-cdm/Makefile | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/www/foreign-cdm/Makefile b/www/foreign-cdm/Makefile
index 86f7c3b785ed..31509b524b10 100644
--- a/www/foreign-cdm/Makefile
+++ b/www/foreign-cdm/Makefile
@@ -13,17 +13,19 @@ LICENSE=	MIT
 
 ONLY_FOR_ARCHS=	amd64
 
-BUILD_DEPENDS=	cmake:devel/cmake-core \
-		linux-c7-devtoolset>0:devel/linux-c7-devtoolset
-RUN_DEPENDS=	linux_base-c7>0:emulators/linux_base-c7
+BUILD_DEPENDS=	cmake:devel/cmake-core
+
+USES=		linux
 
 USE_GITHUB=	yes
+USE_LDCONFIG=	yes
+USE_LINUX=	base:build,run devtools:build
+
 GH_ACCOUNT=	shkhln
 GH_PROJECT=	foreign-cdm
 GH_TUPLE=	capnproto:capnproto:928c8390d4d562bd32dc79a42eb64e9bdba572d8:capnproto/third_party/capnproto
 
-MAKE_ENV=	LINUX_CC=/compat/linux/opt/rh/devtoolset-11/root/usr/bin/g++ \
-		MAKE_JOBS_NUMBER=${MAKE_JOBS_NUMBER}
+MAKE_ENV=	MAKE_JOBS_NUMBER=${MAKE_JOBS_NUMBER}
 
 SUB_FILES=	fcdm-setup-env
 
@@ -36,6 +38,15 @@ PLIST_FILES=	libexec/fcdm-jail \
 
 CDM_INT_HASH=	06395a2863cb1ebdb47617a995b73f95c14fe120
 
+.include <bsd.port.pre.mk>
+
+.if ${LINUX_DEFAULT} == c7
+BUILD_DEPENDS+=	linux-c7-devtoolset>0:devel/linux-c7-devtoolset
+MAKE_ENV+=	LINUX_CC=/compat/linux/opt/rh/devtoolset-11/root/usr/bin/g++
+.else
+MAKE_ENV+=	LINUX_CC=/compat/linux/usr/bin/x86_64-redhat-linux-g++
+.endif
+
 post-extract:
 	${MV} ${WRKDIR}/*.h ${WRKSRC}/third_party/cdm/
 
@@ -58,4 +69,4 @@ do-install:
 	${LN} -s ${PREFIX}/lib/foreign-cdm/fcdm-fbsd.so ${STAGEDIR}${PREFIX}/share/chromium/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so
 	${LN} -s ${PREFIX}/lib/WidevineCdm/manifest.json ${STAGEDIR}${PREFIX}/share/chromium/WidevineCdm/manifest.json
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>