commit:     b8f5b4ed89df03f95dab0b918d2b010bbc1da28a
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 10 03:04:41 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Sep 10 03:04:41 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b8f5b4ed

toolchain.eclass: allow re-generation of info pages for snapshots

Snapshots don't (yet?) contain pre-generated info pages (and man
pages, but that's turned out not to be an issue, as they get
regenerated and nobody notices).

Given it's often easier and more sensible to keyword a snapshot
from one of the stable branches upstream rather than cherry-picking
patches, we need to make sure we don't regress with the documentation
provided when we do that.

Allow re-generation of info pages using texinfo for snapshots;
we have a safeguard (eqawarn) for if they start appearing in
snapshots and nobody noticed.

Closes: https://bugs.gentoo.org/834845
Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/toolchain.eclass | 26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 4a91f0d3dee0..4e023ffb65d0 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -288,6 +288,13 @@ BDEPEND="
        )"
 DEPEND="${RDEPEND}"
 
+if [[ ${PN} == gcc && ${PV} == *_p* ]] ; then
+       # Snapshots don't contain info pages.
+       # If they start to, adjust gcc_cv_prog_makeinfo_modern logic in 
toolchain_src_configure.
+       # Needed unless/until 
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106899 is fixed
+       BDEPEND+=" sys-apps/texinfo"
+fi
+
 if tc_has_feature gcj ; then
        DEPEND+="
                gcj? (
@@ -1417,9 +1424,22 @@ toolchain_src_configure() {
                )
        fi
 
-       # Disable gcc info regeneration -- it ships with generated info pages
-       # already.  Our custom version/urls/etc... trigger it. bug #464008
-       export gcc_cv_prog_makeinfo_modern=no
+       if [[ ${PV} != *_p* && -f "${S}"/gcc/doc/gcc.info ]] ; then
+               # Disable gcc info regeneration -- it ships with generated info 
pages
+               # already.  Our custom version/urls/etc... trigger it. bug 
#464008
+               export gcc_cv_prog_makeinfo_modern=no
+       else
+               # Allow a fallback so we don't accidentally install no docs
+               # bug #834845
+               ewarn "No pre-generated info pages in tarball. Allowing 
regeneration with texinfo..."
+
+               if [[ ${PV} == *_p* && -f "${S}"/gcc/doc/gcc.info ]] ; then
+                       # Safeguard against 
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106899 being fixed
+                       # without corresponding ebuild changes.
+                       eqawarn "Snapshot release with pre-generated info pages 
found!"
+                       eqawarn "The BDEPEND in the ebuild should be updated to 
drop texinfo."
+               fi
+       fi
 
        # Do not let the X detection get in our way.  We know things can be 
found
        # via system paths, so no need to hardcode things that'll break 
multilib.

Reply via email to