Gentoo Archives: gentoo-commits

From: Matt Thode <prometheanfire@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/networkx/
Date: Tue, 13 Feb 2018 20:46:56
Message-Id: 1518554799.4e7b4e0cb3e208a413eafc899d800f62e48aa0c5.prometheanfire@gentoo
1 commit: 4e7b4e0cb3e208a413eafc899d800f62e48aa0c5
2 Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 13 20:45:51 2018 +0000
4 Commit: Matt Thode <prometheanfire <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 13 20:46:39 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4e7b4e0c
7
8 dev-python/networkx: make scipy an optional dep
9
10 Package-Manager: Portage-2.3.19, Repoman-2.3.6
11
12 dev-python/networkx/metadata.xml | 3 ++
13 dev-python/networkx/networkx-1.11-r1.ebuild | 75 +++++++++++++++++++++++++++++
14 2 files changed, 78 insertions(+)
15
16 diff --git a/dev-python/networkx/metadata.xml b/dev-python/networkx/metadata.xml
17 index 10664d364e8..dff6872815b 100644
18 --- a/dev-python/networkx/metadata.xml
19 +++ b/dev-python/networkx/metadata.xml
20 @@ -20,4 +20,7 @@
21 <remote-id type="pypi">networkx</remote-id>
22 <remote-id type="github">networkx/networkx</remote-id>
23 </upstream>
24 + <use>
25 + <flag name="scipy">Enables scipy backend</flag>
26 + </use>
27 </pkgmetadata>
28
29 diff --git a/dev-python/networkx/networkx-1.11-r1.ebuild b/dev-python/networkx/networkx-1.11-r1.ebuild
30 new file mode 100644
31 index 00000000000..e94f2e4f484
32 --- /dev/null
33 +++ b/dev-python/networkx/networkx-1.11-r1.ebuild
34 @@ -0,0 +1,75 @@
35 +# Copyright 1999-2018 Gentoo Foundation
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=6
39 +
40 +PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
41 +
42 +inherit distutils-r1 virtualx
43 +
44 +DESCRIPTION="Python tools to manipulate graphs and complex networks"
45 +HOMEPAGE="http://networkx.github.io/ https://github.com/networkx/networkx"
46 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
47 +
48 +LICENSE="BSD"
49 +SLOT="0"
50 +KEYWORDS="~amd64 ~arm64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
51 +IUSE="doc examples scipy test"
52 +
53 +REQUIRED_USE="doc? ( || ( $(python_gen_useflags -2) ) )"
54 +
55 +COMMON_DEPEND="
56 + dev-python/matplotlib[${PYTHON_USEDEP}]
57 + scipy? ( sci-libs/scipy[${PYTHON_USEDEP}] )"
58 +DEPEND="
59 + dev-python/setuptools[${PYTHON_USEDEP}]
60 + doc? (
61 + dev-python/sphinx[${PYTHON_USEDEP}]
62 + dev-python/matplotlib[${PYTHON_USEDEP}]
63 + $(python_gen_cond_dep 'dev-python/numpydoc[${PYTHON_USEDEP}]' python2_7)
64 + $(python_gen_cond_dep 'dev-python/sphinx_rtd_theme[${PYTHON_USEDEP}]' python2_7 python{3_3,3_4})
65 + )
66 + test? (
67 + ${COMMON_DEPEND}
68 + dev-python/nose[${PYTHON_USEDEP}]
69 + $(python_gen_cond_dep 'dev-python/pydot[${PYTHON_USEDEP}]' -2)
70 + )"
71 +RDEPEND="
72 + >=dev-python/decorator-3.4.0[${PYTHON_USEDEP}]
73 + examples? (
74 + ${COMMON_DEPEND}
75 + dev-python/pygraphviz[${PYTHON_USEDEP}]
76 + dev-python/pyparsing[${PYTHON_USEDEP}]
77 + dev-python/pyyaml[${PYTHON_USEDEP}]
78 + )"
79 +
80 +PATCHES=(
81 + "${FILESDIR}"/1.11-sphinx-pngmath.patch
82 +)
83 +
84 +python_prepare_all() {
85 + # Avoid d'loading of file objects.inv from 2 sites of python docs
86 + sed -e "s/'sphinx.ext.intersphinx', //" -i doc/source/conf.py || die
87 + distutils-r1_python_prepare_all
88 +}
89 +
90 +python_compile_all() {
91 + if use doc; then
92 + python_setup -2
93 + emake -C doc html
94 + fi
95 +}
96 +
97 +python_test() {
98 + virtx nosetests -vv || die
99 +}
100 +
101 +python_install_all() {
102 + # Oh my.
103 + rm -r "${ED}"usr/share/doc/${P} || die
104 +
105 + use doc && local HTML_DOCS=( doc/build/html/. )
106 + use examples && dodoc -r examples
107 +
108 + distutils-r1_python_install_all
109 +}