commit:     1c2a2775c14e6f82d1eb4e7b0bda8f068723a34a
Author:     Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 25 22:02:45 2016 +0000
Commit:     Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
CommitDate: Sun Dec 25 22:03:12 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1c2a2775

net-libs/xrootd: add python support

- Add support for python bindings, upstream support only
python-2.{4..7}.
- Optionally install python docs and examples.
- Add perl dep for provided utils.

Package-Manager: portage-2.3.3
Signed-off-by: Andrew Savchenko <bircoph <AT> gentoo.org>

 net-libs/xrootd/xrootd-4.5.0.ebuild | 51 +++++++++++++++++++++++++++++--------
 1 file changed, 41 insertions(+), 10 deletions(-)

diff --git a/net-libs/xrootd/xrootd-4.5.0.ebuild 
b/net-libs/xrootd/xrootd-4.5.0.ebuild
index c7f7625..c48d44f 100644
--- a/net-libs/xrootd/xrootd-4.5.0.ebuild
+++ b/net-libs/xrootd/xrootd-4.5.0.ebuild
@@ -4,7 +4,9 @@
 
 EAPI=6
 
-inherit cmake-utils user
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils python-single-r1 user
 
 DESCRIPTION="Extended ROOT remote file server"
 HOMEPAGE="http://xrootd.org/";
@@ -13,26 +15,38 @@ SRC_URI="http://xrootd.org/download/v${PV}/${P}.tar.gz";
 LICENSE="LGPL-3"
 SLOT="0"
 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
-IUSE="doc fuse http kerberos readline rbd ssl test"
+IUSE="doc examples fuse http kerberos python readline rbd ssl test"
 
-RDEPEND="
+CDEPEND="
        !<sci-physics/root-5.32[xrootd]
        sys-libs/zlib
        fuse? ( sys-fs/fuse )
        kerberos? ( virtual/krb5 )
+       python? ( ${PYTHON_DEPS} )
        rbd? ( sys-cluster/ceph )
        readline? ( sys-libs/readline:0= )
-       ssl? ( dev-libs/openssl:0= )"
-DEPEND="${RDEPEND}
-       doc? ( app-doc/doxygen[dot] )
-       test? ( dev-util/cppunit )"
-
-REQUIRED_USE="http? ( kerberos ssl )"
+       ssl? ( dev-libs/openssl:0= )
+"
+DEPEND="${CDEPEND}
+       doc? (
+               app-doc/doxygen[dot]
+               python? ( dev-python/sphinx )
+       )
+       test? ( dev-util/cppunit )
+"
+RDEPEND="${CDEPEND}
+       dev-lang/perl
+"
+REQUIRED_USE="
+       http? ( kerberos ssl )
+       python? ( ${PYTHON_REQUIRED_USE} )
+"
 PATCHES=( "${FILESDIR}"/${PN}-no-werror.patch )
 
 pkg_setup() {
        enewgroup xrootd
        enewuser xrootd -1 -1 "${EPREFIX}"/var/spool/xrootd xrootd
+       use python && python_setup
 }
 
 src_configure() {
@@ -42,7 +56,7 @@ src_configure() {
                -DENABLE_FUSE=$(usex fuse)
                -DENABLE_HTTP=$(usex http)
                -DENABLE_KRB5=$(usex kerberos)
-               -DENABLE_PYTHON=OFF # TODO: install python bindings properly
+               -DENABLE_PYTHON=$(usex python)
                -DENABLE_READLINE=$(usex readline)
                -DENABLE_TESTS=$(usex test)
        )
@@ -53,6 +67,9 @@ src_compile() {
        cmake-utils_src_compile
        if use doc; then
                doxygen Doxyfile || die
+               if use python; then
+                       emake -C bindings/python/docs html
+               fi
        fi
 }
 
@@ -76,4 +93,18 @@ src_install() {
        done
        # all daemons MUST use single master config file
        newconfd "${FILESDIR}"/xrootd.confd xrootd
+
+       if use python; then
+               python_optimize "${D}/$(python_get_sitedir)"
+
+               if use doc; then
+                       docinto python
+                       docompress -x "/usr/share/doc/${PF}/python/html"
+                       dodoc -r bindings/python/docs/build/html
+               fi
+               if use examples; then
+                       docinto python
+                       dodoc -r bindings/python/examples
+               fi
+       fi
 }

Reply via email to