From 79c7177170294820147192115467f70d2b55e1f1 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Thu, 21 Sep 2017 21:24:13 +0000 Subject: [PATCH] security/botan110: make ECC mandatory Boost >= 1.65 no longer provides TR1. However, libc++ leaks enough C++11 features that it can be emulated in C++98 mode. PR: 220760 Approved by: ??? --- security/botan110/Makefile | 23 +++++----------- .../botan110/files/patch-src_ssl_tls__record.h | 31 ++++++++++++++++++++++ 2 files changed, 37 insertions(+), 17 deletions(-) create mode 100644 security/botan110/files/patch-src_ssl_tls__record.h diff --git a/security/botan110/Makefile b/security/botan110/Makefile index 71667c4f8634..45950e94e115 100644 --- a/security/botan110/Makefile +++ b/security/botan110/Makefile @@ -3,7 +3,7 @@ PORTNAME= botan PORTVERSION= 1.10.13 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= security MASTER_SITES= http://botan.randombit.net/releases/ PKGNAMESUFFIX= 110 @@ -15,14 +15,14 @@ COMMENT= Portable, easy to use, and efficient C++ crypto library LICENSE= BSD2CLAUSE LICENSE_FILE= ${WRKSRC}/doc/license.txt -OPTIONS_DEFINE= SSL GMP ECC DOCS -OPTIONS_DEFAULT= SSL GMP ECC -ECC_DESC= ECC support +OPTIONS_DEFINE= SSL GMP DOCS +OPTIONS_DEFAULT= SSL GMP USES= compiler gmake python:build tar:tgz HAS_CONFIGURE= yes CONFIGURE_SCRIPT= configure.py -CONFIGURE_ARGS= --prefix=${PREFIX} --with-bzip2 --with-zlib +CONFIGURE_ARGS= --prefix=${PREFIX} --cc ${CHOSEN_COMPILER_TYPE} \ + --with-tr1-implementation=system --with-bzip2 --with-zlib MAKE_ARGS= CXX="${CXX}" LIB_OPT="${CXXFLAGS}" USE_LDCONFIG= yes PLIST_FILES= bin/botan-config-1.10 lib/libbotan-1.10.a lib/libbotan-1.10.so lib/libbotan-1.10.so.1 \ @@ -41,23 +41,13 @@ CONFIGURE_ARGS+=--with-openssl .endif .if ${PORT_OPTIONS:MGMP} +USES+= localbase:ldflags LIB_DEPENDS+= libgmp.so:math/gmp CONFIGURE_ARGS+=--with-gnump -MAKE_ARGS+= LDFLAGS="-L${LOCALBASE}/lib" -.endif - -.if ${PORT_OPTIONS:MECC} -BUILD_DEPENDS+= ${LOCALBASE}/include/boost/tr1/memory.hpp:devel/boost-libs -CONFIGURE_ARGS+=--with-tr1-implementation=boost -CXXFLAGS+= -I${LOCALBASE}/include -.else -CONFIGURE_ARGS+=--with-tr1-implementation=none .endif .include -CONFIGURE_ARGS+=--cc ${COMPILER_TYPE} - post-patch: ${REINPLACE_CMD} -e "s|#!/usr/bin/env python|#!${PYTHON_CMD}|" \ ${WRKSRC}/configure.py diff --git a/security/botan110/files/patch-src_ssl_tls__record.h b/security/botan110/files/patch-src_ssl_tls__record.h new file mode 100644 index 000000000000..6ce8e9bbdaa1 --- /dev/null +++ b/security/botan110/files/patch-src_ssl_tls__record.h @@ -0,0 +1,31 @@ +--- src/ssl/tls_record.h.orig 2016-04-28 13:27:08 UTC ++++ src/ssl/tls_record.h +@@ -17,8 +17,15 @@ + + #if defined(BOTAN_USE_STD_TR1) + +-#if defined(BOTAN_BUILD_COMPILER_IS_MSVC) ++#if defined(_LIBCPP_VERSION) || defined(BOTAN_BUILD_COMPILER_IS_MSVC) + #include ++ #if defined(_LIBCPP_VERSION) ++ namespace std { ++ namespace tr1 { ++ using std::function; ++ } ++ } ++ #endif + #else + #include + #endif +@@ -31,7 +38,11 @@ + + namespace Botan { + ++#if defined(_LIBCPP_VERSION) ++using namespace std::placeholders; ++#else + using namespace std::tr1::placeholders; ++#endif + + /** + * TLS Record Writer