commit: 1285c1562682b919421103baba5c91018c968dad
parent: 28e535827aafc34cd05630d22a8b4aaceb80305a
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Mon, 30 Apr 2018 04:24:53 +0200
net-libs/libtorrent: Second patchset from OpenBSD, fixes rtorrent linking
static members must exist, even have external linkage for some, so that rtorrent can work
Diffstat:
10 files changed, 173 insertions(+), 0 deletions(-)
diff --git a/net-libs/libtorrent/files/libtorrent-0.13.6-patch-src_data_memory_chunk_cc.patch b/net-libs/libtorrent/files/libtorrent-0.13.6-patch-src_data_memory_chunk_cc.patch
@@ -0,0 +1,16 @@
+$OpenBSD: patch-src_data_memory_chunk_cc,v 1.1 2017/05/19 22:25:53 espie Exp $
+
+Index: src/data/memory_chunk.cc
+--- src/data/memory_chunk.cc.orig
++++ src/data/memory_chunk.cc
+@@ -54,6 +54,10 @@ extern "C" int madvise(void *, size_t, int);
+
+ namespace torrent {
+
++const int MemoryChunk::sync_sync;
++const int MemoryChunk::sync_async;
++const int MemoryChunk::sync_invalidate;
++
+ uint32_t MemoryChunk::m_pagesize = getpagesize();
+
+ inline void
diff --git a/net-libs/libtorrent/files/libtorrent-0.13.6-patch-src_protocol_request_list_cc.patch b/net-libs/libtorrent/files/libtorrent-0.13.6-patch-src_protocol_request_list_cc.patch
@@ -0,0 +1,13 @@
+$OpenBSD: patch-src_protocol_request_list_cc,v 1.1 2017/05/19 22:25:53 espie Exp $
+
+Index: src/protocol/request_list.cc
+--- src/protocol/request_list.cc.orig
++++ src/protocol/request_list.cc
+@@ -52,6 +52,7 @@
+
+ namespace torrent {
+
++const int request_list_constants::bucket_count;
+ const instrumentation_enum request_list_constants::instrumentation_added[bucket_count] = {
+ INSTRUMENTATION_TRANSFER_REQUESTS_QUEUED_ADDED,
+ INSTRUMENTATION_TRANSFER_REQUESTS_UNORDERED_ADDED,
diff --git a/net-libs/libtorrent/files/libtorrent-0.13.6-patch-src_torrent_common_h.patch b/net-libs/libtorrent/files/libtorrent-0.13.6-patch-src_torrent_common_h.patch
@@ -0,0 +1,22 @@
+$OpenBSD: patch-src_torrent_common_h,v 1.2 2017/05/19 22:25:53 espie Exp $
+comment says it all
+
+Index: src/torrent/common.h
+--- src/torrent/common.h.orig
++++ src/torrent/common.h
+@@ -109,4 +109,15 @@ class TransferList;
+
+ }
+
++// XXX tr1/array differs from array
++template<typename T, typename U>
++inline void fill_with_value(T& a, const U& v)
++{
++#if __cplusplus >= 201103L
++ a.fill(v);
++#else
++ a.assign(v);
++#endif
++}
++
+ #endif
diff --git a/net-libs/libtorrent/files/libtorrent-0.13.6-patch-src_torrent_data_block_failed_h.patch b/net-libs/libtorrent/files/libtorrent-0.13.6-patch-src_torrent_data_block_failed_h.patch
@@ -0,0 +1,17 @@
+$OpenBSD: patch-src_torrent_data_block_failed_h,v 1.2 2017/05/19 22:25:53 espie Exp $
+const reference has no useful semantics, shut up clang warning
+
+Index: src/torrent/data/block_failed.h
+--- src/torrent/data/block_failed.h.orig
++++ src/torrent/data/block_failed.h
+@@ -85,8 +85,8 @@ class BlockFailed : public std::vector<std::pair<char*
+ BlockFailed(const BlockFailed&);
+ void operator = (const BlockFailed&);
+
+- static void delete_entry(const reference e) { delete [] e.first; }
+- static bool compare_entries(const reference e1, const reference e2) { return e1.second < e2.second; }
++ static void delete_entry(reference e) { delete [] e.first; }
++ static bool compare_entries(reference e1, reference e2) { return e1.second < e2.second; }
+
+ size_type m_current;
+ };
diff --git a/net-libs/libtorrent/files/libtorrent-0.13.6-patch-src_torrent_data_file_cc.patch b/net-libs/libtorrent/files/libtorrent-0.13.6-patch-src_torrent_data_file_cc.patch
@@ -0,0 +1,21 @@
+$OpenBSD: patch-src_torrent_data_file_cc,v 1.1 2017/05/19 22:25:53 espie Exp $
+
+Index: src/torrent/data/file.cc
+--- src/torrent/data/file.cc.orig
++++ src/torrent/data/file.cc
+@@ -50,6 +50,15 @@
+
+ namespace torrent {
+
++const int File::flag_active;
++const int File::flag_create_queued;
++const int File::flag_resize_queued;
++const int File::flag_fallocate;
++const int File::flag_previously_created;
++
++const int File::flag_prioritize_first;
++const int File::flag_prioritize_last;
++
+ File::File() :
+ m_fd(-1),
+ m_protection(0),
diff --git a/net-libs/libtorrent/files/libtorrent-0.13.6-patch-src_torrent_data_transfer_list_cc.patch b/net-libs/libtorrent/files/libtorrent-0.13.6-patch-src_torrent_data_transfer_list_cc.patch
@@ -0,0 +1,14 @@
+$OpenBSD: patch-src_torrent_data_transfer_list_cc,v 1.2 2017/05/19 22:25:53 espie Exp $
+
+Index: src/torrent/data/transfer_list.cc
+--- src/torrent/data/transfer_list.cc.orig
++++ src/torrent/data/transfer_list.cc
+@@ -159,7 +159,7 @@ TransferList::hash_succeeded(uint32_t index, Chunk* ch
+ struct transfer_list_compare_data {
+ transfer_list_compare_data(Chunk* chunk, const Piece& p) : m_chunk(chunk), m_piece(p) { }
+
+- bool operator () (const BlockFailed::reference failed) {
++ bool operator () (BlockFailed::reference failed) {
+ return m_chunk->compare_buffer(failed.first, m_piece.offset(), m_piece.length());
+ }
+
diff --git a/net-libs/libtorrent/files/libtorrent-0.13.6-patch-src_torrent_download_cc.patch b/net-libs/libtorrent/files/libtorrent-0.13.6-patch-src_torrent_download_cc.patch
@@ -0,0 +1,26 @@
+$OpenBSD: patch-src_torrent_download_cc,v 1.1 2017/05/19 22:25:53 espie Exp $
+
+Index: src/torrent/download.cc
+--- src/torrent/download.cc.orig
++++ src/torrent/download.cc
+@@ -72,6 +72,20 @@
+
+ namespace torrent {
+
++const int DownloadInfo::flag_open LIBTORRENT_EXPORT;
++const int DownloadInfo::flag_active LIBTORRENT_EXPORT;
++const int DownloadInfo::flag_compact LIBTORRENT_EXPORT;
++const int DownloadInfo::flag_accepting_new_peers LIBTORRENT_EXPORT;
++const int DownloadInfo::flag_accepting_seeders LIBTORRENT_EXPORT;
++const int DownloadInfo::flag_private LIBTORRENT_EXPORT;
++const int DownloadInfo::flag_meta_download LIBTORRENT_EXPORT;
++const int DownloadInfo::flag_pex_enabled LIBTORRENT_EXPORT;
++const int DownloadInfo::flag_pex_active LIBTORRENT_EXPORT;
++
++const int DownloadInfo::public_flags;
++
++const uint32_t DownloadInfo::unlimited;
++
+ const DownloadInfo* Download::info() const { return m_ptr->info(); }
+ const download_data* Download::data() const { return m_ptr->data(); }
+
diff --git a/net-libs/libtorrent/files/libtorrent-0.13.6-patch-src_torrent_peer_connection_list_cc.patch b/net-libs/libtorrent/files/libtorrent-0.13.6-patch-src_torrent_peer_connection_list_cc.patch
@@ -0,0 +1,17 @@
+$OpenBSD: patch-src_torrent_peer_connection_list_cc,v 1.1 2017/05/19 22:25:53 espie Exp $
+
+Index: src/torrent/peer/connection_list.cc
+--- src/torrent/peer/connection_list.cc.orig
++++ src/torrent/peer/connection_list.cc
+@@ -60,6 +60,11 @@
+
+ namespace torrent {
+
++const int ConnectionList::disconnect_available;
++const int ConnectionList::disconnect_quick;
++const int ConnectionList::disconnect_unwanted;
++const int ConnectionList::disconnect_delayed;
++
+ ConnectionList::ConnectionList(DownloadMain* download) :
+ m_download(download), m_minSize(50), m_maxSize(100) {
+ }
diff --git a/net-libs/libtorrent/files/libtorrent-0.13.6-patch-src_torrent_utils_net_h.patch b/net-libs/libtorrent/files/libtorrent-0.13.6-patch-src_torrent_utils_net_h.patch
@@ -0,0 +1,15 @@
+$OpenBSD: patch-src_torrent_utils_net_h,v 1.3 2017/05/19 22:25:53 espie Exp $
+
+Add missing include.
+
+Index: src/torrent/utils/net.h
+--- src/torrent/utils/net.h.orig
++++ src/torrent/utils/net.h
+@@ -37,6 +37,7 @@
+ #ifndef LIBTORRENT_UTILS_NET_H
+ #define LIBTORRENT_UTILS_NET_H
+
++#include <sys/socket.h>
+ #include <netdb.h>
+ #include <functional>
+
diff --git a/net-libs/libtorrent/libtorrent-0.13.6-r1.ebuild b/net-libs/libtorrent/libtorrent-0.13.6-r1.ebuild
@@ -45,6 +45,18 @@ src_prepare() {
epatch "${FILESDIR}/libtorrent-0.13.6-patch-src_torrent_utils_extents_h.patch"
epatch "${FILESDIR}/libtorrent-0.13.6-patch-src_net_socket_set_h.patch"
+ # static members must exist, even have external linkage for some, so that rtorrent can work
+ epatch \
+ "${FILESDIR}/libtorrent-0.13.6-patch-src_data_memory_chunk_cc.patch" \
+ "${FILESDIR}/libtorrent-0.13.6-patch-src_protocol_request_list_cc.patch" \
+ "${FILESDIR}/libtorrent-0.13.6-patch-src_torrent_common_h.patch" \
+ "${FILESDIR}/libtorrent-0.13.6-patch-src_torrent_data_block_failed_h.patch" \
+ "${FILESDIR}/libtorrent-0.13.6-patch-src_torrent_data_file_cc.patch" \
+ "${FILESDIR}/libtorrent-0.13.6-patch-src_torrent_data_transfer_list_cc.patch" \
+ "${FILESDIR}/libtorrent-0.13.6-patch-src_torrent_download_cc.patch" \
+ "${FILESDIR}/libtorrent-0.13.6-patch-src_torrent_peer_connection_list_cc.patch" \
+ "${FILESDIR}/libtorrent-0.13.6-patch-src_torrent_utils_net_h.patch"
+
# Fixes a unassigned warning for a happy QA
epatch "${FILESDIR}/libtorrent-0.13.6-src_dht_dht_transaction_cc.patch"