diff options
author | Michał Górny <mgorny@gentoo.org> | 2022-06-11 10:27:50 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2022-06-11 13:06:57 +0200 |
commit | 4684e2ce3431afe681736d60878ab9b312c1efc9 (patch) | |
tree | 1dcbb6537822a6837e59807200682d3237bbcdfa /eclass/llvm.org.eclass | |
parent | www-plugins/chrome-binary-plugins: automated update (104.0.5110.0_alpha) (diff) | |
download | gentoo-4684e2ce3431afe681736d60878ab9b312c1efc9.tar.gz gentoo-4684e2ce3431afe681736d60878ab9b312c1efc9.tar.bz2 gentoo-4684e2ce3431afe681736d60878ab9b312c1efc9.zip |
llvm.org.eclass: Control manpage type via eclass
Move switching between pregenerated and built manpages from ebuilds
to the eclass. This is going to make the maintenance easier — rather
than having to switch to `build` on every version bump, then back
to `pregenerated` we will just bump the current version in eclass
after making the new manpage tarball.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/llvm.org.eclass')
-rw-r--r-- | eclass/llvm.org.eclass | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/eclass/llvm.org.eclass b/eclass/llvm.org.eclass index 0ddd48b19e46..8b37ca73dbc4 100644 --- a/eclass/llvm.org.eclass +++ b/eclass/llvm.org.eclass @@ -47,6 +47,12 @@ esac # the correct branch to use. _LLVM_MASTER_MAJOR=15 +# @ECLASS_VARIABLE: _LLVM_NEWEST_MANPAGE_RELEASE +# @INTERNAL +# @DESCRIPTION: +# The newest release of LLVM for which manpages were generated. +_LLVM_NEWEST_MANPAGE_RELEASE=14.0.4 + # @ECLASS_VARIABLE: _LLVM_SOURCE_TYPE # @INTERNAL # @DESCRIPTION: @@ -86,9 +92,10 @@ inherit multiprocessing # @ECLASS_VARIABLE: LLVM_MANPAGES # @DEFAULT_UNSET # @DESCRIPTION: -# Set to 'build', include the dependency on dev-python/sphinx to build -# the manpages. If set to 'pregenerated', fetch and install -# pregenerated manpages from the archive. +# Set to a non-empty value in ebuilds that build manpages via Sphinx. +# The eclass will either include the dependency on dev-python/sphinx +# or pull the pregenerated manpage tarball depending on the package +# version. # @ECLASS_VARIABLE: LLVM_PATCHSET # @DEFAULT_UNSET @@ -199,25 +206,24 @@ llvm.org_set_globals() { RESTRICT+=" !test? ( test )" fi - case ${LLVM_MANPAGES:-__unset__} in - __unset__) - # no manpage support - ;; - build) - IUSE+=" doc" - # NB: this is not always the correct dep but it does no harm - BDEPEND+=" dev-python/sphinx" - ;; - pregenerated) + if [[ ${LLVM_MANPAGES} ]]; then + # use pregenerated tarball for releases + # up to _LLVM_NEWEST_MANPAGE_RELEASE + if [[ ${_LLVM_SOURCE_TYPE} == tar ]] && + ver_test "${PV}" -le "${_LLVM_NEWEST_MANPAGE_RELEASE}" + then IUSE+=" doc" SRC_URI+=" !doc? ( https://dev.gentoo.org/~mgorny/dist/llvm/llvm-${PV}-manpages.tar.bz2 - )" - ;; - *) - die "Invalid LLVM_MANPAGES=${LLVM_MANPAGES}" - esac + ) + " + else + IUSE+=" doc" + # NB: this is not always the correct dep but it does no harm + BDEPEND+=" dev-python/sphinx" + fi + fi if [[ -n ${LLVM_PATCHSET} ]]; then SRC_URI+=" |