Gentoo Archives: gentoo-commits

From: Pacho Ramos <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-leechcraft/lc-bittorrent/files/, app-leechcraft/lc-bittorrent/
Date: Sat, 08 Oct 2016 13:33:31
Message-Id: 1475933567.2cf2568c287381841309a53c36902cced232ad87.pacho@gentoo
1 commit: 2cf2568c287381841309a53c36902cced232ad87
2 Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 8 13:15:06 2016 +0000
4 Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 8 13:32:47 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2cf2568c
7
8 app-leechcraft/lc-bittorrent: Fix compat with libtorrent-1 (#588940 by Georg Rudoy))
9
10 Package-Manager: portage-2.3.1
11
12 .../files/lc-bittorrent-0.6.70-libtorrent1.patch | 79 ++++++++++++++++++++++
13 .../lc-bittorrent/lc-bittorrent-0.6.70-r1.ebuild | 30 ++++++++
14 2 files changed, 109 insertions(+)
15
16 diff --git a/app-leechcraft/lc-bittorrent/files/lc-bittorrent-0.6.70-libtorrent1.patch b/app-leechcraft/lc-bittorrent/files/lc-bittorrent-0.6.70-libtorrent1.patch
17 new file mode 100644
18 index 00000000..4298118
19 --- /dev/null
20 +++ b/app-leechcraft/lc-bittorrent/files/lc-bittorrent-0.6.70-libtorrent1.patch
21 @@ -0,0 +1,79 @@
22 +commit 5c29ae813099f62affa048efd424e393a2f433c9
23 +Author: 0xd34df00d <0xd34df00d@×××××.com>
24 +Date: Wed Sep 3 02:30:48 2014 +0400
25 +
26 + [BT] libtorrent-1.0 compatibility.
27 +
28 +diff --git a/src/plugins/bittorrent/core.cpp b/src/plugins/bittorrent/core.cpp
29 +index 2152988..c63de7c 100644
30 +--- a/src/plugins/bittorrent/core.cpp
31 ++++ b/src/plugins/bittorrent/core.cpp
32 +@@ -230,9 +230,11 @@ namespace BitTorrent
33 + setLoggingSettings ();
34 + tcpPortRangeChanged ();
35 +
36 ++#if LIBTORRENT_VERSION_NUM < 010000
37 + if (XmlSettingsManager::Instance ()->
38 + property ("EnableMetadata").toBool ())
39 + Session_->add_extension (&libtorrent::create_metadata_plugin);
40 ++#endif
41 + if (XmlSettingsManager::Instance ()->
42 + property ("EnablePEX").toBool ())
43 + Session_->add_extension (&libtorrent::create_ut_pex_plugin);
44 +@@ -1932,10 +1934,17 @@ namespace BitTorrent
45 + atp.paused = pause;
46 + atp.duplicate_is_error = true;
47 + #endif
48 ++
49 ++#if LIBTORRENT_VERSION_NUM >= 010000
50 ++ std::copy (resumeData.constData (),
51 ++ resumeData.constData () + resumeData.size (),
52 ++ std::back_inserter (atp.resume_data));
53 ++#else
54 + atp.resume_data = new std::vector<char>;
55 + std::copy (resumeData.constData (),
56 + resumeData.constData () + resumeData.size (),
57 + std::back_inserter (*atp.resume_data));
58 ++#endif
59 +
60 + handle = Session_->add_torrent (atp);
61 + if (XmlSettingsManager::Instance ()->property ("ResolveCountries").toBool ())
62 +diff --git a/src/plugins/bittorrent/core.h b/src/plugins/bittorrent/core.h
63 +index 07ac771..46e95cb 100644
64 +--- a/src/plugins/bittorrent/core.h
65 ++++ b/src/plugins/bittorrent/core.h
66 +@@ -271,7 +271,7 @@ namespace BitTorrent
67 + const QVector<bool>& files = QVector<bool> (),
68 + LeechCraft::TaskParameters params = LeechCraft::NoParameters);
69 + void KillTask (int);
70 +- void RemoveTorrent (int, int opt = libtorrent::session::none);
71 ++ void RemoveTorrent (int, int opt = 0);
72 + void PauseTorrent (int);
73 + void ResumeTorrent (int);
74 + void ForceReannounce (int);
75 +diff --git a/src/plugins/bittorrent/torrentplugin.cpp b/src/plugins/bittorrent/torrentplugin.cpp
76 +index e19fc2f..676e544 100644
77 +--- a/src/plugins/bittorrent/torrentplugin.cpp
78 ++++ b/src/plugins/bittorrent/torrentplugin.cpp
79 +@@ -555,7 +555,7 @@ namespace LeechCraft
80 +
81 + confirm.exec ();
82 +
83 +- int roptions = libtorrent::session::none;
84 ++ int roptions = 0;
85 + if (confirm.clickedButton () == deleteTorrentsAndFilesButton)
86 + roptions |= libtorrent::session::delete_files;
87 + else if (confirm.clickedButton () == deleteTorrentsButton)
88 +diff --git a/src/plugins/bittorrent/torrenttab.cpp b/src/plugins/bittorrent/torrenttab.cpp
89 +index fd0cbf7..7f9358b 100644
90 +--- a/src/plugins/bittorrent/torrenttab.cpp
91 ++++ b/src/plugins/bittorrent/torrenttab.cpp
92 +@@ -450,7 +450,7 @@ namespace BitTorrent
93 +
94 + confirm.exec ();
95 +
96 +- int roptions = libtorrent::session::none;
97 ++ int roptions = 0;
98 + if (confirm.clickedButton () == deleteTorrentsAndFilesButton)
99 + roptions |= libtorrent::session::delete_files;
100 + else if (confirm.clickedButton () == deleteTorrentsButton)
101
102 diff --git a/app-leechcraft/lc-bittorrent/lc-bittorrent-0.6.70-r1.ebuild b/app-leechcraft/lc-bittorrent/lc-bittorrent-0.6.70-r1.ebuild
103 new file mode 100644
104 index 00000000..461028e
105 --- /dev/null
106 +++ b/app-leechcraft/lc-bittorrent/lc-bittorrent-0.6.70-r1.ebuild
107 @@ -0,0 +1,30 @@
108 +# Copyright 1999-2016 Gentoo Foundation
109 +# Distributed under the terms of the GNU General Public License v2
110 +# $Id$
111 +
112 +EAPI=5
113 +inherit leechcraft
114 +
115 +DESCRIPTION="Full-featured BitTorrent client plugin for LeechCraft"
116 +
117 +SLOT="0"
118 +KEYWORDS="~amd64 ~x86"
119 +IUSE="debug geoip"
120 +
121 +DEPEND="
122 + ~app-leechcraft/lc-core-${PV}
123 + net-libs/rb_libtorrent:=
124 +"
125 +RDEPEND="${DEPEND}
126 + virtual/leechcraft-task-show
127 + geoip? ( dev-libs/geoip )
128 +"
129 +
130 +PATCHES=(
131 + "${FILESDIR}"/${P}-libtorrent1.patch
132 +)
133 +
134 +src_configure(){
135 + cmake-utils_src_configure \
136 + $(cmake-utils_use_enable geoip BITTORRENT_GEOIP)
137 +}