commit:     ffa8bb31531324b7898cd417eb868931cfa84b50
Author:     PPed72 <paolo.pedroni <AT> iol <DOT> it>
AuthorDate: Fri Apr 15 13:35:19 2016 +0000
Commit:     Patrice Clement <monsieurp <AT> gentoo <DOT> org>
CommitDate: Thu Apr 21 19:46:55 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ffa8bb31

net-libs/rb_libtorrent: fix linking of python bindings

Thanks to Jan Chren (rindeal) <dev.rindeal+bugs.gentoo.org <AT> gmail.com>
for the ebuild, I've simply ported the good bits to the current one.

Gentoo-Bug: https://bugs.gentoo.org/576910
Closes: https://github.com/gentoo/gentoo/pull/1262

Signed-off-by: Patrice Clement <monsieurp <AT> gentoo.org>

 net-libs/rb_libtorrent/metadata.xml                |  4 +
 .../rb_libtorrent/rb_libtorrent-1.0.9-r1.ebuild    | 99 ++++++++++++++++++++++
 2 files changed, 103 insertions(+)

diff --git a/net-libs/rb_libtorrent/metadata.xml 
b/net-libs/rb_libtorrent/metadata.xml
index c0cbcd2..36ca5cc 100644
--- a/net-libs/rb_libtorrent/metadata.xml
+++ b/net-libs/rb_libtorrent/metadata.xml
@@ -10,4 +10,8 @@
     <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 for
+      libtorrent</flag>
+  </use>
 </pkgmetadata>

diff --git a/net-libs/rb_libtorrent/rb_libtorrent-1.0.9-r1.ebuild 
b/net-libs/rb_libtorrent/rb_libtorrent-1.0.9-r1.ebuild
new file mode 100644
index 0000000..9476aa4
--- /dev/null
+++ b/net-libs/rb_libtorrent/rb_libtorrent-1.0.9-r1.ebuild
@@ -0,0 +1,99 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 python3_{4,5} )
+PYTHON_REQ_USE="threads"
+DISTUTILS_OPTIONAL=true
+DISTUTILS_IN_SOURCE_BUILD=true
+
+inherit autotools distutils-r1 versionator
+
+MY_PV=$(replace_all_version_separators '_' )
+S=${WORKDIR}/libtorrent-libtorrent-${MY_PV}
+
+DESCRIPTION="C++ BitTorrent implementation focusing on efficiency and 
scalability"
+HOMEPAGE="http://libtorrent.org";
+SRC_URI="https://github.com/arvidn/libtorrent/archive/libtorrent-${MY_PV}.tar.gz
 -> rb_libtorrent-${PV}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
+IUSE="debug +dht doc examples python +ssl static-libs test"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="
+       >=dev-libs/boost-1.53:=[threads]
+       sys-libs/zlib
+       virtual/libiconv
+       examples? ( !net-p2p/mldonkey )
+       ssl? ( dev-libs/openssl:0= )
+       python? (
+               ${PYTHON_DEPS}
+               dev-libs/boost:=[python,${PYTHON_USEDEP}]
+       )"
+DEPEND="${RDEPEND}
+       >=sys-devel/libtool-2.2"
+
+RESTRICT="test"
+
+src_prepare() {
+       default
+
+       # needed or else eautoreconf fails
+       mkdir build-aux && cp {m4,build-aux}/config.rpath || die
+
+       eautoreconf
+
+       use python && python_copy_sources
+}
+
+src_configure() {
+       local myeconfargs=(
+               --disable-silent-rules # bug 441842
+               --with-boost-system=mt
+               --with-libiconv
+               $(use_enable debug)
+               $(usex debug "--enable-logging=verbose" "")
+               $(use_enable dht)
+               $(use_enable examples)
+               $(use_enable ssl encryption)
+               $(use_enable static-libs static)
+               $(use_enable test tests)
+       )
+       econf "${myeconfargs[@]}"
+
+       python_configure() {
+               local myeconfargs+=(
+                       --enable-python-binding
+                       --with-boost-python=yes
+               )
+               econf "${myeconfargs[@]}"
+       }
+       use python && distutils-r1_src_configure
+}
+
+src_compile() {
+       default
+
+       python_compile() {
+               cd "${BUILD_DIR}/../bindings/python" || return 1
+               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" || return 1
+               distutils-r1_python_install
+       }
+       use python && distutils-r1_src_install
+}

Reply via email to