git: 63fe92d7ab52 - main - security/botan3: libc++<16 lacks std::ranges::find, work around
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 29 May 2024 00:32:34 UTC
The branch main has been updated by mandree: URL: https://cgit.FreeBSD.org/ports/commit/?id=63fe92d7ab52f8657300837de6f774b26ed1f7d9 commit 63fe92d7ab52f8657300837de6f774b26ed1f7d9 Author: Matthias Andree <mandree@FreeBSD.org> AuthorDate: 2024-05-19 22:46:54 +0000 Commit: Matthias Andree <mandree@FreeBSD.org> CommitDate: 2024-05-29 00:32:21 +0000 security/botan3: libc++<16 lacks std::ranges::find, work around ...by using boost::range::find, we already depend on boost already. PR: 279173 Approved by: portmgr@ (just-fix-it blanket approval) --- security/botan3/Makefile | 9 +++-- .../files/extrapatch-src_tests_unit__x509.cpp | 38 ++++++++++++++++++++++ 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/security/botan3/Makefile b/security/botan3/Makefile index e79a686ca23f..1fcd76593800 100644 --- a/security/botan3/Makefile +++ b/security/botan3/Makefile @@ -12,9 +12,7 @@ WWW= https://botan.randombit.net/ LICENSE= BSD2CLAUSE LICENSE_FILE= ${WRKSRC}/license.txt -BROKEN_FreeBSD_13= compilation fails: no member named 'find' in namespace 'std::ranges' - -LIB_DEPENDS= libboost_filesystem.so:devel/boost-libs +BUILD_DEPENDS= ${LOCALBASE}/include/boost/asio.hpp:devel/boost-libs USES= compiler:c++20-lang cpe gmake llvm:17 shebangfix tar:xz # llvm:17 fixes build failure, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279136 CPE_VENDOR= ${PORTNAME}_project @@ -86,6 +84,11 @@ PLIST_SUB+= HAS_PROCESSOR_RNG="@comment " #USES+= llvm:max=15,min=14 #.endif +.if ${OPSYS} == FreeBSD && ( ( ${OSVERSION} >= 1400000 && ${OSVERSION} < 1400091 ) || ( ${OSVERSION} < 1302507 ) ) +# libc++ does not carry std::ranges::find, redirect to boost::range::find: +EXTRA_PATCHES+= ${FILESDIR}/extrapatch-src_tests_unit__x509.cpp +.endif + post-patch: @${REINPLACE_CMD} -e 's|^optimization_flags .*|optimization_flags "${CXXFLAGS}"|' \ ${WRKSRC}/src/build-data/cc/clang.txt diff --git a/security/botan3/files/extrapatch-src_tests_unit__x509.cpp b/security/botan3/files/extrapatch-src_tests_unit__x509.cpp new file mode 100644 index 000000000000..dfd4e13e9037 --- /dev/null +++ b/security/botan3/files/extrapatch-src_tests_unit__x509.cpp @@ -0,0 +1,38 @@ +--- src/tests/unit_x509.cpp.orig 2024-02-20 17:28:54 UTC ++++ src/tests/unit_x509.cpp +@@ -18,6 +18,8 @@ + #include <botan/x509path.h> + #include <botan/x509self.h> + #include <botan/internal/calendar.h> ++ ++ #include <boost/range/algorithm.hpp> + #endif + + namespace Botan_Tests { +@@ -627,7 +629,7 @@ Test::Result test_x509_encode_authority_info_access_ex + + for(const auto& ca_issuer : cert.ca_issuers()) { + result.confirm("CA issuer URI present in certificate", +- std::ranges::find(ca_issuers, ca_issuer) != ca_issuers.end()); ++ boost::range::find(ca_issuers, ca_issuer) != ca_issuers.end()); + } + + result.confirm("no OCSP url available", cert.ocsp_responder().empty()); +@@ -1400,7 +1402,7 @@ Test::Result test_x509_extensions(const Botan::Private + !cert_cdps->crl_distribution_urls().empty())) { + for(const auto& cdp : cert_cdps->distribution_points()) { + result.confirm("CDP URI present in self-signed certificate", +- std::ranges::find(cdp_urls, cdp.point().get_first_attribute("URI")) != cdp_urls.end()); ++ boost::range::find(cdp_urls, cdp.point().get_first_attribute("URI")) != cdp_urls.end()); + } + } + +@@ -1436,7 +1438,7 @@ Test::Result test_x509_extensions(const Botan::Private + !cert_cdps->crl_distribution_urls().empty())) { + for(const auto& cdp : cert_cdps->distribution_points()) { + result.confirm("CDP URI present in self-signed certificate", +- std::ranges::find(cdp_urls, cdp.point().get_first_attribute("URI")) != cdp_urls.end()); ++ boost::range::find(cdp_urls, cdp.point().get_first_attribute("URI")) != cdp_urls.end()); + } + } +