dev-python/flask-cors/flask-cors-9999.ebuild: Use local intersphinx
[wtk-overlay.git] / dev-python / flask-cors / flask-cors-9999.ebuild
index 5bc0f95a37bf67385a34b82ff383ac9171fc8274..0534d2b2ef1cf43ff73113148fc224e43e6046f0 100644 (file)
@@ -32,6 +32,7 @@ DEPEND="
        dev-python/setuptools[${PYTHON_USEDEP}]
        doc? (
                ${RDEPEND}
+               dev-python/python-docs[${PYTHON_USEDEP}]
                dev-python/sphinx_rtd_theme[${PYTHON_USEDEP}]
        )
        test? (
@@ -41,6 +42,22 @@ DEPEND="
 
 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}" ]]
+               then
+                       die "python-docs not found in ${EROOT}usr/share/doc"
+               fi
+               sed -i "s|'http://docs.python.org/': None|'${PYTHON_DOC}': '${PYTHON_DOC_INVENTORY}'|" docs/conf.py || die
+       fi
+       distutils-r1_python_prepare_all
+}
+
 python_compile_all() {
        use doc && emake -C docs html
 }