Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/rb_libtorrent/, net-libs/rb_libtorrent/files/
Date: Tue, 07 Mar 2017 22:20:16
Message-Id: 1488924872.4a9c486ebdde12ae9e2ce0b84c6f67005d01d6c1.asturm@gentoo
1 commit: 4a9c486ebdde12ae9e2ce0b84c6f67005d01d6c1
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Tue Mar 7 21:12:31 2017 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 7 22:14:32 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4a9c486e
7
8 net-libs/rb_libtorrent: 1.0.11 version bump, fix tests, ABI break
9
10 Dropped eutils.eclass.
11
12 Package-Manager: Portage-2.3.3, Repoman-2.3.1
13
14 net-libs/rb_libtorrent/Manifest | 1 +
15 .../files/rb_libtorrent-1.0.11-fix-abicompat.patch | 157 +++++++++++++++++++++
16 .../files/rb_libtorrent-1.0.11-fix-test_ssl.patch | 21 +++
17 .../files/rb_libtorrent-1.0.11-move-header.patch | 34 +++++
18 net-libs/rb_libtorrent/rb_libtorrent-1.0.11.ebuild | 119 ++++++++++++++++
19 5 files changed, 332 insertions(+)
20
21 diff --git a/net-libs/rb_libtorrent/Manifest b/net-libs/rb_libtorrent/Manifest
22 index 9602799a659..522bf25c445 100644
23 --- a/net-libs/rb_libtorrent/Manifest
24 +++ b/net-libs/rb_libtorrent/Manifest
25 @@ -1,4 +1,5 @@
26 DIST libtorrent-rasterbar-0.16.17.tar.gz 3018881 SHA256 67a1d29c626d991d6e39c2f9828ca70c4053d057070ce01fff9b4ad37e64aff0 SHA512 532b2438e24c3ecad239480a1bd6241a0d73d40f8d5bdcf61ddfcee1a41f1644c9004d4f234968efd50158224219b78852ec936a05b75b15f3442b594460cdd6 WHIRLPOOL 755e201741ed77cf91cb0976cbaa83c645647341d2cfe40564552599f2792ba76bd02e82a94669d80b199f1a1d6290824686d2bb52d6b0da8663d2274176f3eb
27 DIST libtorrent-rasterbar-0.16.19.tar.gz 3030253 SHA256 9ebd3fa8accfa27d0c81cdbbe15d7b411ea1deec34ac6325dec7197f05d82982 SHA512 8e605802cb1ae80228d253adba44da6f5af39e7d65c59f65e15444ed1122500529ee068f6d3608b1c2a249f18b4de695073f7b67772fa445618757697d779340 WHIRLPOOL 4429d07bd95f398a09f283a7cbcf6611aeb8ac5d2b8ed76d98f89d601aa6ed66e6eb8f044b351fad6cca3606351ccc67081dba7c8dd8d9c3c433eae84aedeb2c
28 DIST libtorrent-rasterbar-1.0.10.tar.gz 3324494 SHA256 a865ceaca8b14acdd7be56d361ce4e64361299647e157ef7b3ac7e2812ca4c3e SHA512 08976239ec12e2d67a974dadf3f16330f48e4b6de314f9d97c5fbbdbc696b76b6b1f8e20ceab6830d46d17b1bfd7e2fe4048fb1a5a97ece12c242c0cd0f7ded2 WHIRLPOOL 1e4ef2fb41eef0b825bd7c8c665638e3f689c3cefca3caa18a01c328caad9d31cd417fb49d25a7d55da6457a89e35a891427d70fb4f4d070c74be2e2e0347a60
29 +DIST libtorrent-rasterbar-1.0.11.tar.gz 3325786 SHA256 828d686770346f6da2c143c5a2844c5f5e407eb4a37982e90022763508abd62f SHA512 770d16b241174ae4b121af9b2ac7bcde8b14c6ed99352b827b760a3cbdc2c0ebd0d505319762897720c5f72acdff506ee9948ac1140e6d4591805eca5439b184 WHIRLPOOL e56bfe0830cfc7776436552171b14b08913d99a2c726c9eefa828027caaa96d9c3d97e6442a3b53f315eaa3e7e0f68175d813dbab1d6de1da5937054fc6cac9c
30 DIST libtorrent-rasterbar-1.1.1.tar.gz 3641815 SHA256 f70c82367b0980460ef95aff3e117fd4a174477892d529beec434f74d615b31f SHA512 9d2409ee733f7579df61a63e37092d3c59a386b94031bae6a7ea64ffff617131d2c347ba0825b3d337ce2fedad3b527c8f697e3b49cea643d6543c972a1ebc12 WHIRLPOOL 36c4a007e0bf684e9603cd88b594a8ff91193b7d73447375e5651f945dba713c91daf0c625f90af6bb35c2ab017ca69da50d856ac6ce6be2e13f6d04ee7b2e35
31
32 diff --git a/net-libs/rb_libtorrent/files/rb_libtorrent-1.0.11-fix-abicompat.patch b/net-libs/rb_libtorrent/files/rb_libtorrent-1.0.11-fix-abicompat.patch
33 new file mode 100644
34 index 00000000000..eebee122551
35 --- /dev/null
36 +++ b/net-libs/rb_libtorrent/files/rb_libtorrent-1.0.11-fix-abicompat.patch
37 @@ -0,0 +1,157 @@
38 +From 76381835be19da2f8f1fc501445e31d32e6d83e4 Mon Sep 17 00:00:00 2001
39 +From: Arvid Norberg <arvid.norberg@×××××.com>
40 +Date: Sun, 12 Feb 2017 21:05:22 -0500
41 +Subject: [PATCH] fix ABI compatibility issue introduced with preformatted
42 + entry type (#1702)
43 +
44 +fix ABI compatibility issue introduced with preformatted entry type
45 +---
46 + ChangeLog | 2 ++
47 + bindings/python/src/create_torrent.cpp | 2 +-
48 + include/libtorrent/create_torrent.hpp | 6 ++++++
49 + src/create_torrent.cpp | 31 ++++++++++++++++++++++++++++---
50 + src/torrent.cpp | 11 ++++++++---
51 + test/test_create_torrent.cpp | 2 +-
52 + 6 files changed, 46 insertions(+), 8 deletions(-)
53 +
54 +diff --git a/ChangeLog b/ChangeLog
55 +index 9b501ce..9defe7c 100644
56 +--- a/ChangeLog
57 ++++ b/ChangeLog
58 +@@ -1,3 +1,5 @@
59 ++ * fix ABI compatibility issue introduced with preformatted entry type
60 ++
61 + 1.0.11 release
62 +
63 + * updating super seeding would include the torrent in state_update_alert
64 +diff --git a/bindings/python/src/create_torrent.cpp b/bindings/python/src/create_torrent.cpp
65 +index 55b6b51..31abb07 100644
66 +--- a/bindings/python/src/create_torrent.cpp
67 ++++ b/bindings/python/src/create_torrent.cpp
68 +@@ -127,7 +127,7 @@ void bind_create_torrent()
69 +
70 + class_<create_torrent>("create_torrent", no_init)
71 + .def(init<file_storage&>())
72 +- .def(init<torrent_info const&>(arg("ti")))
73 ++ .def(init<torrent_info const&, int>((arg("ti"), arg("version") = LIBTORRENT_VERSION_NUM)))
74 + .def(init<file_storage&, int, int, int>((arg("storage"), arg("piece_size") = 0
75 + , arg("pad_file_limit") = -1, arg("flags") = int(libtorrent::create_torrent::optimize))))
76 +
77 +diff --git a/include/libtorrent/create_torrent.hpp b/include/libtorrent/create_torrent.hpp
78 +index 05dc6ca..d55e86a 100644
79 +--- a/include/libtorrent/create_torrent.hpp
80 ++++ b/include/libtorrent/create_torrent.hpp
81 +@@ -42,6 +42,7 @@ POSSIBILITY OF SUCH DAMAGE.
82 + #include "libtorrent/utf8.hpp"
83 + #include "libtorrent/allocator.hpp"
84 + #include "libtorrent/file.hpp" // for combine_path etc.
85 ++#include "libtorrent/version.hpp"
86 +
87 + #include <vector>
88 + #include <string>
89 +@@ -171,9 +172,12 @@ namespace libtorrent
90 + // ``alignment`` is used when pad files are enabled. This is the size
91 + // eligible files are aligned to. The default is -1, which means the
92 + // piece size of the torrent.
93 ++ // The ``use_preformatted`` parameter can be set to true to preserve
94 ++ // invalid encoding of the .torrent file.
95 + create_torrent(file_storage& fs, int piece_size = 0
96 + , int pad_file_limit = -1, int flags = optimize, int alignment = -1);
97 + create_torrent(torrent_info const& ti);
98 ++ create_torrent(torrent_info const& ti, bool use_preformatted);
99 +
100 + // internal
101 + ~create_torrent();
102 +@@ -290,6 +294,8 @@ namespace libtorrent
103 +
104 + private:
105 +
106 ++ void load_from_torrent_info(torrent_info const& ti, bool const use_preformatted);
107 ++
108 + file_storage& m_files;
109 + // if m_info_dict is initialized, it is
110 + // used instead of m_files to generate
111 +diff --git a/src/create_torrent.cpp b/src/create_torrent.cpp
112 +index df4c759..aab5574 100644
113 +--- a/src/create_torrent.cpp
114 ++++ b/src/create_torrent.cpp
115 +@@ -330,6 +330,24 @@ namespace libtorrent
116 + , m_include_symlinks(false)
117 + , m_calculate_file_hashes(false)
118 + {
119 ++ load_from_torrent_info(ti, false);
120 ++ }
121 ++
122 ++ create_torrent::create_torrent(torrent_info const& ti, bool const use_preformatted)
123 ++ : m_files(const_cast<file_storage&>(ti.files()))
124 ++ , m_creation_date(time(0))
125 ++ , m_multifile(ti.num_files() > 1)
126 ++ , m_private(ti.priv())
127 ++ , m_merkle_torrent(ti.is_merkle_torrent())
128 ++ , m_include_mtime(false)
129 ++ , m_include_symlinks(false)
130 ++ , m_calculate_file_hashes(false)
131 ++ {
132 ++ load_from_torrent_info(ti, use_preformatted);
133 ++ }
134 ++
135 ++ void create_torrent::load_from_torrent_info(torrent_info const& ti, bool const use_preformatted)
136 ++ {
137 + TORRENT_ASSERT(ti.is_valid());
138 + if (!ti.is_valid()) return;
139 +
140 +@@ -361,9 +379,16 @@ namespace libtorrent
141 + m_piece_hash.resize(m_files.num_pieces());
142 + for (int i = 0; i < num_pieces(); ++i) set_hash(i, ti.hash_for_piece(i));
143 +
144 +- boost::shared_array<char> const info = ti.metadata();
145 +- int const size = ti.metadata_size();
146 +- m_info_dict.preformatted().assign(&info[0], &info[0] + size);
147 ++ if (use_preformatted)
148 ++ {
149 ++ boost::shared_array<char> const info = ti.metadata();
150 ++ int const size = ti.metadata_size();
151 ++ m_info_dict.preformatted().assign(&info[0], &info[0] + size);
152 ++ }
153 ++ else
154 ++ {
155 ++ m_info_dict = bdecode(&ti.metadata()[0], &ti.metadata()[0] + ti.metadata_size());
156 ++ }
157 + m_info_hash = ti.info_hash();
158 + }
159 +
160 +diff --git a/src/torrent.cpp b/src/torrent.cpp
161 +index 75f0cc7..ef05dfd 100644
162 +--- a/src/torrent.cpp
163 ++++ b/src/torrent.cpp
164 +@@ -5601,9 +5601,14 @@ namespace libtorrent
165 + {
166 + if (m_magnet_link || (m_save_resume_flags & torrent_handle::save_info_dict))
167 + {
168 +- boost::shared_array<char> const info = torrent_file().metadata();
169 +- int const size = torrent_file().metadata_size();
170 +- ret["info"].preformatted().assign(&info[0], &info[0] + size);
171 ++ ret["info"] = bdecode(&torrent_file().metadata()[0]
172 ++ , &torrent_file().metadata()[0] + torrent_file().metadata_size());
173 ++// TODO: re-enable this code once there's a non-inlined encoder function. Or
174 ++// perhaps this should not be used until saving resume_data via
175 ++// add_torrent_params and a free function, similar to read_resume_data
176 ++// boost::shared_array<char> const info = torrent_file().metadata();
177 ++// int const size = torrent_file().metadata_size();
178 ++// ret["info"].preformatted().assign(&info[0], &info[0] + size);
179 + }
180 + }
181 +
182 +diff --git a/test/test_create_torrent.cpp b/test/test_create_torrent.cpp
183 +index 0a87c08..33fd3e8 100644
184 +--- a/test/test_create_torrent.cpp
185 ++++ b/test/test_create_torrent.cpp
186 +@@ -51,7 +51,7 @@ int test_main()
187 +
188 + lt::torrent_info info(test_torrent, sizeof(test_torrent) - 1);
189 +
190 +- lt::create_torrent t(info);
191 ++ lt::create_torrent t(info, true);
192 +
193 + std::vector<char> buffer;
194 + lt::bencode(std::back_inserter(buffer), t.generate());
195
196 diff --git a/net-libs/rb_libtorrent/files/rb_libtorrent-1.0.11-fix-test_ssl.patch b/net-libs/rb_libtorrent/files/rb_libtorrent-1.0.11-fix-test_ssl.patch
197 new file mode 100644
198 index 00000000000..2add42c7dd2
199 --- /dev/null
200 +++ b/net-libs/rb_libtorrent/files/rb_libtorrent-1.0.11-fix-test_ssl.patch
201 @@ -0,0 +1,21 @@
202 +From 7f060e4a70b21974bcf154cf1a93c7b68c5a9aa8 Mon Sep 17 00:00:00 2001
203 +From: Alden Torres <aldenml@×××××.com>
204 +Date: Sat, 8 Oct 2016 01:12:15 -0400
205 +Subject: [PATCH] fix openssl compilation with boost 1.62 (#1193)
206 +
207 +---
208 + test/test_ssl.cpp | 1 -
209 + 1 file changed, 1 deletion(-)
210 +
211 +diff --git a/test/test_ssl.cpp b/test/test_ssl.cpp
212 +index 659973c..5aa6b15 100644
213 +--- a/test/test_ssl.cpp
214 ++++ b/test/test_ssl.cpp
215 +@@ -47,7 +47,6 @@ POSSIBILITY OF SUCH DAMAGE.
216 + #include <boost/asio/connect.hpp>
217 +
218 + #ifdef TORRENT_USE_OPENSSL
219 +-#include <boost/asio/ssl/error.hpp> // for asio::error::get_ssl_category()
220 + #include <boost/asio/ssl.hpp>
221 +
222 + using namespace libtorrent;
223
224 diff --git a/net-libs/rb_libtorrent/files/rb_libtorrent-1.0.11-move-header.patch b/net-libs/rb_libtorrent/files/rb_libtorrent-1.0.11-move-header.patch
225 new file mode 100644
226 index 00000000000..589998b7fb3
227 --- /dev/null
228 +++ b/net-libs/rb_libtorrent/files/rb_libtorrent-1.0.11-move-header.patch
229 @@ -0,0 +1,34 @@
230 +From ecd20f15cb3fa5a0ebabd647b1f57f3cd62cb4b7 Mon Sep 17 00:00:00 2001
231 +From: sledgehammer_999 <hammered999@×××××.com>
232 +Date: Mon, 20 Feb 2017 01:22:27 +0200
233 +Subject: [PATCH] Move include into implementation instead(from #1702).
234 +
235 +---
236 + bindings/python/src/create_torrent.cpp | 1 +
237 + include/libtorrent/create_torrent.hpp | 1 -
238 + 2 files changed, 1 insertion(+), 1 deletion(-)
239 +
240 +diff --git a/bindings/python/src/create_torrent.cpp b/bindings/python/src/create_torrent.cpp
241 +index 31abb07..e856d85 100644
242 +--- a/bindings/python/src/create_torrent.cpp
243 ++++ b/bindings/python/src/create_torrent.cpp
244 +@@ -6,6 +6,7 @@
245 + #include <libtorrent/create_torrent.hpp>
246 + #include <libtorrent/file_storage.hpp>
247 + #include "libtorrent/intrusive_ptr_base.hpp"
248 ++#include <libtorrent/version.hpp>
249 + #include "bytes.hpp"
250 +
251 + using namespace boost::python;
252 +diff --git a/include/libtorrent/create_torrent.hpp b/include/libtorrent/create_torrent.hpp
253 +index d55e86a..8d2c680 100644
254 +--- a/include/libtorrent/create_torrent.hpp
255 ++++ b/include/libtorrent/create_torrent.hpp
256 +@@ -42,7 +42,6 @@ POSSIBILITY OF SUCH DAMAGE.
257 + #include "libtorrent/utf8.hpp"
258 + #include "libtorrent/allocator.hpp"
259 + #include "libtorrent/file.hpp" // for combine_path etc.
260 +-#include "libtorrent/version.hpp"
261 +
262 + #include <vector>
263 + #include <string>
264
265 diff --git a/net-libs/rb_libtorrent/rb_libtorrent-1.0.11.ebuild b/net-libs/rb_libtorrent/rb_libtorrent-1.0.11.ebuild
266 new file mode 100644
267 index 00000000000..1bc5f654383
268 --- /dev/null
269 +++ b/net-libs/rb_libtorrent/rb_libtorrent-1.0.11.ebuild
270 @@ -0,0 +1,119 @@
271 +# Copyright 1999-2017 Gentoo Foundation
272 +# Distributed under the terms of the GNU General Public License v2
273 +
274 +EAPI=6
275 +
276 +PYTHON_COMPAT=( python2_7 python3_{4,5} )
277 +PYTHON_REQ_USE="threads"
278 +DISTUTILS_OPTIONAL=true
279 +DISTUTILS_IN_SOURCE_BUILD=true
280 +
281 +inherit distutils-r1 versionator
282 +
283 +MY_P=libtorrent-rasterbar-${PV} # TODO: rename, bug 576126
284 +MY_PV=$(replace_all_version_separators _)
285 +
286 +DESCRIPTION="C++ BitTorrent implementation focusing on efficiency and scalability"
287 +HOMEPAGE="http://libtorrent.org"
288 +SRC_URI="https://github.com/arvidn/libtorrent/releases/download/libtorrent-${MY_PV}/${MY_P}.tar.gz"
289 +
290 +LICENSE="BSD"
291 +SLOT="0/8"
292 +KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
293 +IUSE="debug +dht doc examples +geoip libressl python +ssl static-libs test"
294 +
295 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
296 +
297 +COMMON_DEPEND="
298 + dev-libs/boost:=[threads]
299 + virtual/libiconv
300 + geoip? ( dev-libs/geoip )
301 + python? (
302 + ${PYTHON_DEPS}
303 + dev-libs/boost:=[python,${PYTHON_USEDEP}]
304 + )
305 + ssl? (
306 + !libressl? ( dev-libs/openssl:0= )
307 + libressl? ( dev-libs/libressl:= )
308 + )
309 +"
310 +DEPEND="${COMMON_DEPEND}
311 + sys-devel/libtool
312 +"
313 +RDEPEND="${COMMON_DEPEND}
314 + examples? ( !net-p2p/mldonkey )
315 +"
316 +
317 +S=${WORKDIR}/${MY_P}
318 +
319 +PATCHES=(
320 + "${FILESDIR}/${PN}-1.0.9-test_torrent_parse.patch"
321 + # RC_1_0 branch
322 + "${FILESDIR}/${P}-fix-abicompat.patch"
323 + "${FILESDIR}/${P}-move-header.patch"
324 + # master branch
325 + "${FILESDIR}/${P}-fix-test_ssl.patch"
326 +)
327 +
328 +src_prepare() {
329 + default
330 +
331 + # bug 578026
332 + # prepend -L${S}/... to ensure bindings link against the lib we just built
333 + sed -i -e "s|^|-L${S}/src/.libs |" bindings/python/compile_flags.in || die
334 +
335 + use python && distutils-r1_src_prepare
336 +}
337 +
338 +src_configure() {
339 + local myeconfargs=(
340 + $(use_enable debug)
341 + $(use_enable debug logging)
342 + $(use_enable debug statistics)
343 + $(use_enable debug disk-stats)
344 + $(use_enable dht dht $(usex debug logging yes))
345 + $(use_enable examples)
346 + $(use_enable geoip)
347 + $(use_with geoip libgeoip)
348 + $(use_enable ssl encryption)
349 + $(use_enable static-libs static)
350 + $(use_enable test tests)
351 + --with-libiconv
352 + )
353 + econf "${myeconfargs[@]}"
354 +
355 + if use python; then
356 + myeconfargs+=(
357 + --enable-python-binding
358 + --with-boost-python
359 + )
360 + python_configure() {
361 + econf "${myeconfargs[@]}"
362 + }
363 + distutils-r1_src_configure
364 + fi
365 +}
366 +
367 +src_compile() {
368 + default
369 +
370 + python_compile() {
371 + cd "${BUILD_DIR}/../bindings/python" || die
372 + distutils-r1_python_compile
373 + }
374 + use python && distutils-r1_src_compile
375 +}
376 +
377 +src_install() {
378 + use doc && HTML_DOCS+=( "${S}"/docs )
379 +
380 + default
381 +
382 + python_install() {
383 + cd "${BUILD_DIR}/../bindings/python" || die
384 + distutils-r1_python_install
385 + }
386 + use python && distutils-r1_src_install
387 +
388 + find "${D}" -name '*.la' -delete || die
389 +}