git: caec8824b82d - main - databases/xrootd: Fix build with openssl3

From: Muhammad Moinur Rahman <bofh_at_FreeBSD.org>
Date: Sun, 23 Jul 2023 22:16:23 UTC
The branch main has been updated by bofh:

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

commit caec8824b82d754312ae4b122a352e7a830530bb
Author:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2023-07-23 20:11:53 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2023-07-23 22:16:14 +0000

    databases/xrootd: Fix build with openssl3
    
    Approved by:    portmgr (blanket)
    Sponsored by:   The FreeBSD Foundation
---
 databases/xrootd/Makefile | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/databases/xrootd/Makefile b/databases/xrootd/Makefile
index cc2e9c8ba008..e4e1f1d8376f 100644
--- a/databases/xrootd/Makefile
+++ b/databases/xrootd/Makefile
@@ -17,8 +17,6 @@ BUILD_DEPENDS=	bash:shells/bash
 LIB_DEPENDS=	libcurl.so:ftp/curl
 
 USES=		cmake cpe gnome localbase:ldflags pkgconfig readline shebangfix ssl
-BROKEN_SSL=	openssl30 openssl31
-BROKEN_SSL_REASON=	Fails to build with OpenSSL 3.0.0 and later
 SHEBANG_GLOB=	*.sh
 SHEBANG_FILES=	utils/cms_monPerf
 USE_GNOME=	libxml2
@@ -40,7 +38,13 @@ KERBEROS5_CMAKE_BOOL=	ENABLE_KRB5
 KERBEROS5_BROKEN=	build picks base kerberos, but needs the port one (problem only exists in poudriere builds for some reason)
 KERBEROS5_LIB_DEPENDS=	libkrb5.so:security/krb5
 
+.include <bsd.port.pre.mk>
+
+.if ( ${OPSYS} == FreeBSD && ${OSVERSION} >= 1400092 && ${SSL_DEFAULT} == base ) || ${SSL_DEFAULT:Mopenssl3*}
+CXXFLAGS+=	-DOPENSSL_API_COMPAT=0x30000000L"
+.endif
+
 post-patch:
 	@${REINPLACE_CMD} 's|  dl|  $${CMAKE_DL_LIBS}| ; s|-ldl|$${CMAKE_DL_LIBS}|' ${WRKSRC}/src/*.cmake ${WRKSRC}/src/*/CMakeLists.txt
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>