From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0BE2E158020 for ; Thu, 10 Nov 2022 11:29:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AFBBEE09C3; Thu, 10 Nov 2022 11:29:08 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 74C7CE09C0 for ; Thu, 10 Nov 2022 11:29:08 +0000 (UTC) Message-ID: <32ed3f0d-e18d-ce92-9dc4-5e03a0ad07e4@gentoo.org> Date: Thu, 10 Nov 2022 12:29:05 +0100 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Content-Language: en-US, nl-NL To: gentoo-dev@lists.gentoo.org From: Andrew Ammerlaan Organization: Gentoo Linux Subject: [gentoo-dev] [PATCH 1/2] docs.eclass: allow multiple documentation builders Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Archives-Salt: d5fc7246-5f04-4dd1-bb62-4e02045a120a X-Archives-Hash: b1a064dd8317b8d0b32f21bb4bb09e51 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 } # @FUNCTION: mkdocs_deps @@ -263,16 +268,15 @@ mkdocs_deps() { } # @FUNCTION: mkdocs_compile -# @INTERNAL # @DESCRIPTION: # Calls mkdocs to build docs. -# -# If you overwrite python_compile_all do not call -# this function, call docs_compile instead mkdocs_compile() { debug-print-function ${FUNCNAME} use doc || return + : ${DOCS_DIR:="${S}"} + : ${DOCS_OUTDIR:="${S}/_build/html/mkdocs"} + local mkdocsyml=${DOCS_DIR}/mkdocs.yml [[ -f ${mkdocsyml} ]] || die "${FUNCNAME}: ${mkdocsyml} not found, DOCS_DIR=${DOCS_DIR} wrong" @@ -285,6 +289,12 @@ mkdocs_compile() { # mkdocs currently has no option to disable this # and portage complains: "Colliding files found by ecompress" rm "${DOCS_OUTDIR}"/*.gz || die + + 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 } # @FUNCTION: doxygen_deps @@ -299,14 +309,16 @@ doxygen_deps() { } # @FUNCTION: doxygen_compile -# @INTERNAL # @DESCRIPTION: # Calls doxygen to build docs. doxygen_compile() { debug-print-function ${FUNCNAME} use doc || return + # This is the default name of the config file, upstream can change it. : ${DOCS_CONFIG_NAME:="Doxyfile"} + : ${DOCS_DIR:="${S}"} + : ${DOCS_OUTDIR:="${S}/_build/html/doxygen"} local doxyfile=${DOCS_DIR}/${DOCS_CONFIG_NAME} [[ -f ${doxyfile} ]] || @@ -318,6 +330,12 @@ doxygen_compile() { pushd "${DOCS_DIR}" || die (cat "${DOCS_CONFIG_NAME}" ; echo "HTML_OUTPUT=${DOCS_OUTDIR}") | doxygen - || die "${FUNCNAME}: doxygen failed" popd || die + + 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 DOCS_CONFIG_NAME } # @FUNCTION: docs_compile @@ -343,16 +361,8 @@ docs_compile() { debug-print-function ${FUNCNAME} use doc || return - # Set a sensible default as DOCS_DIR - : ${DOCS_DIR:="${S}"} - - # Where to put the compiled files? - : ${DOCS_OUTDIR:="${S}/_build/html"} - ${DOCS_BUILDER}_compile - HTML_DOCS+=( "${DOCS_OUTDIR}/." ) - # we need to ensure successful return in case we're called last, # otherwise Portage may wrongly assume sourcing failed return 0 diff --git a/net-libs/xrootd/xrootd-5.5.0.ebuild b/net-libs/xrootd/xrootd-5.5.0.ebuild index 53f8a65ef85..3acd41d1cb2 100644 --- a/net-libs/xrootd/xrootd-5.5.0.ebuild +++ b/net-libs/xrootd/xrootd-5.5.0.ebuild @@ -88,12 +91,8 @@ src_configure() { src_compile() { cmake_src_compile - docs_compile - - # secondary documentation for python bindings - if use python && use doc; then - emake -C bindings/python/docs html - fi + doxygen_compile + use python && DOCS_DIR="${S}/bindings/python/docs/source" sphinx_compile } src_install() { @@ -121,11 +120,6 @@ src_install() { if use python; then python_optimize "${D}/$(python_get_sitedir)" - if use doc; then - docinto python - docompress -x "/usr/share/doc/${PF}/python/html" - dodoc -r bindings/python/docs/build/html - fi if use examples; then docinto python dodoc -r bindings/python/examples