From: W. Trevor King Date: Mon, 8 Sep 2014 03:55:57 +0000 (-0700) Subject: dev-python/flask-cors: Drop ROOT and use stricter python-docs dependencies X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5ae57b21ad05167784e1bb6a8b371d0693280f6f;p=wtk-overlay.git dev-python/flask-cors: Drop ROOT and use stricter python-docs dependencies We're not supposed to use ROOT in ebuild functions (see the discussion in f3893ec9, dev-python/flask-cors/flask-cors-9999.ebuild: Use local intersphinx, 2014-09-02). I had been using it to build against the objects.inv from that ROOT, but we're actually supposed to build against the local (non-ROOT) copy [1]: ROOT isn't used for library dependencies. When building, libraries, headers etc. on / have to be used. Cross-compiling etc is done by configuring the toolchain correctly, not by hacking ebuilds in a way that breaks binary packages. I'm also using equery to list the python-docs files (on /), to avoid hard-coding /usr/share/doc"/python-docs-*/html. equery knows what was installed, and I really don't care where it is, so long as I can find the objects.inv (and so long as that's the directory with the HTML docs too). Finally, the python-docs dependencies make sure we accept any of the python-docs versions that install objects.inv [2]. Ian Delaney bumped versions to -r1 so we could determine if objects.inv was installed, and Ian Stakenvicius pointed out the slotted approach to the disjoint dependency. [1]: https://bugs.gentoo.org/show_bug.cgi?id=258125#c0 [2]: https://bugs.gentoo.org/show_bug.cgi?id=521768 Thanks-to: Ian Delaney Thanks-to: Ian Stakenvicius --- diff --git a/flask-cors-9999.ebuild b/flask-cors-9999.ebuild index 0534d2b..343eaf1 100644 --- a/flask-cors-9999.ebuild +++ b/flask-cors-9999.ebuild @@ -32,7 +32,12 @@ DEPEND=" dev-python/setuptools[${PYTHON_USEDEP}] doc? ( ${RDEPEND} - dev-python/python-docs[${PYTHON_USEDEP}] + app-portage/gentoolkit + || ( + >=dev-python/python-docs-3.4.0-r1 + >=dev-python/python-docs-3.3.5-r1:3.3 + >=dev-python/python-docs-2.7.6-r1:2.7 + ) dev-python/sphinx_rtd_theme[${PYTHON_USEDEP}] ) test? ( @@ -44,15 +49,12 @@ S="${WORKDIR}/${MY_P}" python_prepare_all() { if use doc; then - local PYTHON_DOC_INVENTORIES=$(ls "${EROOT}usr/share/doc"/python-docs-*/html/objects.inv) - local PYTHON_DOC_INVENTORY="${PYTHON_DOC_INVENTORIES##* -}" - local PYTHON_DOC="${PYTHON_DOC_INVENTORY##${ROOT%/}}" - PYTHON_DOC="${PYTHON_DOC%%objects.inv}" - if [[ -z "${PYTHON_DOC}" ]] + local PYTHON_DOC_INVENTORY=$(equery files python-docs | grep objects.inv | tail -n1) + if [[ -z "${PYTHON_DOC_INVENTORY}" ]] then - die "python-docs not found in ${EROOT}usr/share/doc" + die "objects.inv not found in python-docs" fi + PYTHON_DOC="${PYTHON_DOC_INVENTORY%%objects.inv}" sed -i "s|'http://docs.python.org/': None|'${PYTHON_DOC}': '${PYTHON_DOC_INVENTORY}'|" docs/conf.py || die fi distutils-r1_python_prepare_all