Index: Makefile
===================================================================
RCS file: /cvs/ports/net/libtorrent/Makefile,v
retrieving revision 1.57
diff -u -p -u -p -r1.57 Makefile
--- Makefile	11 Jan 2019 18:04:21 -0000	1.57
+++ Makefile	22 Apr 2019 19:07:58 -0000
@@ -10,7 +10,7 @@ NOT_FOR_ARCHS=		${GCC3_ARCHS}
 
 DISTNAME=		libtorrent-0.13.6
 EPOCH=			0
-REVISION=		5
+REVISION=		6
 SHARED_LIBS +=  	torrent 22.1	# .18.0
 CATEGORIES=		net devel
 
@@ -37,14 +37,10 @@ CONFIGURE_ARGS=		--enable-static \
 			--disable-mincore \
 			--disable-debug
 
-.include <bsd.port.arch.mk>
-.if ${PROPERTIES:Mclang}
+CXXFLAGS +=		-std=c++11
+
 # this patches *only* files containing tr1 to no longer refer to tr1
 # we do it pre-patch, because autoconf passes right after us
 pre-patch:
 	find ${WRKDIST} -type f|xargs fgrep -lw tr1|xargs sed -i.bak -e 's,<tr1/,<,' -e 's/std::tr1/std/g'
-CXXFLAGS +=	-std=c++11
-# some patches involve the tr1 stuff
-PATCH_LIST =	patch-* clangpatch-*
-.endif
 .include <bsd.port.mk>
