commit: 7044784fda3c73c2dfc8f7b7e5f270ec56951b0c
parent: 14f97366f8fe3aa3faaa681d59822eadeaf492c2
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Mon, 30 Apr 2018 05:58:18 +0200
net-p2p/rtorrent: Add clang compatibility
Diffstat:
8 files changed, 137 insertions(+), 3 deletions(-)
diff --git a/net-p2p/rtorrent/files/rtorrent-0.9.6-patch-Makefile_in.patch b/net-p2p/rtorrent/files/rtorrent-0.9.6-patch-Makefile_in.patch
@@ -0,0 +1,15 @@
+$OpenBSD: patch-test_Makefile_in,v 1.5 2015/09/11 09:16:03 pascal Exp $
+
+Unbreak build.
+
+--- test/Makefile.in.orig Thu Sep 10 20:20:28 2015
++++ test/Makefile.in Thu Sep 10 20:20:33 2015
+@@ -561,7 +561,7 @@ rtorrentTest_SOURCES = \
+ main.cc
+
+ rtorrentTest_CXXFLAGS = $(CPPUNIT_CFLAGS)
+-rtorrentTest_LDFLAGS = $(CPPUNIT_LIBS) -ldl
++rtorrentTest_LDFLAGS = $(CPPUNIT_LIBS)
+ AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_srcdir)/src
+ all: all-am
+
diff --git a/net-p2p/rtorrent/files/rtorrent-0.9.6-patch-src_core_manager_cc.patch b/net-p2p/rtorrent/files/rtorrent-0.9.6-patch-src_core_manager_cc.patch
@@ -0,0 +1,17 @@
+$OpenBSD: patch-src_core_manager_cc,v 1.1 2017/05/19 22:26:32 espie Exp $
+
+Index: src/core/manager.cc
+--- src/core/manager.cc.orig
++++ src/core/manager.cc
+@@ -74,6 +74,11 @@
+
+ namespace core {
+
++const int Manager::create_start;
++const int Manager::create_tied;
++const int Manager::create_quiet;
++const int Manager::create_raw_data;
++
+ void
+ Manager::push_log(const char* msg) {
+ m_log_important->lock_and_push_log(msg, strlen(msg), 0);
diff --git a/net-p2p/rtorrent/files/rtorrent-0.9.6-patch-src_core_poll_manager_cc.patch b/net-p2p/rtorrent/files/rtorrent-0.9.6-patch-src_core_poll_manager_cc.patch
@@ -0,0 +1,13 @@
+$OpenBSD: patch-src_core_poll_manager_cc,v 1.3 2017/05/19 22:26:32 espie Exp $
+
+Index: src/core/poll_manager.cc
+--- src/core/poll_manager.cc.orig
++++ src/core/poll_manager.cc
+@@ -38,6 +38,7 @@
+
+ #include <stdexcept>
+ #include <unistd.h>
++#include <sys/select.h>
+ #include <torrent/exceptions.h>
+ #include <torrent/poll_epoll.h>
+ #include <torrent/poll_kqueue.h>
diff --git a/net-p2p/rtorrent/files/rtorrent-0.9.6-patch-src_display_window_file_list_cc.patch b/net-p2p/rtorrent/files/rtorrent-0.9.6-patch-src_display_window_file_list_cc.patch
@@ -0,0 +1,13 @@
+$OpenBSD: patch-src_display_window_file_list_cc,v 1.5 2017/05/19 22:26:32 espie Exp $
+
+Index: src/display/window_file_list.cc
+--- src/display/window_file_list.cc.orig
++++ src/display/window_file_list.cc
+@@ -41,6 +41,7 @@
+ #include <torrent/data/file.h>
+ #include <torrent/data/file_list.h>
+ #include <torrent/data/file_list_iterator.h>
++#include <locale>
+
+ #include "core/download.h"
+ #include "ui/element_file_list.h"
diff --git a/net-p2p/rtorrent/files/rtorrent-0.9.6-patch-src_rpc_exec_file_cc.patch b/net-p2p/rtorrent/files/rtorrent-0.9.6-patch-src_rpc_exec_file_cc.patch
@@ -0,0 +1,20 @@
+$OpenBSD: patch-src_rpc_exec_file_cc,v 1.1 2017/05/19 22:26:32 espie Exp $
+
+Index: src/rpc/exec_file.cc
+--- src/rpc/exec_file.cc.orig
++++ src/rpc/exec_file.cc
+@@ -52,6 +52,14 @@ namespace rpc {
+
+ // Close m_logFd.
+
++const unsigned int ExecFile::max_args;
++const unsigned int ExecFile::buffer_size;
++
++const int ExecFile::flag_expand_tilde;
++const int ExecFile::flag_throw;
++const int ExecFile::flag_capture;
++const int ExecFile::flag_background;
++
+ int
+ ExecFile::execute(const char* file, char* const* argv, int flags) {
+ // Write the execued command and its parameters to the log fd.
diff --git a/net-p2p/rtorrent/files/rtorrent-0.9.6-patch-src_rpc_object_storage_cc.patch b/net-p2p/rtorrent/files/rtorrent-0.9.6-patch-src_rpc_object_storage_cc.patch
@@ -0,0 +1,29 @@
+$OpenBSD: patch-src_rpc_object_storage_cc,v 1.1 2017/05/19 22:26:32 espie Exp $
+
+Index: src/rpc/object_storage.cc
+--- src/rpc/object_storage.cc.orig
++++ src/rpc/object_storage.cc
+@@ -44,6 +44,23 @@
+
+ namespace rpc {
+
++const unsigned int object_storage::flag_generic_type;
++const unsigned int object_storage::flag_bool_type;
++const unsigned int object_storage::flag_value_type;
++const unsigned int object_storage::flag_string_type;
++const unsigned int object_storage::flag_list_type;
++const unsigned int object_storage::flag_function_type;
++const unsigned int object_storage::flag_multi_type;
++
++const unsigned int object_storage::mask_type;
++
++const unsigned int object_storage::flag_constant;
++const unsigned int object_storage::flag_static;
++const unsigned int object_storage::flag_private;
++const unsigned int object_storage::flag_rlookup;
++
++const size_t object_storage::key_size;
++
+ object_storage::local_iterator
+ object_storage::find_local(const torrent::raw_string& key) {
+ std::size_t n = hash_fixed_key_type::hash(key.data(), key.size()) % bucket_count();
diff --git a/net-p2p/rtorrent/files/rtorrent-0.9.6-patch-src_signal_handler_cc.patch b/net-p2p/rtorrent/files/rtorrent-0.9.6-patch-src_signal_handler_cc.patch
@@ -0,0 +1,13 @@
+$OpenBSD: patch-src_signal_handler_cc,v 1.1 2017/05/19 22:26:32 espie Exp $
+
+Index: src/signal_handler.cc
+--- src/signal_handler.cc.orig
++++ src/signal_handler.cc
+@@ -38,6 +38,7 @@
+
+ #include <signal.h>
+ #include <stdexcept>
++#include <string>
+ #include "rak/error_number.h"
+ #include "signal_handler.h"
+
diff --git a/net-p2p/rtorrent/rtorrent-0.9.6-r1.ebuild b/net-p2p/rtorrent/rtorrent-0.9.6-r1.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-EAPI=5
+EAPI=6
-inherit autotools eutils systemd
+inherit autotools eutils systemd flag-o-matic
DESCRIPTION="BitTorrent Client using libtorrent"
HOMEPAGE="https://rakshasa.github.io/rtorrent/"
@@ -30,6 +30,18 @@ DEPEND="${COMMON_DEPEND}
DOCS=( doc/rtorrent.rc )
src_prepare() {
+ # Fix compiling with Clang by being C++11
+ append-cxxflags "-std=c++11"
+ find "${WORKDIR}" -type f|xargs fgrep -lw tr1|xargs sed -i -e 's,<tr1/,<,' -e 's/std::tr1/std/g' -e 's/tr1::placeholders::/std::placeholders::/g' -e 's/tr1::bind/std::bind/g' || die
+ epatch \
+ "${FILESDIR}/rtorrent-0.9.6-patch-src_core_manager_cc.patch" \
+ "${FILESDIR}/rtorrent-0.9.6-patch-src_core_poll_manager_cc.patch" \
+ "${FILESDIR}/rtorrent-0.9.6-patch-src_display_window_file_list_cc.patch" \
+ "${FILESDIR}/rtorrent-0.9.6-patch-src_rpc_exec_file_cc.patch" \
+ "${FILESDIR}/rtorrent-0.9.6-patch-src_rpc_object_storage_cc.patch" \
+ "${FILESDIR}/rtorrent-0.9.6-patch-src_signal_handler_cc.patch" \
+ "${FILESDIR}/rtorrent-0.9.6-patch-Makefile_in.patch"
+
# bug #358271
epatch \
"${FILESDIR}"/${PN}-0.9.1-ncurses.patch \
@@ -39,6 +51,8 @@ src_prepare() {
# https://github.com/rakshasa/rtorrent/issues/332
cp "${FILESDIR}"/rtorrent.1 "${S}"/doc/ || die
+ eapply_user
+
eautoreconf
}