summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authoradam <adam@pkgsrc.org>2018-06-24 16:57:58 +0000
committeradam <adam@pkgsrc.org>2018-06-24 16:57:58 +0000
commitcb412d887e03f39152cc351d54b119097e99b2f7 (patch)
tree519537e54d4d177f902e6aa76bce4caa17847efa /net
parentd5d08136056f3c2ecd1857a7229d9e2c8db22b10 (diff)
downloadpkgsrc-cb412d887e03f39152cc351d54b119097e99b2f7.tar.gz
libtorrent: updated to 0.13.7
0.13.7: If you want news, watch CNN or something.
Diffstat (limited to 'net')
-rw-r--r--net/libtorrent/Makefile9
-rw-r--r--net/libtorrent/PLIST5
-rw-r--r--net/libtorrent/distinfo15
-rw-r--r--net/libtorrent/patches/patch-config.h.in17
-rw-r--r--net/libtorrent/patches/patch-configure106
-rw-r--r--net/libtorrent/patches/patch-src_torrent_poll__kqueue.cc52
-rw-r--r--net/libtorrent/patches/patch-src_utils_diffie__hellman.cc57
7 files changed, 244 insertions, 17 deletions
diff --git a/net/libtorrent/Makefile b/net/libtorrent/Makefile
index 43f061e6bce..dfb9e1530a4 100644
--- a/net/libtorrent/Makefile
+++ b/net/libtorrent/Makefile
@@ -1,12 +1,11 @@
-# $NetBSD: Makefile,v 1.58 2017/12/26 23:14:42 he Exp $
+# $NetBSD: Makefile,v 1.59 2018/06/24 16:57:58 adam Exp $
-DISTNAME= libtorrent-0.13.6
-PKGREVISION= 2
+DISTNAME= libtorrent-0.13.7
CATEGORIES= net
MASTER_SITES= http://rtorrent.net/downloads/
MAINTAINER= pkgsrc-users@NetBSD.org
-HOMEPAGE= http://rakshasa.github.io/rtorrent/
+HOMEPAGE= https://github.com/rakshasa/libtorrent
COMMENT= BitTorrent library written in C++ for *nix
LICENSE= gnu-gpl-v2
@@ -29,7 +28,7 @@ GCC_REQD+= 4.2.1
# configure check is fooled by trap & emulate of unaligned access on alpha
.if (${MACHINE_ARCH} == "alpha")
-CONFIGURE_ARGS+= --enable-aligned
+CONFIGURE_ARGS+= --enable-aligned
.endif
.if !empty(OPSYS:M*BSD) || ${OPSYS} == "DragonFly" || ${OPSYS} == "Darwin"
diff --git a/net/libtorrent/PLIST b/net/libtorrent/PLIST
index b6711311b40..245f79eefc9 100644
--- a/net/libtorrent/PLIST
+++ b/net/libtorrent/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.12 2014/06/15 22:44:15 tron Exp $
+@comment $NetBSD: PLIST,v 1.13 2018/06/24 16:57:58 adam Exp $
include/torrent/bitfield.h
include/torrent/chunk_manager.h
include/torrent/common.h
@@ -28,6 +28,7 @@ include/torrent/event.h
include/torrent/exceptions.h
include/torrent/hash_string.h
include/torrent/http.h
+include/torrent/net/socket_address_key.h
include/torrent/object.h
include/torrent/object_raw_bencode.h
include/torrent/object_static_map.h
@@ -50,6 +51,7 @@ include/torrent/torrent.h
include/torrent/tracker.h
include/torrent/tracker_controller.h
include/torrent/tracker_list.h
+include/torrent/utils/directory_events.h
include/torrent/utils/extents.h
include/torrent/utils/log.h
include/torrent/utils/log_buffer.h
@@ -60,5 +62,6 @@ include/torrent/utils/resume.h
include/torrent/utils/signal_bitfield.h
include/torrent/utils/thread_base.h
include/torrent/utils/thread_interrupt.h
+include/torrent/utils/uri_parser.h
lib/libtorrent.la
lib/pkgconfig/libtorrent.pc
diff --git a/net/libtorrent/distinfo b/net/libtorrent/distinfo
index 4389dab0d28..2c01db8a2e8 100644
--- a/net/libtorrent/distinfo
+++ b/net/libtorrent/distinfo
@@ -1,10 +1,13 @@
-$NetBSD: distinfo,v 1.37 2017/12/26 23:14:42 he Exp $
+$NetBSD: distinfo,v 1.38 2018/06/24 16:57:58 adam Exp $
-SHA1 (libtorrent-0.13.6.tar.gz) = 493691929b701f4402f13c725840addf95231ad2
-RMD160 (libtorrent-0.13.6.tar.gz) = a143a0ef9e86cf989c2c7dff6c86a41d23ddc244
-SHA512 (libtorrent-0.13.6.tar.gz) = b8aea4060357a8a40d15d42f1f698ef6f3ebdc885000bfbfa5bf9c81af8c88b5503a107e05c214e3e8489126928d336356c5e7e0eaf836b6b84a3cf74633b050
-Size (libtorrent-0.13.6.tar.gz) = 781253 bytes
+SHA1 (libtorrent-0.13.7.tar.gz) = 2c859b5b382786646ba6001058faa07db67c5a48
+RMD160 (libtorrent-0.13.7.tar.gz) = 071f6311fd32e53447bdf7f6d97bc7585dbaff70
+SHA512 (libtorrent-0.13.7.tar.gz) = 7bf3e87dbd19eb4e6806dff8a01c3ec61ea960bbd809d4bcbee96a46e169f97d0baf0fc85ab4a1efbbab07850e9b1060bae46c453ea6c42f5c23f8d921295efb
+Size (libtorrent-0.13.7.tar.gz) = 782854 bytes
+SHA1 (patch-config.h.in) = 7ea6ef87727756afe3882aad769a48488fc22c86
+SHA1 (patch-configure) = 6c91606fc317d2d77c5b34d2b47d22a66a2f22c3
SHA1 (patch-src_Makefile.am) = d965bdfd967a71d14ebcad6b32564a1c0908739d
SHA1 (patch-src_Makefile.in) = 05f55223073fb57cc11fbb307708ba262899d85f
SHA1 (patch-src_data_chunk__list.cpp) = 92a5f36d7ae993667123051b39e6033c73169f4e
-SHA1 (patch-src_torrent_poll__kqueue.cc) = b6158ea858f4a12db8c763ac77eb09d62c65f804
+SHA1 (patch-src_torrent_poll__kqueue.cc) = 1f98ec93dcaaa587351de9b239712504aef6374b
+SHA1 (patch-src_utils_diffie__hellman.cc) = 65c7e6e305d23504b6c0d07d9e78b8483676d8ee
diff --git a/net/libtorrent/patches/patch-config.h.in b/net/libtorrent/patches/patch-config.h.in
new file mode 100644
index 00000000000..be7c9ec25f1
--- /dev/null
+++ b/net/libtorrent/patches/patch-config.h.in
@@ -0,0 +1,17 @@
+$NetBSD: patch-config.h.in,v 1.1 2018/06/24 16:57:58 adam Exp $
+
+Fix for OpenSSL 1.1.x.
+https://github.com/rakshasa/libtorrent/issues/171
+
+--- config.h.in.orig 2018-06-24 16:42:49.312535308 +0000
++++ config.h.in
+@@ -215,6 +215,9 @@
+ /* Using OpenSSL's SHA1 implementation. */
+ #undef USE_OPENSSL_SHA
+
++/* Using OpenSSL 1.1.x. */
++#undef USE_OPENSSL_1_1
++
+ /* posix_fallocate supported. */
+ #undef USE_POSIX_FALLOCATE
+
diff --git a/net/libtorrent/patches/patch-configure b/net/libtorrent/patches/patch-configure
new file mode 100644
index 00000000000..18e0b8ed43a
--- /dev/null
+++ b/net/libtorrent/patches/patch-configure
@@ -0,0 +1,106 @@
+$NetBSD: patch-configure,v 1.1 2018/06/24 16:57:58 adam Exp $
+
+Fix for OpenSSL 1.1.x.
+https://github.com/rakshasa/libtorrent/issues/171
+
+--- configure.orig 2018-06-24 16:28:58.830908273 +0000
++++ configure
+@@ -18494,6 +18494,49 @@ $as_echo "#define USE_OPENSSL 1" >>confd
+
+ $as_echo "#define USE_OPENSSL_SHA 1" >>confdefs.h
+
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DH_set0_pqg in -lcrypto" >&5
++$as_echo_n "checking for DH_set0_pqg in -lcrypto... " >&6; }
++if ${ac_cv_lib_crypto_DH_set0_pqg+:} false; then :
++ $as_echo_n "(cached) " >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-lcrypto $LIBS"
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++/* Override any GCC internal prototype to avoid an error.
++ Use char because int might match the return type of a GCC
++ builtin and then its argument prototype would still apply. */
++#ifdef __cplusplus
++extern "C"
++#endif
++char DH_set0_pqg ();
++int
++main ()
++{
++return DH_set0_pqg ();
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ ac_cv_lib_crypto_DH_set0_pqg=yes
++else
++ ac_cv_lib_crypto_DH_set0_pqg=no
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_DH_set0_pqg" >&5
++$as_echo "$ac_cv_lib_crypto_DH_set0_pqg" >&6; }
++if test "x$ac_cv_lib_crypto_DH_set0_pqg" = xyes; then :
++
++$as_echo "#define USE_OPENSSL_1_1 1" >>confdefs.h
++
++fi
++
++
+ else
+
+ $as_echo "#define USE_NSS_SHA 1" >>confdefs.h
+@@ -18601,6 +18644,48 @@ $as_echo "#define USE_OPENSSL 1" >>confd
+
+ $as_echo "#define USE_OPENSSL_SHA 1" >>confdefs.h
+
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DH_set0_pqg in -lcrypto" >&5
++$as_echo_n "checking for DH_set0_pqg in -lcrypto... " >&6; }
++if ${ac_cv_lib_crypto_DH_set0_pqg+:} false; then :
++ $as_echo_n "(cached) " >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-lcrypto $LIBS"
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++/* Override any GCC internal prototype to avoid an error.
++ Use char because int might match the return type of a GCC
++ builtin and then its argument prototype would still apply. */
++#ifdef __cplusplus
++extern "C"
++#endif
++char DH_set0_pqg ();
++int
++main ()
++{
++return DH_set0_pqg ();
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ ac_cv_lib_crypto_DH_set0_pqg=yes
++else
++ ac_cv_lib_crypto_DH_set0_pqg=no
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_DH_set0_pqg" >&5
++$as_echo "$ac_cv_lib_crypto_DH_set0_pqg" >&6; }
++if test "x$ac_cv_lib_crypto_DH_set0_pqg" = xyes; then :
++
++$as_echo "#define USE_OPENSSL_1_1 1" >>confdefs.h
++
++fi
++
+
+
+ fi
diff --git a/net/libtorrent/patches/patch-src_torrent_poll__kqueue.cc b/net/libtorrent/patches/patch-src_torrent_poll__kqueue.cc
index 221297707a5..d97cb3cf27a 100644
--- a/net/libtorrent/patches/patch-src_torrent_poll__kqueue.cc
+++ b/net/libtorrent/patches/patch-src_torrent_poll__kqueue.cc
@@ -1,15 +1,57 @@
-$NetBSD: patch-src_torrent_poll__kqueue.cc,v 1.1 2017/12/26 23:14:42 he Exp $
+$NetBSD: patch-src_torrent_poll__kqueue.cc,v 1.2 2018/06/24 16:57:58 adam Exp $
Add a cast so that this builds with the c++ in 8.0.
+https://github.com/rakshasa/libtorrent/issues/159
---- ./src/torrent/poll_kqueue.cc.orig 2015-08-08 15:01:32.000000000 +0000
-+++ ./src/torrent/poll_kqueue.cc
-@@ -111,7 +111,7 @@ PollKQueue::modify(Event* event, unsigne
+--- src/torrent/poll_kqueue.cc.orig 2018-06-07 04:24:45.000000000 +0000
++++ src/torrent/poll_kqueue.cc
+@@ -69,6 +69,12 @@ namespace torrent {
+
+ #ifdef USE_KQUEUE
+
++#if defined(__NetBSD__)
++#define LIBEV_UDATA(a) ((intptr_t)(a))
++#else
++#define LIBEV_UDATA(a) (a)
++#endif
++
+ inline uint32_t
+ PollKQueue::event_mask(Event* e) {
+ assert(e->file_descriptor() != -1);
+@@ -111,7 +117,7 @@ PollKQueue::modify(Event* event, unsigne
struct kevent* itr = m_changes + (m_changedEvents++);
assert(event == m_table[event->file_descriptor()].second);
- EV_SET(itr, event->file_descriptor(), mask, op, 0, 0, event);
-+ EV_SET(itr, event->file_descriptor(), mask, op, 0, 0, (intptr_t)event);
++ EV_SET(itr, event->file_descriptor(), mask, op, 0, 0, LIBEV_UDATA(event));
}
PollKQueue*
+@@ -314,11 +320,11 @@ PollKQueue::close(Event* event) {
+
+ // Shouldn't be needed anymore.
+ for (struct kevent *itr = m_events, *last = m_events + m_waitingEvents; itr != last; ++itr)
+- if (itr->udata == event)
++ if (itr->udata == LIBEV_UDATA(event))
+ itr->udata = NULL;
+
+ m_changedEvents = std::remove_if(m_changes, m_changes + m_changedEvents,
+- rak::equal(event, rak::mem_ref(&kevent::udata))) - m_changes;
++ rak::equal(LIBEV_UDATA(event), rak::mem_ref(&kevent::udata))) - m_changes;
+ }
+
+ void
+@@ -340,11 +346,11 @@ PollKQueue::closed(Event* event) {
+
+ // Shouldn't be needed anymore.
+ for (struct kevent *itr = m_events, *last = m_events + m_waitingEvents; itr != last; ++itr)
+- if (itr->udata == event)
++ if (itr->udata == LIBEV_UDATA(event))
+ itr->udata = NULL;
+
+ m_changedEvents = std::remove_if(m_changes, m_changes + m_changedEvents,
+- rak::equal(event, rak::mem_ref(&kevent::udata))) - m_changes;
++ rak::equal(LIBEV_UDATA(event), rak::mem_ref(&kevent::udata))) - m_changes;
+ }
+
+ // Use custom defines for EPOLL* to make the below code compile with
diff --git a/net/libtorrent/patches/patch-src_utils_diffie__hellman.cc b/net/libtorrent/patches/patch-src_utils_diffie__hellman.cc
new file mode 100644
index 00000000000..84378992182
--- /dev/null
+++ b/net/libtorrent/patches/patch-src_utils_diffie__hellman.cc
@@ -0,0 +1,57 @@
+$NetBSD: patch-src_utils_diffie__hellman.cc,v 1.1 2018/06/24 16:57:58 adam Exp $
+
+Fix for OpenSSL 1.1.x.
+https://github.com/rakshasa/libtorrent/issues/171
+
+--- src/utils/diffie_hellman.cc.orig 2018-06-07 04:24:52.000000000 +0000
++++ src/utils/diffie_hellman.cc
+@@ -55,8 +55,16 @@ DiffieHellman::DiffieHellman(const unsig
+
+ #ifdef USE_OPENSSL
+ m_dh = DH_new();
++# ifdef USE_OPENSSL_1_1
++ BIGNUM * const dh_p = BN_bin2bn(prime, primeLength, NULL);
++ BIGNUM * const dh_g = BN_bin2bn(generator, generatorLength, NULL);
++ if (dh_p == NULL || dh_g == NULL ||
++ !DH_set0_pqg(m_dh, dh_p, NULL, dh_g))
++ throw internal_error("Could not generate Diffie-Hellman parameters");
++# else
+ m_dh->p = BN_bin2bn(prime, primeLength, NULL);
+ m_dh->g = BN_bin2bn(generator, generatorLength, NULL);
++# endif
+
+ DH_generate_key(m_dh);
+ #else
+@@ -74,7 +82,15 @@ DiffieHellman::~DiffieHellman() {
+ bool
+ DiffieHellman::is_valid() const {
+ #ifdef USE_OPENSSL
++ if (m_dh == NULL)
++ return false;
++# ifdef USE_OPENSSL_1_1
++ const BIGNUM *pub_key;
++ DH_get0_key(m_dh, &pub_key, NULL);
++ return pub_key != NULL;
++# else
+ return m_dh != NULL && m_dh->pub_key != NULL;
++# endif
+ #else
+ return false;
+ #endif
+@@ -103,8 +119,14 @@ DiffieHellman::store_pub_key(unsigned ch
+ #ifdef USE_OPENSSL
+ std::memset(dest, 0, length);
+
+- if ((int)length >= BN_num_bytes(m_dh->pub_key))
+- BN_bn2bin(m_dh->pub_key, dest + length - BN_num_bytes(m_dh->pub_key));
++ const BIGNUM *pub_key;
++# ifdef USE_OPENSSL_1_1
++ DH_get0_key(m_dh, &pub_key, NULL);
++# else
++ pub_key = m_dh->pub_key;
++# endif
++ if ((int)length >= BN_num_bytes(pub_key))
++ BN_bn2bin(pub_key, dest + length - BN_num_bytes(pub_key));
+ #endif
+ }
+