commit:     3bce8799e4791f9d2fcb94e5c1ae287632ad7286
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu May 18 17:05:38 2023 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu May 18 18:54:15 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3bce8799

llvm.org.eclass: Do not require separate manpage dist for every PV

Do not require a separate manpage dist for every minor release.
Instead, use the 16.0.4 tarball for 16.x releases going forward.
This makes sense since manpages rarely change -- at least for all
the 16.x releases, all that's been changing were the build date
and the version number in extraclangtools manpage.

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 eclass/llvm.org.eclass | 39 ++++++++++++++++++++-------------------
 1 file changed, 20 insertions(+), 19 deletions(-)

diff --git a/eclass/llvm.org.eclass b/eclass/llvm.org.eclass
index 8b1c074ac97d..c67651be6ffd 100644
--- a/eclass/llvm.org.eclass
+++ b/eclass/llvm.org.eclass
@@ -59,12 +59,6 @@ LLVM_VERSION=$(ver_cut 1-3)
 # the correct branch to use.
 _LLVM_MASTER_MAJOR=17
 
-# @ECLASS_VARIABLE: _LLVM_NEWEST_MANPAGE_RELEASE
-# @INTERNAL
-# @DESCRIPTION:
-# The newest release of LLVM for which manpages were generated.
-_LLVM_NEWEST_MANPAGE_RELEASE=16.0.4
-
 # @ECLASS_VARIABLE: _LLVM_SOURCE_TYPE
 # @INTERNAL
 # @DESCRIPTION:
@@ -271,17 +265,16 @@ llvm.org_set_globals() {
        fi
 
        if [[ ${LLVM_MANPAGES} ]]; then
-               # use pregenerated tarball for releases
-               # up to _LLVM_NEWEST_MANPAGE_RELEASE
-               if llvm_manpage_dist_available; then
-                       IUSE+=" doc"
+               IUSE+=" doc"
+               # use pregenerated tarball if available
+               local manpage_dist=$(llvm_manpage_get_dist)
+               if [[ -n ${manpage_dist} ]]; then
                        SRC_URI+="
                                !doc? (
-                                       
https://dev.gentoo.org/~mgorny/dist/llvm/llvm-${PV}-manpages.tar.bz2
+                                       
https://dev.gentoo.org/~mgorny/dist/llvm/${manpage_dist}
                                )
                        "
                else
-                       IUSE+=" doc"
                        # NB: this is not always the correct dep but it does no 
harm
                        BDEPEND+=" dev-python/sphinx"
                fi
@@ -439,13 +432,21 @@ get_lit_flags() {
        echo "-vv;-j;${LIT_JOBS:-$(makeopts_jobs)}"
 }
 
-# @FUNCTION: llvm_manpage_dist_available
+# @FUNCTION: llvm_manpage_get_dist
 # @DESCRIPTION:
-# Return true (0) if this LLVM version features prebuilt manpage
-# tarball, false (1) otherwise.
-llvm_manpage_dist_available() {
-       [[ ${_LLVM_SOURCE_TYPE} == tar && ${PV} != *_rc* ]] &&
-               ver_test "${PV}" -le "${_LLVM_NEWEST_MANPAGE_RELEASE}"
+# Output the filename of the manpage dist for this version,
+# if available.  Otherwise returns without output.
+llvm_manpage_get_dist() {
+       if [[ ${_LLVM_SOURCE_TYPE} == tar && ${PV} != *_rc* ]]; then
+               case ${PV} in
+                       14*|15*|16.0.[0-3])
+                               echo "llvm-${PV}-manpages.tar.bz2"
+                               ;;
+                       16*)
+                               echo "llvm-16.0.4-manpages.tar.bz2"
+                               ;;
+               esac
+       fi
 }
 
 # @FUNCTION: llvm_are_manpages_built
@@ -464,7 +465,7 @@ llvm_install_manpages() {
        if ! llvm_are_manpages_built; then
                # (doman does not support custom paths)
                insinto "/usr/lib/llvm/${LLVM_MAJOR}/share/man/man1"
-               doins "${WORKDIR}/llvm-${PV}-manpages/${LLVM_COMPONENTS[0]}"/*.1
+               doins "${WORKDIR}"/llvm-*-manpages/"${LLVM_COMPONENTS[0]}"/*.1
        fi
 }
 

Reply via email to