diff options
author | Andreas Sturmlechner <asturm@gentoo.org> | 2017-03-18 23:04:16 +0100 |
---|---|---|
committer | Andreas Sturmlechner <asturm@gentoo.org> | 2017-03-19 00:03:24 +0100 |
commit | 08182c35282ee43933a39462ef9fb7092b368a90 (patch) | |
tree | 6074222ba8695980cb5b716866546facd2500dec /net-libs/libtorrent-rasterbar | |
parent | net-p2p/qbittorrent: Drop old (diff) | |
download | gentoo-08182c35282ee43933a39462ef9fb7092b368a90.tar.gz gentoo-08182c35282ee43933a39462ef9fb7092b368a90.tar.bz2 gentoo-08182c35282ee43933a39462ef9fb7092b368a90.zip |
net-libs/rb_libtorrent: pkgmove to libtorrent-rasterbar
Gentoo-bug: 576126
Package-Manager: Portage-2.3.3, Repoman-2.3.1
Closes: https://github.com/gentoo/gentoo/pull/4241
Diffstat (limited to 'net-libs/libtorrent-rasterbar')
10 files changed, 703 insertions, 0 deletions
diff --git a/net-libs/libtorrent-rasterbar/Manifest b/net-libs/libtorrent-rasterbar/Manifest new file mode 100644 index 000000000000..99d34b4f7758 --- /dev/null +++ b/net-libs/libtorrent-rasterbar/Manifest @@ -0,0 +1,4 @@ +DIST libtorrent-rasterbar-1.0.10.tar.gz 3324494 SHA256 a865ceaca8b14acdd7be56d361ce4e64361299647e157ef7b3ac7e2812ca4c3e SHA512 08976239ec12e2d67a974dadf3f16330f48e4b6de314f9d97c5fbbdbc696b76b6b1f8e20ceab6830d46d17b1bfd7e2fe4048fb1a5a97ece12c242c0cd0f7ded2 WHIRLPOOL 1e4ef2fb41eef0b825bd7c8c665638e3f689c3cefca3caa18a01c328caad9d31cd417fb49d25a7d55da6457a89e35a891427d70fb4f4d070c74be2e2e0347a60 +DIST libtorrent-rasterbar-1.0.11.tar.gz 3325786 SHA256 828d686770346f6da2c143c5a2844c5f5e407eb4a37982e90022763508abd62f SHA512 770d16b241174ae4b121af9b2ac7bcde8b14c6ed99352b827b760a3cbdc2c0ebd0d505319762897720c5f72acdff506ee9948ac1140e6d4591805eca5439b184 WHIRLPOOL e56bfe0830cfc7776436552171b14b08913d99a2c726c9eefa828027caaa96d9c3d97e6442a3b53f315eaa3e7e0f68175d813dbab1d6de1da5937054fc6cac9c +DIST libtorrent-rasterbar-1.1.1.tar.gz 3641815 SHA256 f70c82367b0980460ef95aff3e117fd4a174477892d529beec434f74d615b31f SHA512 9d2409ee733f7579df61a63e37092d3c59a386b94031bae6a7ea64ffff617131d2c347ba0825b3d337ce2fedad3b527c8f697e3b49cea643d6543c972a1ebc12 WHIRLPOOL 36c4a007e0bf684e9603cd88b594a8ff91193b7d73447375e5651f945dba713c91daf0c625f90af6bb35c2ab017ca69da50d856ac6ce6be2e13f6d04ee7b2e35 +DIST libtorrent-rasterbar-1.1.2.tar.gz 3909420 SHA256 45e55f2374507bb67a9b9125f6b8d1c45e6cd33849c62b1d9cb56657354e359a SHA512 8cbf6b08bb21c6cbc3b5215a74ecdcce81e312484c688f2b20f95b7288d7f154e7f1337dd0c7d213687159d731bd4518166a964d6a1bda47dc2bd46115a55600 WHIRLPOOL ffd8f1afaece5762298fc8d3380ffe23ed79b5eb019e923d92fd408594054c2caf25e01b237b4cdc2c11181d93df6978301eecb44661378dc944dc89b3e6838a diff --git a/net-libs/libtorrent-rasterbar/files/libtorrent-rasterbar-1.0.11-fix-abicompat.patch b/net-libs/libtorrent-rasterbar/files/libtorrent-rasterbar-1.0.11-fix-abicompat.patch new file mode 100644 index 000000000000..eebee122551e --- /dev/null +++ b/net-libs/libtorrent-rasterbar/files/libtorrent-rasterbar-1.0.11-fix-abicompat.patch @@ -0,0 +1,157 @@ +From 76381835be19da2f8f1fc501445e31d32e6d83e4 Mon Sep 17 00:00:00 2001 +From: Arvid Norberg <arvid.norberg@gmail.com> +Date: Sun, 12 Feb 2017 21:05:22 -0500 +Subject: [PATCH] fix ABI compatibility issue introduced with preformatted + entry type (#1702) + +fix ABI compatibility issue introduced with preformatted entry type +--- + ChangeLog | 2 ++ + bindings/python/src/create_torrent.cpp | 2 +- + include/libtorrent/create_torrent.hpp | 6 ++++++ + src/create_torrent.cpp | 31 ++++++++++++++++++++++++++++--- + src/torrent.cpp | 11 ++++++++--- + test/test_create_torrent.cpp | 2 +- + 6 files changed, 46 insertions(+), 8 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 9b501ce..9defe7c 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,5 @@ ++ * fix ABI compatibility issue introduced with preformatted entry type ++ + 1.0.11 release + + * updating super seeding would include the torrent in state_update_alert +diff --git a/bindings/python/src/create_torrent.cpp b/bindings/python/src/create_torrent.cpp +index 55b6b51..31abb07 100644 +--- a/bindings/python/src/create_torrent.cpp ++++ b/bindings/python/src/create_torrent.cpp +@@ -127,7 +127,7 @@ void bind_create_torrent() + + class_<create_torrent>("create_torrent", no_init) + .def(init<file_storage&>()) +- .def(init<torrent_info const&>(arg("ti"))) ++ .def(init<torrent_info const&, int>((arg("ti"), arg("version") = LIBTORRENT_VERSION_NUM))) + .def(init<file_storage&, int, int, int>((arg("storage"), arg("piece_size") = 0 + , arg("pad_file_limit") = -1, arg("flags") = int(libtorrent::create_torrent::optimize)))) + +diff --git a/include/libtorrent/create_torrent.hpp b/include/libtorrent/create_torrent.hpp +index 05dc6ca..d55e86a 100644 +--- a/include/libtorrent/create_torrent.hpp ++++ b/include/libtorrent/create_torrent.hpp +@@ -42,6 +42,7 @@ POSSIBILITY OF SUCH DAMAGE. + #include "libtorrent/utf8.hpp" + #include "libtorrent/allocator.hpp" + #include "libtorrent/file.hpp" // for combine_path etc. ++#include "libtorrent/version.hpp" + + #include <vector> + #include <string> +@@ -171,9 +172,12 @@ namespace libtorrent + // ``alignment`` is used when pad files are enabled. This is the size + // eligible files are aligned to. The default is -1, which means the + // piece size of the torrent. ++ // The ``use_preformatted`` parameter can be set to true to preserve ++ // invalid encoding of the .torrent file. + create_torrent(file_storage& fs, int piece_size = 0 + , int pad_file_limit = -1, int flags = optimize, int alignment = -1); + create_torrent(torrent_info const& ti); ++ create_torrent(torrent_info const& ti, bool use_preformatted); + + // internal + ~create_torrent(); +@@ -290,6 +294,8 @@ namespace libtorrent + + private: + ++ void load_from_torrent_info(torrent_info const& ti, bool const use_preformatted); ++ + file_storage& m_files; + // if m_info_dict is initialized, it is + // used instead of m_files to generate +diff --git a/src/create_torrent.cpp b/src/create_torrent.cpp +index df4c759..aab5574 100644 +--- a/src/create_torrent.cpp ++++ b/src/create_torrent.cpp +@@ -330,6 +330,24 @@ namespace libtorrent + , m_include_symlinks(false) + , m_calculate_file_hashes(false) + { ++ load_from_torrent_info(ti, false); ++ } ++ ++ create_torrent::create_torrent(torrent_info const& ti, bool const use_preformatted) ++ : m_files(const_cast<file_storage&>(ti.files())) ++ , m_creation_date(time(0)) ++ , m_multifile(ti.num_files() > 1) ++ , m_private(ti.priv()) ++ , m_merkle_torrent(ti.is_merkle_torrent()) ++ , m_include_mtime(false) ++ , m_include_symlinks(false) ++ , m_calculate_file_hashes(false) ++ { ++ load_from_torrent_info(ti, use_preformatted); ++ } ++ ++ void create_torrent::load_from_torrent_info(torrent_info const& ti, bool const use_preformatted) ++ { + TORRENT_ASSERT(ti.is_valid()); + if (!ti.is_valid()) return; + +@@ -361,9 +379,16 @@ namespace libtorrent + m_piece_hash.resize(m_files.num_pieces()); + for (int i = 0; i < num_pieces(); ++i) set_hash(i, ti.hash_for_piece(i)); + +- boost::shared_array<char> const info = ti.metadata(); +- int const size = ti.metadata_size(); +- m_info_dict.preformatted().assign(&info[0], &info[0] + size); ++ if (use_preformatted) ++ { ++ boost::shared_array<char> const info = ti.metadata(); ++ int const size = ti.metadata_size(); ++ m_info_dict.preformatted().assign(&info[0], &info[0] + size); ++ } ++ else ++ { ++ m_info_dict = bdecode(&ti.metadata()[0], &ti.metadata()[0] + ti.metadata_size()); ++ } + m_info_hash = ti.info_hash(); + } + +diff --git a/src/torrent.cpp b/src/torrent.cpp +index 75f0cc7..ef05dfd 100644 +--- a/src/torrent.cpp ++++ b/src/torrent.cpp +@@ -5601,9 +5601,14 @@ namespace libtorrent + { + if (m_magnet_link || (m_save_resume_flags & torrent_handle::save_info_dict)) + { +- boost::shared_array<char> const info = torrent_file().metadata(); +- int const size = torrent_file().metadata_size(); +- ret["info"].preformatted().assign(&info[0], &info[0] + size); ++ ret["info"] = bdecode(&torrent_file().metadata()[0] ++ , &torrent_file().metadata()[0] + torrent_file().metadata_size()); ++// TODO: re-enable this code once there's a non-inlined encoder function. Or ++// perhaps this should not be used until saving resume_data via ++// add_torrent_params and a free function, similar to read_resume_data ++// boost::shared_array<char> const info = torrent_file().metadata(); ++// int const size = torrent_file().metadata_size(); ++// ret["info"].preformatted().assign(&info[0], &info[0] + size); + } + } + +diff --git a/test/test_create_torrent.cpp b/test/test_create_torrent.cpp +index 0a87c08..33fd3e8 100644 +--- a/test/test_create_torrent.cpp ++++ b/test/test_create_torrent.cpp +@@ -51,7 +51,7 @@ int test_main() + + lt::torrent_info info(test_torrent, sizeof(test_torrent) - 1); + +- lt::create_torrent t(info); ++ lt::create_torrent t(info, true); + + std::vector<char> buffer; + lt::bencode(std::back_inserter(buffer), t.generate()); diff --git a/net-libs/libtorrent-rasterbar/files/libtorrent-rasterbar-1.0.11-fix-test_ssl.patch b/net-libs/libtorrent-rasterbar/files/libtorrent-rasterbar-1.0.11-fix-test_ssl.patch new file mode 100644 index 000000000000..2add42c7dd2c --- /dev/null +++ b/net-libs/libtorrent-rasterbar/files/libtorrent-rasterbar-1.0.11-fix-test_ssl.patch @@ -0,0 +1,21 @@ +From 7f060e4a70b21974bcf154cf1a93c7b68c5a9aa8 Mon Sep 17 00:00:00 2001 +From: Alden Torres <aldenml@gmail.com> +Date: Sat, 8 Oct 2016 01:12:15 -0400 +Subject: [PATCH] fix openssl compilation with boost 1.62 (#1193) + +--- + test/test_ssl.cpp | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/test/test_ssl.cpp b/test/test_ssl.cpp +index 659973c..5aa6b15 100644 +--- a/test/test_ssl.cpp ++++ b/test/test_ssl.cpp +@@ -47,7 +47,6 @@ POSSIBILITY OF SUCH DAMAGE. + #include <boost/asio/connect.hpp> + + #ifdef TORRENT_USE_OPENSSL +-#include <boost/asio/ssl/error.hpp> // for asio::error::get_ssl_category() + #include <boost/asio/ssl.hpp> + + using namespace libtorrent; diff --git a/net-libs/libtorrent-rasterbar/files/libtorrent-rasterbar-1.0.11-move-header.patch b/net-libs/libtorrent-rasterbar/files/libtorrent-rasterbar-1.0.11-move-header.patch new file mode 100644 index 000000000000..589998b7fb3d --- /dev/null +++ b/net-libs/libtorrent-rasterbar/files/libtorrent-rasterbar-1.0.11-move-header.patch @@ -0,0 +1,34 @@ +From ecd20f15cb3fa5a0ebabd647b1f57f3cd62cb4b7 Mon Sep 17 00:00:00 2001 +From: sledgehammer_999 <hammered999@gmail.com> +Date: Mon, 20 Feb 2017 01:22:27 +0200 +Subject: [PATCH] Move include into implementation instead(from #1702). + +--- + bindings/python/src/create_torrent.cpp | 1 + + include/libtorrent/create_torrent.hpp | 1 - + 2 files changed, 1 insertion(+), 1 deletion(-) + +diff --git a/bindings/python/src/create_torrent.cpp b/bindings/python/src/create_torrent.cpp +index 31abb07..e856d85 100644 +--- a/bindings/python/src/create_torrent.cpp ++++ b/bindings/python/src/create_torrent.cpp +@@ -6,6 +6,7 @@ + #include <libtorrent/create_torrent.hpp> + #include <libtorrent/file_storage.hpp> + #include "libtorrent/intrusive_ptr_base.hpp" ++#include <libtorrent/version.hpp> + #include "bytes.hpp" + + using namespace boost::python; +diff --git a/include/libtorrent/create_torrent.hpp b/include/libtorrent/create_torrent.hpp +index d55e86a..8d2c680 100644 +--- a/include/libtorrent/create_torrent.hpp ++++ b/include/libtorrent/create_torrent.hpp +@@ -42,7 +42,6 @@ POSSIBILITY OF SUCH DAMAGE. + #include "libtorrent/utf8.hpp" + #include "libtorrent/allocator.hpp" + #include "libtorrent/file.hpp" // for combine_path etc. +-#include "libtorrent/version.hpp" + + #include <vector> + #include <string> diff --git a/net-libs/libtorrent-rasterbar/files/libtorrent-rasterbar-1.0.9-test_torrent_parse.patch b/net-libs/libtorrent-rasterbar/files/libtorrent-rasterbar-1.0.9-test_torrent_parse.patch new file mode 100644 index 000000000000..658c0aa57156 --- /dev/null +++ b/net-libs/libtorrent-rasterbar/files/libtorrent-rasterbar-1.0.9-test_torrent_parse.patch @@ -0,0 +1,41 @@ +From bdd91e29225b44a1a13e670dc4cecfb58f241d28 Mon Sep 17 00:00:00 2001 +From: Davide Pesavento <pesa@gentoo.org> +Date: Sun, 7 Aug 2016 12:14:57 +0200 +Subject: [PATCH] Disable failing torrent_parse tests + +For unknown reasons, some test torrents are missing from the tarball. +Skip the corresponding test cases to avoid spurious failures. +--- + test/test_torrent_parse.cpp | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/test/test_torrent_parse.cpp b/test/test_torrent_parse.cpp +index 663f341..2de6fb5 100644 +--- a/test/test_torrent_parse.cpp ++++ b/test/test_torrent_parse.cpp +@@ -49,13 +49,10 @@ using namespace libtorrent; + test_torrent_t test_torrents[] = + { + { "base.torrent" }, +- { "empty_path.torrent" }, + { "parent_path.torrent" }, + { "hidden_parent_path.torrent" }, + { "single_multi_file.torrent" }, + { "slash_path.torrent" }, +- { "slash_path2.torrent" }, +- { "slash_path3.torrent" }, + { "backslash_path.torrent" }, + { "url_list.torrent" }, + { "url_list2.torrent" }, +@@ -75,8 +72,6 @@ test_torrent_t test_torrents[] = + { "root_hash.torrent" }, + { "empty_path_multi.torrent" }, + { "duplicate_web_seeds.torrent" }, +- { "invalid_name3.torrent" }, +- { "symlink1.torrent" }, + }; + + struct test_failing_torrent_t +-- +2.9.2 + diff --git a/net-libs/libtorrent-rasterbar/libtorrent-rasterbar-1.0.10.ebuild b/net-libs/libtorrent-rasterbar/libtorrent-rasterbar-1.0.10.ebuild new file mode 100644 index 000000000000..b5f9a0b39537 --- /dev/null +++ b/net-libs/libtorrent-rasterbar/libtorrent-rasterbar-1.0.10.ebuild @@ -0,0 +1,111 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +PYTHON_COMPAT=( python2_7 python3_{4,5} ) +PYTHON_REQ_USE="threads" +DISTUTILS_OPTIONAL=true +DISTUTILS_IN_SOURCE_BUILD=true + +inherit distutils-r1 eutils versionator + +MY_PV=$(replace_all_version_separators _) + +DESCRIPTION="C++ BitTorrent implementation focusing on efficiency and scalability" +HOMEPAGE="http://libtorrent.org" +SRC_URI="https://github.com/arvidn/libtorrent/releases/download/libtorrent-${MY_PV}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0/8" +KEYWORDS="amd64 arm ppc ppc64 sparc x86 ~x86-fbsd" +IUSE="debug +dht doc examples +geoip libressl python +ssl static-libs test" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +RDEPEND=" + dev-libs/boost:=[threads] + virtual/libiconv + examples? ( !net-p2p/mldonkey ) + geoip? ( dev-libs/geoip ) + python? ( + ${PYTHON_DEPS} + dev-libs/boost:=[python,${PYTHON_USEDEP}] + ) + ssl? ( + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:= ) + ) +" +DEPEND="${RDEPEND} + sys-devel/libtool +" + +PATCHES=( + "${FILESDIR}/${PN}-1.0.9-test_torrent_parse.patch" + # master branch + "${FILESDIR}/${PN}-1.0.11-fix-test_ssl.patch" +) + +src_prepare() { + default + + # bug 578026 + # prepend -L${S}/... to ensure bindings link against the lib we just built + sed -i -e "s|^|-L${S}/src/.libs |" bindings/python/compile_flags.in || die + + use python && distutils-r1_src_prepare +} + +src_configure() { + local myeconfargs=( + $(use_enable debug) + $(use_enable debug logging) + $(use_enable debug statistics) + $(use_enable debug disk-stats) + $(use_enable dht dht $(usex debug logging yes)) + $(use_enable examples) + $(use_enable geoip) + $(use_with geoip libgeoip) + $(use_enable ssl encryption) + $(use_enable static-libs static) + $(use_enable test tests) + --with-libiconv + ) + econf "${myeconfargs[@]}" + + if use python; then + myeconfargs+=( + --enable-python-binding + --with-boost-python + ) + python_configure() { + econf "${myeconfargs[@]}" + } + distutils-r1_src_configure + fi +} + +src_compile() { + default + + python_compile() { + cd "${BUILD_DIR}/../bindings/python" || die + distutils-r1_python_compile + } + use python && distutils-r1_src_compile +} + +src_install() { + use doc && HTML_DOCS+=( "${S}"/docs ) + + default + + python_install() { + cd "${BUILD_DIR}/../bindings/python" || die + distutils-r1_python_install + } + use python && distutils-r1_src_install + + prune_libtool_files +} diff --git a/net-libs/libtorrent-rasterbar/libtorrent-rasterbar-1.0.11.ebuild b/net-libs/libtorrent-rasterbar/libtorrent-rasterbar-1.0.11.ebuild new file mode 100644 index 000000000000..956de7c8054b --- /dev/null +++ b/net-libs/libtorrent-rasterbar/libtorrent-rasterbar-1.0.11.ebuild @@ -0,0 +1,116 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +PYTHON_COMPAT=( python2_7 python3_{4,5} ) +PYTHON_REQ_USE="threads" +DISTUTILS_OPTIONAL=true +DISTUTILS_IN_SOURCE_BUILD=true + +inherit distutils-r1 versionator + +MY_PV=$(replace_all_version_separators _) + +DESCRIPTION="C++ BitTorrent implementation focusing on efficiency and scalability" +HOMEPAGE="http://libtorrent.org" +SRC_URI="https://github.com/arvidn/libtorrent/releases/download/libtorrent-${MY_PV}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0/8" +KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" +IUSE="debug +dht doc examples +geoip libressl python +ssl static-libs test" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +COMMON_DEPEND=" + dev-libs/boost:=[threads] + virtual/libiconv + geoip? ( dev-libs/geoip ) + python? ( + ${PYTHON_DEPS} + dev-libs/boost:=[python,${PYTHON_USEDEP}] + ) + ssl? ( + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:= ) + ) +" +DEPEND="${COMMON_DEPEND} + sys-devel/libtool +" +RDEPEND="${COMMON_DEPEND} + examples? ( !net-p2p/mldonkey ) +" + +PATCHES=( + "${FILESDIR}/${PN}-1.0.9-test_torrent_parse.patch" + # RC_1_0 branch + "${FILESDIR}/${P}-fix-abicompat.patch" + "${FILESDIR}/${P}-move-header.patch" + # master branch + "${FILESDIR}/${P}-fix-test_ssl.patch" +) + +src_prepare() { + default + + # bug 578026 + # prepend -L${S}/... to ensure bindings link against the lib we just built + sed -i -e "s|^|-L${S}/src/.libs |" bindings/python/compile_flags.in || die + + use python && distutils-r1_src_prepare +} + +src_configure() { + local myeconfargs=( + $(use_enable debug) + $(use_enable debug logging) + $(use_enable debug statistics) + $(use_enable debug disk-stats) + $(use_enable dht dht $(usex debug logging yes)) + $(use_enable examples) + $(use_enable geoip) + $(use_with geoip libgeoip) + $(use_enable ssl encryption) + $(use_enable static-libs static) + $(use_enable test tests) + --with-libiconv + ) + econf "${myeconfargs[@]}" + + if use python; then + myeconfargs+=( + --enable-python-binding + --with-boost-python + ) + python_configure() { + econf "${myeconfargs[@]}" + } + distutils-r1_src_configure + fi +} + +src_compile() { + default + + python_compile() { + cd "${BUILD_DIR}/../bindings/python" || die + distutils-r1_python_compile + } + use python && distutils-r1_src_compile +} + +src_install() { + use doc && HTML_DOCS+=( "${S}"/docs ) + + default + + python_install() { + cd "${BUILD_DIR}/../bindings/python" || die + distutils-r1_python_install + } + use python && distutils-r1_src_install + + find "${D}" -name '*.la' -delete || die +} diff --git a/net-libs/libtorrent-rasterbar/libtorrent-rasterbar-1.1.1.ebuild b/net-libs/libtorrent-rasterbar/libtorrent-rasterbar-1.1.1.ebuild new file mode 100644 index 000000000000..3de47f94ee69 --- /dev/null +++ b/net-libs/libtorrent-rasterbar/libtorrent-rasterbar-1.1.1.ebuild @@ -0,0 +1,101 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +PYTHON_COMPAT=( python2_7 python3_{4,5} ) +PYTHON_REQ_USE="threads" +DISTUTILS_OPTIONAL=true +DISTUTILS_IN_SOURCE_BUILD=true + +inherit distutils-r1 eutils versionator + +MY_PV=$(replace_all_version_separators _) + +DESCRIPTION="C++ BitTorrent implementation focusing on efficiency and scalability" +HOMEPAGE="http://libtorrent.org" +SRC_URI="https://github.com/arvidn/libtorrent/releases/download/libtorrent-${MY_PV}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0/9" +KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" +IUSE="debug +dht doc examples libressl python +ssl static-libs test" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +RDEPEND=" + dev-libs/boost:=[threads] + virtual/libiconv + examples? ( !net-p2p/mldonkey ) + python? ( + ${PYTHON_DEPS} + dev-libs/boost:=[python,${PYTHON_USEDEP}] + ) + ssl? ( + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:= ) + ) +" +DEPEND="${RDEPEND} + sys-devel/libtool +" + +src_prepare() { + default + + # bug 578026 + # prepend -L${S}/... to ensure bindings link against the lib we just built + sed -i -e "s|^|-L${S}/src/.libs |" bindings/python/compile_flags.in || die + + use python && distutils-r1_src_prepare +} + +src_configure() { + local myeconfargs=( + $(use_enable debug) + $(use_enable debug logging) + $(use_enable debug disk-stats) + $(use_enable dht dht $(usex debug logging yes)) + $(use_enable examples) + $(use_enable ssl encryption) + $(use_enable static-libs static) + $(use_enable test tests) + --with-libiconv + ) + econf "${myeconfargs[@]}" + + if use python; then + myeconfargs+=( + --enable-python-binding + --with-boost-python + ) + python_configure() { + econf "${myeconfargs[@]}" + } + distutils-r1_src_configure + fi +} + +src_compile() { + default + + python_compile() { + cd "${BUILD_DIR}/../bindings/python" || die + distutils-r1_python_compile + } + use python && distutils-r1_src_compile +} + +src_install() { + use doc && HTML_DOCS+=( "${S}"/docs ) + + default + + python_install() { + cd "${BUILD_DIR}/../bindings/python" || die + distutils-r1_python_install + } + use python && distutils-r1_src_install + + prune_libtool_files +} diff --git a/net-libs/libtorrent-rasterbar/libtorrent-rasterbar-1.1.2.ebuild b/net-libs/libtorrent-rasterbar/libtorrent-rasterbar-1.1.2.ebuild new file mode 100644 index 000000000000..91626938f9c7 --- /dev/null +++ b/net-libs/libtorrent-rasterbar/libtorrent-rasterbar-1.1.2.ebuild @@ -0,0 +1,102 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +PYTHON_COMPAT=( python2_7 python3_{4,5} ) +PYTHON_REQ_USE="threads" +DISTUTILS_OPTIONAL=true +DISTUTILS_IN_SOURCE_BUILD=true + +inherit distutils-r1 eutils versionator + +MY_PV=$(replace_all_version_separators _) + +DESCRIPTION="C++ BitTorrent implementation focusing on efficiency and scalability" +HOMEPAGE="http://libtorrent.org" +SRC_URI="https://github.com/arvidn/libtorrent/releases/download/libtorrent-${MY_PV}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0/9" +KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" +IUSE="debug +dht doc examples libressl python +ssl static-libs test" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +RDEPEND=" + dev-libs/boost:=[threads] + virtual/libiconv + examples? ( !net-p2p/mldonkey ) + python? ( + ${PYTHON_DEPS} + dev-libs/boost:=[python,${PYTHON_USEDEP}] + ) + ssl? ( + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:= ) + ) +" +DEPEND="${RDEPEND} + sys-devel/libtool +" + +src_prepare() { + default + + # bug 578026 + # prepend -L${S}/... to ensure bindings link against the lib we just built + sed -i -e "s|^|-L${S}/src/.libs |" bindings/python/link_flags.in || die + + # prepend -I${S}/... to ensure bindings use the right headers + sed -i -e "s|^|-I${S}/src/include |" bindings/python/compile_flags.in || die + + use python && distutils-r1_src_prepare +} + +src_configure() { + local myeconfargs=( + $(use_enable debug) + $(use_enable debug logging) + $(use_enable debug disk-stats) + $(use_enable dht dht $(usex debug logging yes)) + $(use_enable examples) + $(use_enable ssl encryption) + $(use_enable static-libs static) + $(use_enable test tests) + --with-libiconv + ) + econf "${myeconfargs[@]}" + + if use python; then + python_configure() { + econf "${myeconfargs[@]}" \ + --enable-python-binding \ + --with-boost-python="${EPYTHON#python}" + } + distutils-r1_src_configure + fi +} + +src_compile() { + default + + python_compile() { + cd "${BUILD_DIR}/../bindings/python" || die + distutils-r1_python_compile + } + use python && distutils-r1_src_compile +} + +src_install() { + use doc && HTML_DOCS+=( "${S}"/docs ) + + default + + python_install() { + cd "${BUILD_DIR}/../bindings/python" || die + distutils-r1_python_install + } + use python && distutils-r1_src_install + + prune_libtool_files +} diff --git a/net-libs/libtorrent-rasterbar/metadata.xml b/net-libs/libtorrent-rasterbar/metadata.xml new file mode 100644 index 000000000000..4133516fb4f6 --- /dev/null +++ b/net-libs/libtorrent-rasterbar/metadata.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>hwoarang@gentoo.org</email> + <name>Markos Chandras</name> + </maintainer> + <upstream> + <remote-id type="google-code">libtorrent</remote-id> + <remote-id type="sourceforge">libtorrent</remote-id> + <remote-id type="github">arvidn/libtorrent</remote-id> + </upstream> + <use> + <flag name="dht">Enable DHT (distributed hash table) support</flag> + </use> +</pkgmetadata> |