The patch attached fixes building libtorrent-rasterbar on
OpenBSD/Loongson for -rOPENBSD_6_3. It added several missing includes,
added "-std=gnu++14" to CXXFLAGS as it is now default for newer compiler
and the code uses those new features, and another patch from -current.
I'm not sure whether this is the correct way to update ports for a
-stable branch so let me know.
Thanks.
Index: Makefile
===================================================================
RCS file: /cvs/ports/net/libtorrent-rasterbar/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- Makefile 8 Feb 2018 06:30:34 -0000 1.1.1.1
+++ Makefile 15 Apr 2018 20:19:13 -0000
@@ -3,6 +3,7 @@
COMMENT = C++ library implementing a BitTorrent client
MODPY_EGG_VERSION = 1.1.6
+REVISION = 1
DISTNAME = libtorrent-rasterbar-${MODPY_EGG_VERSION}
SHARED_LIBS += torrent-rasterbar 0.0 # 9.0.0
Index: patches/patch-configure
===================================================================
RCS file: patches/patch-configure
diff -N patches/patch-configure
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-configure 15 Apr 2018 20:19:13 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- configure.orig Sun Dec 31 06:21:37 2017
++++ configure Sat Apr 14 17:39:19 2018
+@@ -16763,7 +16763,7 @@
+ LIBS="$PTHREAD_LIBS $LIBS"
+ CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
+ CC="$PTHREAD_CC"
+-CXXFLAGS="$CXXFLAGS -ftemplate-depth=120 -Wno-format-zero-length"
++CXXFLAGS="$CXXFLAGS -std=gnu++14 -ftemplate-depth=120 -Wno-format-zero-length"
+
+ $as_echo "Checking for visibility support:"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for
__attribute__((visibility(\"hidden\")))" >&5
Index: patches/patch-include_libtorrent_aux__session_interface_hpp
===================================================================
RCS file: patches/patch-include_libtorrent_aux__session_interface_hpp
diff -N patches/patch-include_libtorrent_aux__session_interface_hpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-include_libtorrent_aux__session_interface_hpp 15 Apr 2018
20:19:13 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- include/libtorrent/aux_/session_interface.hpp.orig Mon Dec 11 14:59:32 2017
++++ include/libtorrent/aux_/session_interface.hpp Sat Apr 14 16:36:02 2018
+@@ -33,6 +33,8 @@
+ #ifndef TORRENT_SESSION_INTERFACE_HPP_INCLUDED
+ #define TORRENT_SESSION_INTERFACE_HPP_INCLUDED
+
++#include <cstdarg> // for va_list
++
+ #include "libtorrent/config.hpp"
+ #include "libtorrent/peer_id.hpp"
+ #include "libtorrent/address.hpp"
Index: patches/patch-src_disk_io_thread_cpp
===================================================================
RCS file: patches/patch-src_disk_io_thread_cpp
diff -N patches/patch-src_disk_io_thread_cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_disk_io_thread_cpp 15 Apr 2018 20:19:13 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- src/disk_io_thread.cpp.orig Mon Dec 11 14:59:32 2017
++++ src/disk_io_thread.cpp Sat Apr 14 16:44:04 2018
+@@ -57,6 +57,8 @@
+
+ #include "libtorrent/debug.hpp"
+
++#include <cstdarg> // for va_list
++
+ #define DEBUG_DISK_THREAD 0
+
+ #if __cplusplus >= 201103L || defined __clang__
Index: patches/patch-src_kademlia_dht_tracker_cpp
===================================================================
RCS file: patches/patch-src_kademlia_dht_tracker_cpp
diff -N patches/patch-src_kademlia_dht_tracker_cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_kademlia_dht_tracker_cpp 15 Apr 2018 20:19:13 -0000
@@ -0,0 +1,18 @@
+$OpenBSD: patch-src_kademlia_dht_tracker_cpp,v 1.1 2018/04/12 04:40:41 bentley
Exp $
+
+https://github.com/arvidn/libtorrent/pull/2931
+
+Index: src/kademlia/dht_tracker.cpp
+--- src/kademlia/dht_tracker.cpp.orig
++++ src/kademlia/dht_tracker.cpp
+@@ -224,7 +224,9 @@ namespace libtorrent { namespace dht
+ void dht_tracker::get_peers(sha1_hash const& ih
+ , boost::function<void(std::vector<tcp::endpoint> const&)> f)
+ {
+- m_dht.get_peers(ih, f, NULL, false);
++ m_dht.get_peers(ih, f
++ ,
boost::function<void(std::vector<std::pair<node_entry, std::string> > const&)>()
++ , false);
+ }
+
+ void dht_tracker::announce(sha1_hash const& ih, int listen_port, int
flags
Index: patches/patch-src_session_impl_cpp
===================================================================
RCS file: patches/patch-src_session_impl_cpp
diff -N patches/patch-src_session_impl_cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_session_impl_cpp 15 Apr 2018 20:19:13 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- src/session_impl.cpp.orig Thu Dec 28 07:54:12 2017
++++ src/session_impl.cpp Sat Apr 14 16:44:23 2018
+@@ -107,6 +107,8 @@
+ // for logging stat layout
+ #include "libtorrent/stat.hpp"
+
++#include <cstdarg> // for va_list
++
+ // for logging the size of DHT structures
+ #ifndef TORRENT_DISABLE_DHT
+ #include <libtorrent/kademlia/find_data.hpp>