Hi,
Emergent fix below.
On 4/26/18 4:17 AM, [email protected] wrote:
Hi,
On 4/23/18 10:32 PM, [email protected] wrote:
Hi Stuart,
On 4/23/18 10:48 AM, Stuart Henderson wrote:
On 2018/04/22 15:54, [email protected] wrote:
On 4/22/18 4:39 AM, [email protected] wrote:
On 4/15/18 1:25 PM, [email protected] wrote:
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.
It seems that there is another problem with the setup.py of python
binding that relies on existence of environment variable CXX to be
defined, otherwise it will use "cc" instead of "c++" to build the
binding, which then lead to another problem: the main library would be
built using C++14 that enabled using std::chrono, while the bindings
would not and used boost::chrono instead, and the bindings will
fail to
load due to missing symbols (actually symbol mismatch). The fix is to
define CXX=c++ in Makefile.am of python binding.
The revised patch against -rOPENBSD_6_3 is attached.
And it turns out it's a bad idea to patch configure.ac and
Makefile.am which
will require "autoreconf". Attaching the patch dropping those parts.
1.1.7
on -current has similar issue and I'll provide a separate patch and
also try
to incorporate upstream.
No loongson here so I can't test any of this, but a few things:
- we work on -current primarily, sometimes things can be backported
but if
this is broken on -current at the moment, that needs fixing first
Agreed.
- compilers should come from the environment rather than hardcoded,
maybe
try something like:
MAKE_ENV = CC="${CC}" CXX="${CXX}"
CXXFLAGS += --std=gnu++14
I'm currently working with upstream to incorporate those patches as
well. Once the patches are incorporated I'll backport them to -current
and then -stable.
This is the corresponding patch for -stable similar to the one against
-current in my other mail[1].
[1] https://marc.info/?l=openbsd-ports&m=152474002010011&w=2
Sorry my previous patch was missing a line. This revised patch should
work and attached.
diff -Naur Makefile Makefile
--- Makefile Wed Feb 7 22:30:34 2018
+++ Makefile Thu Apr 26 03:58:27 2018
@@ -3,6 +3,7 @@
COMMENT = C++ library implementing a BitTorrent client
MODPY_EGG_VERSION = 1.1.6
+REVISION = 0
DISTNAME = libtorrent-rasterbar-${MODPY_EGG_VERSION}
SHARED_LIBS += torrent-rasterbar 0.0 # 9.0.0
@@ -36,7 +37,9 @@
--with-libiconv
CONFIGURE_ENV += CPPFLAGS="-Wno-deprecated-declarations \
-Wno-macro-redefined \
- -pthread"
+ -pthread" \
+ PYTHON_CXXFLAGS="${PYTHON_CXXFLAGS} -std=gnu++14"
+MAKE_ENV = CC=${CC} CXX=${CXX}
+CXXFLAGS += -std=gnu++14
.ifdef DEBUG
CONFIGURE_ARGS += --enable-debug
diff -Naur patches/patch-include_libtorrent_aux__session_interface_hpp
patches/patch-include_libtorrent_aux__session_interface_hpp
--- patches/patch-include_libtorrent_aux__session_interface_hpp Wed Dec 31
16:00:00 1969
+++ patches/patch-include_libtorrent_aux__session_interface_hpp Thu Apr 26
03:56:01 2018
@@ -0,0 +1,14 @@
+$OpenBSD$
+https://github.com/arvidn/libtorrent/pull/2965
+
+--- include/libtorrent/aux_/session_interface.hpp.orig
++++ include/libtorrent/aux_/session_interface.hpp
+@@ -52,6 +52,7 @@ POSSIBILITY OF SUCH DAMAGE.
+
+ #ifndef TORRENT_DISABLE_LOGGING
+ #include <boost/shared_ptr.hpp>
++#include <cstdarg> // for va_list
+ #endif
+
+ #ifdef TORRENT_USE_OPENSSL
+
diff -Naur patches/patch-src_disk_io_thread_cpp
patches/patch-src_disk_io_thread_cpp
--- patches/patch-src_disk_io_thread_cpp Wed Dec 31 16:00:00 1969
+++ patches/patch-src_disk_io_thread_cpp Thu Apr 26 03:56:01 2018
@@ -0,0 +1,13 @@
+$OpenBSD$
+https://github.com/arvidn/libtorrent/pull/2965
+
+--- src/disk_io_thread.cpp.orig
++++ src/disk_io_thread.cpp
+@@ -62,6 +62,7 @@ POSSIBILITY OF SUCH DAMAGE.
+ #if __cplusplus >= 201103L || defined __clang__
+
+ #if DEBUG_DISK_THREAD
++#include <cstdarg> // for va_list
+ #define DLOG(...) debug_log(__VA_ARGS__)
+ #else
+ #define DLOG(...) do {} while(false)
diff -Naur patches/patch-src_kademlia_dht_tracker_cpp
patches/patch-src_kademlia_dht_tracker_cpp
--- patches/patch-src_kademlia_dht_tracker_cpp Wed Dec 31 16:00:00 1969
+++ patches/patch-src_kademlia_dht_tracker_cpp Thu Apr 26 03:56:01 2018
@@ -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
diff -Naur patches/patch-src_session_impl_cpp patches/patch-src_session_impl_cpp
--- patches/patch-src_session_impl_cpp Wed Dec 31 16:00:00 1969
+++ patches/patch-src_session_impl_cpp Thu Apr 26 03:56:01 2018
@@ -0,0 +1,14 @@
+$OpenBSD$
+https://github.com/arvidn/libtorrent/pull/2965
+
+--- src/session_impl.cpp.orig
++++ src/session_impl.cpp
+@@ -107,6 +107,8 @@ POSSIBILITY OF SUCH DAMAGE.
+ // 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>