Re: security/botan without boost

2017-12-13 Thread Alexander Bluhm
On Wed, Dec 13, 2017 at 10:42:25PM +0100, Rafael Sadowski wrote:
> Hi bluhm@, Hi ports@,
> 
> the upcoming boost removed T1 library support. Before we update our boost
> I would like to commit the diff below.
> 
> I have changed the following:
> 
> 1.) Add COMPILER and drop ONLY_FOR_ARCHS
> 2.) Add -std=c++11 (clang also needs -Wno-c++11-narrowing to build successful)
> 3.) Drop boost as bdep and change tr1-implementation to system.
> 4.) fake function in namespace std::tr1:: and use std::placeholders.
> 
> Build correctly with base-clang and ports-gcc. All tests passed with
> both compilers.
> 
> Ok? Comments?

OK bluhm@

> +COMPILER= base-clang ports-gcc

you need a space before = and a tab after =



security/botan without boost

2017-12-13 Thread Rafael Sadowski
Hi bluhm@, Hi ports@,

the upcoming boost removed T1 library support. Before we update our boost
I would like to commit the diff below.

I have changed the following:

1.) Add COMPILER and drop ONLY_FOR_ARCHS
2.) Add -std=c++11 (clang also needs -Wno-c++11-narrowing to build successful)
3.) Drop boost as bdep and change tr1-implementation to system.
4.) fake function in namespace std::tr1:: and use std::placeholders.

Build correctly with base-clang and ports-gcc. All tests passed with
both compilers.

Ok? Comments?

Best regards,

Rafael Sadowski

Index: Makefile
===
RCS file: /cvs/ports/security/botan/Makefile,v
retrieving revision 1.27
diff -u -p -u -p -r1.27 Makefile
--- Makefile9 Oct 2017 20:06:26 -   1.27
+++ Makefile13 Dec 2017 21:28:54 -
@@ -1,13 +1,12 @@
 # $OpenBSD: Makefile,v 1.27 2017/10/09 20:06:26 bluhm Exp $
 
-ONLY_FOR_ARCHS =   ${GCC4_ARCHS} ${CLANG_ARCHS}
-
 COMMENT =  portable, easy to use, and efficient C++ crypto library
 
 PORTROACH =limit:^1\.10\.
 VERSION =  1.10.17
 DISTNAME = Botan-${VERSION}
 PKGNAME =  botan-${VERSION}
+REVISION = 0
 
 SHARED_LIBS =  botan-1.10  1.1
 
@@ -22,6 +21,8 @@ PERMIT_PACKAGE_CDROM =Yes
 
 WANTLIB =  bz2 crypto gmp m pthread ${COMPILER_LIBCXX} z
 
+COMPILER= base-clang ports-gcc
+
 MASTER_SITES = ${HOMEPAGE}releases/
 
 SUPDISTFILES = ${DISTFILES}.asc
@@ -31,9 +32,8 @@ MODULES = lang/python
 MODPY_RUNDEP = No
 LIB_DEPENDS =  archivers/bzip2 \
devel/gmp
-BUILD_DEPENDS =devel/boost
 
-CXXFLAGS +=-I${LOCALBASE}/include
+CXXFLAGS +=-std=c++11 -Wno-c++11-narrowing -I${LOCALBASE}/include
 MAKE_FLAGS =   CXX="${CXX}" LIB_OPT="${CXXFLAGS} -finline-functions" \
CHECK_OPT="${CXXFLAGS}" LDFLAGS="-L${LOCALBASE}/lib" \
LIBbotan_VERSION=${LIBbotan-1.10_VERSION}
@@ -46,7 +46,7 @@ CONFIGURE_ARGS =  --cpu=${MACHINE_ARCH} \
--with-bzip2 \
--with-gnump \
--with-openssl \
-   --with-tr1-implementation=boost \
+   --with-tr1-implementation=system \
--with-zlib \
--without-sphinx
 
Index: patches/patch-src_ssl_tls_record_h
===
RCS file: patches/patch-src_ssl_tls_record_h
diff -N patches/patch-src_ssl_tls_record_h
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-src_ssl_tls_record_h  13 Dec 2017 21:28:54 -
@@ -0,0 +1,33 @@
+$OpenBSD$
+
+Index: src/ssl/tls_record.h
+--- src/ssl/tls_record.h.orig
 src/ssl/tls_record.h
+@@ -17,8 +17,13 @@
+ 
+ #if defined(BOTAN_USE_STD_TR1)
+ 
+-#if defined(BOTAN_BUILD_COMPILER_IS_MSVC)
++#if defined(BOTAN_BUILD_COMPILER_IS_MSVC) || 
(defined(BOTAN_BUILD_COMPILER_IS_CLANG) || defined(BOTAN_BUILD_COMPILER_IS_GCC))
+ #include 
++namespace std {
++namespace tr1 {
++using std::function;
++}
++}
+ #else
+ #include 
+ #endif
+@@ -31,7 +36,11 @@
+ 
+ namespace Botan {
+ 
+-using namespace std::tr1::placeholders;
++#if (defined(BOTAN_BUILD_COMPILER_IS_CLANG) || 
defined(BOTAN_BUILD_COMPILER_IS_GCC))
++using namespace std::placeholders;
++#else
++using namespace std::tr1::placeholders;
++#endif
+ 
+ /**
+ * TLS Record Writer