Index: patches/clangpatch-src_torrent_utils_log_cc
===================================================================
RCS file: patches/clangpatch-src_torrent_utils_log_cc
diff -N patches/clangpatch-src_torrent_utils_log_cc
--- patches/clangpatch-src_torrent_utils_log_cc	19 May 2017 12:26:43 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,40 +0,0 @@
-$OpenBSD: clangpatch-src_torrent_utils_log_cc,v 1.1 2017/05/19 12:26:43 espie Exp $
-can't figure out the functional magic, so just do the algorithm by hand.
-
-Index: src/torrent/utils/log.cc
---- src/torrent/utils/log.cc.orig
-+++ src/torrent/utils/log.cc
-@@ -187,17 +187,14 @@ log_group::internal_print(const HashString* hash, cons
-     return;
- 
-   pthread_mutex_lock(&log_mutex);
--  std::for_each(m_first, m_last, std::bind(&log_slot::operator(),
--                                                std::placeholders::_1,
--                                                buffer,
--                                                std::distance(buffer, first),
--                                                std::distance(log_groups.begin(), this)));
-+
-+  for (log_slot *it = m_first; it != m_last; ++it)
-+  	(*it)(buffer, std::distance(buffer, first),
-+		std::distance(log_groups.begin(), this));
-+
-   if (dump_data != NULL)
--    std::for_each(m_first, m_last, std::bind(&log_slot::operator(),
--                                                  std::placeholders::_1,
--                                                  (const char*)dump_data,
--                                                  dump_size,
--                                                  -1));
-+      for (log_slot *it = m_first; it != m_last; ++it)
-+      	(*it)((const char*)dump_data, dump_size, -1);
-   pthread_mutex_unlock(&log_mutex);
- }
- 
-@@ -250,7 +247,7 @@ void
- log_cleanup() {
-   pthread_mutex_lock(&log_mutex);
- 
--  log_groups.assign(log_group());
-+  fill_with_value(log_groups, log_group());
-   log_outputs.clear();
-   log_children.clear();
- 
Index: patches/clangpatch-src_utils_queue_buckets_h
===================================================================
RCS file: patches/clangpatch-src_utils_queue_buckets_h
diff -N patches/clangpatch-src_utils_queue_buckets_h
--- patches/clangpatch-src_utils_queue_buckets_h	19 May 2017 12:26:43 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,15 +0,0 @@
-$OpenBSD: clangpatch-src_utils_queue_buckets_h,v 1.1 2017/05/19 12:26:43 espie Exp $
-proper typing, from FreeBSD
-
-Index: src/utils/queue_buckets.h
---- src/utils/queue_buckets.h.orig
-+++ src/utils/queue_buckets.h
-@@ -251,7 +251,7 @@ queue_buckets<Type, Constants>::destroy(int idx, itera
-   instrumentation_update(constants::instrumentation_total[idx], -difference);
- 
-   // Consider moving these to a temporary dequeue before releasing:
--  std::for_each(begin, end, std::function<void (value_type)>(&constants::template destroy<value_type>));
-+  std::for_each(begin, end, std::function<void (value_type&)>(&constants::template destroy<value_type>));
-   queue_at(idx).erase(begin, end);
- }
- 
Index: patches/patch-src_protocol_extensions_cc
===================================================================
RCS file: /cvs/ports/net/libtorrent/patches/patch-src_protocol_extensions_cc,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 patch-src_protocol_extensions_cc
--- patches/patch-src_protocol_extensions_cc	12 Feb 2018 17:31:35 -0000	1.1
+++ patches/patch-src_protocol_extensions_cc	22 Apr 2019 19:07:58 -0000
@@ -1,3 +1,4 @@
+$OpenBSD$
 # https://github.com/rakshasa/libtorrent/pull/99/files
 
 Index: src/protocol/extensions.cc
Index: patches/patch-src_protocol_handshake_cc
===================================================================
RCS file: /cvs/ports/net/libtorrent/patches/patch-src_protocol_handshake_cc,v
retrieving revision 1.5
diff -u -p -u -p -r1.5 patch-src_protocol_handshake_cc
--- patches/patch-src_protocol_handshake_cc	12 Feb 2018 17:31:35 -0000	1.5
+++ patches/patch-src_protocol_handshake_cc	22 Apr 2019 19:07:58 -0000
@@ -1,3 +1,5 @@
+$OpenBSD$
+
 # https://github.com/rakshasa/libtorrent/pull/99/files
 
 Index: src/protocol/handshake.cc
Index: patches/patch-src_torrent_object_stream_cc
===================================================================
RCS file: /cvs/ports/net/libtorrent/patches/patch-src_torrent_object_stream_cc,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 patch-src_torrent_object_stream_cc
--- patches/patch-src_torrent_object_stream_cc	12 Feb 2018 17:31:35 -0000	1.1
+++ patches/patch-src_torrent_object_stream_cc	22 Apr 2019 19:07:58 -0000
@@ -1,3 +1,5 @@
+$OpenBSD$
+
 # https://github.com/rakshasa/libtorrent/pull/99/files
 
 Index: src/torrent/object_stream.cc
Index: patches/patch-src_torrent_utils_log_cc
===================================================================
RCS file: patches/patch-src_torrent_utils_log_cc
diff -N patches/patch-src_torrent_utils_log_cc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_torrent_utils_log_cc	22 Apr 2019 19:07:58 -0000
@@ -0,0 +1,40 @@
+$OpenBSD$
+can't figure out the functional magic, so just do the algorithm by hand.
+
+Index: src/torrent/utils/log.cc
+--- src/torrent/utils/log.cc.orig
++++ src/torrent/utils/log.cc
+@@ -187,17 +187,14 @@ log_group::internal_print(const HashString* hash, cons
+     return;
+ 
+   pthread_mutex_lock(&log_mutex);
+-  std::for_each(m_first, m_last, std::bind(&log_slot::operator(),
+-                                                std::placeholders::_1,
+-                                                buffer,
+-                                                std::distance(buffer, first),
+-                                                std::distance(log_groups.begin(), this)));
++
++  for (log_slot *it = m_first; it != m_last; ++it)
++  	(*it)(buffer, std::distance(buffer, first),
++		std::distance(log_groups.begin(), this));
++
+   if (dump_data != NULL)
+-    std::for_each(m_first, m_last, std::bind(&log_slot::operator(),
+-                                                  std::placeholders::_1,
+-                                                  (const char*)dump_data,
+-                                                  dump_size,
+-                                                  -1));
++      for (log_slot *it = m_first; it != m_last; ++it)
++      	(*it)((const char*)dump_data, dump_size, -1);
+   pthread_mutex_unlock(&log_mutex);
+ }
+ 
+@@ -250,7 +247,7 @@ void
+ log_cleanup() {
+   pthread_mutex_lock(&log_mutex);
+ 
+-  log_groups.assign(log_group());
++  fill_with_value(log_groups, log_group());
+   log_outputs.clear();
+   log_children.clear();
+ 
Index: patches/patch-src_utils_queue_buckets_h
===================================================================
RCS file: patches/patch-src_utils_queue_buckets_h
diff -N patches/patch-src_utils_queue_buckets_h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_utils_queue_buckets_h	22 Apr 2019 19:07:58 -0000
@@ -0,0 +1,15 @@
+$OpenBSD$
+proper typing, from FreeBSD
+
+Index: src/utils/queue_buckets.h
+--- src/utils/queue_buckets.h.orig
++++ src/utils/queue_buckets.h
+@@ -251,7 +251,7 @@ queue_buckets<Type, Constants>::destroy(int idx, itera
+   instrumentation_update(constants::instrumentation_total[idx], -difference);
+ 
+   // Consider moving these to a temporary dequeue before releasing:
+-  std::for_each(begin, end, std::function<void (value_type)>(&constants::template destroy<value_type>));
++  std::for_each(begin, end, std::function<void (value_type&)>(&constants::template destroy<value_type>));
+   queue_at(idx).erase(begin, end);
+ }
+ 
