From 6bf3765eccd650ab2a64eea01a7d603b5698aead Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 7 Sep 2014 20:55:57 -0700 Subject: [PATCH] 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 --- dev-python/flask-cors/flask-cors-9999.ebuild | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/dev-python/flask-cors/flask-cors-9999.ebuild b/dev-python/flask-cors/flask-cors-9999.ebuild index 0534d2b..343eaf1 100644 --- a/dev-python/flask-cors/flask-cors-9999.ebuild +++ b/dev-python/flask-cors/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 -- 2.26.2