• [gentoo-dev] [PATCH 1/2] docs.eclass: allow multiple documentation buil

    From Andrew Ammerlaan@21:1/5 to All on Thu Nov 10 12:30:01 2022
    diff --git a/eclass/docs.eclass b/eclass/docs.eclass
    index 611485c227f..f7a82939a53 100644
    --- a/eclass/docs.eclass
    +++ b/eclass/docs.eclass
    @@ -207,16 +207,15 @@ sphinx_deps() {
    }

    # @FUNCTION: sphinx_compile
    -# @INTERNAL
    # @DESCRIPTION:
    # Calls sphinx to build docs.
    -#
    -# If you overwrite python_compile_all do not call
    -# this function, call docs_compile instead
    sphinx_compile() {
    debug-print-function ${FUNCNAME}
    use doc || return

    + : ${DOCS_DIR:="${S}"}
    + : ${DOCS_OUTDIR:="${S}/_build/html/sphinx"}
    +
    local confpy=${DOCS_DIR}/conf.py
    [[ -f ${confpy} ]] ||
    die "${FUNCNAME}: ${confpy} not found, DOCS_DIR=${DOCS_DIR} call wrong"
    @@ -236,6 +235,12 @@ sphinx_compile() {
    # not all packages include the Makefile in pypi tarball
    sphinx-build -b html -d "${DOCS_OUTDIR}"/_build/doctrees "${DOCS_DIR}" \
    "${DOCS_OUTDIR}" || die "${FUNCNAME}: sphinx-build failed"
    +
    + HTML_DOCS+=( "${DOCS_OUTDIR}" )
    +
    + # We don't need these any more, unset them in case we want to call a
    + # second documentation builder.
    + unset DOCS_DIR DOCS_OUTDIR
    }

    #