commit:     d62b2acaa5cb2dc34e228e70bb4f48e1a1810466
Author:     Sean Vig <sean.v.775 <AT> gmail <DOT> com>
AuthorDate: Wed Sep  2 18:33:22 2015 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Thu Sep  3 13:16:48 2015 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=d62b2aca

dev-python/nbformat: Add doc use flag

 dev-python/nbformat/ChangeLog            |  3 +++
 dev-python/nbformat/nbformat-9999.ebuild | 24 +++++++++++++++++++++++-
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/dev-python/nbformat/ChangeLog b/dev-python/nbformat/ChangeLog
index 0528adb..4d18ae0 100644
--- a/dev-python/nbformat/ChangeLog
+++ b/dev-python/nbformat/ChangeLog
@@ -2,6 +2,9 @@
 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
 # $Id$
 
+  02 Sep 2015; Sean Vig <sean.v....@gmail.com> nbformat-9999.ebuild:
+  dev-python/nbformat: Add doc use flag
+
   27 Aug 2015; Marius Brehler <mar...@linux.sungazer.de> nbformat-9999.ebuild:
   dev-python/nbformat: Fix deps
 

diff --git a/dev-python/nbformat/nbformat-9999.ebuild 
b/dev-python/nbformat/nbformat-9999.ebuild
index c867ecf..a653a05 100644
--- a/dev-python/nbformat/nbformat-9999.ebuild
+++ b/dev-python/nbformat/nbformat-9999.ebuild
@@ -21,7 +21,7 @@ fi
 
 LICENSE="BSD"
 SLOT="0"
-IUSE="test"
+IUSE="doc test"
 
 RDEPEND="
        dev-python/jsonschema[${PYTHON_USEDEP}]
@@ -30,14 +30,36 @@ RDEPEND="
        dev-python/jupyter_core[${PYTHON_USEDEP}]
        "
 DEPEND="${RDEPEND}
+       doc? (
+               dev-python/sphinx[${PYTHON_USEDEP}]
+               dev-python/numpydoc[${PYTHON_USEDEP}]
+       )
        test? (
                dev-python/nose[${PYTHON_USEDEP}]
                dev-python/coverage[${PYTHON_USEDEP}]
        )
        "
 
+python_prepare_all() {
+       # Prevent un-needed download during build
+       if use doc; then
+               sed -e "/^    'sphinx.ext.intersphinx',/d" -i docs/conf.py || 
die
+       fi
+
+       distutils-r1_python_prepare_all
+}
+
+python_compile_all() {
+       use doc && emake -C docs html
+}
+
 python_test() {
        distutils_install_for_testing
        cd "${TEST_DIR}"/lib || die
        nosetests --with-coverage --cover-package=nbformat nbformat || die
 }
+
+python_install_all() {
+       use doc && HTML_DOCS=( docs/_build/html/. )
+       distutils-r1_python_install_all
+}

Reply via email to