• [gentoo-dev] [PATCH v3 4/8] vim-plugin.eclass: EAPI 8: add src_prepare

    From Anna Vyalkova@21:1/5 to All on Wed Apr 6 16:00:01 2022
    Signed-off-by: Anna Vyalkova <cyber+gentoo@sysrq.in>
    ---
    eclass/vim-plugin.eclass | 38 +++++++++++++++++++++++++++++++++++---
    1 file changed, 35 insertions(+), 3 deletions(-)

    diff --git a/eclass/vim-plugin.eclass b/eclass/vim-plugin.eclass
    index abd5b326d5..0df323b143 100644
    --- a/eclass/vim-plugin.eclass
    +++ b/eclass/vim-plugin.eclass
    @@ -13,7 +13,8 @@
    # documentation, for which we make a special case via vim-doc.eclass.

    case ${EAPI} in
    - 6|7|8);;
    + 6|7) ;;
    + 8) _DEFINE_VIM_PLUGIN_SRC_PREPARE=true ;;
    *) die "${ECLASS}: EAPI ${EAPI:-0} unsupported (too old)";;
    esac

    @@ -21,6 +22,17 @@ if [[ ! ${_VIM_PLUGIN_ECLASS} ]]; then

    inherit vim-doc

    +fi
    +
    +EXPORT_FUNCTIONS src_install pkg_postinst pkg_postrm
    +
    +# src_prepare is only exported in EAPI >= 8
    +case ${EAPI:-0} in
    + 6|7) ;;
    + 8) EXPORT_FUNCTIONS src_prepare ;;
    +esac
    +
    +if [[ ! ${_VIM_PLUGIN_ECLASS} ]]; then
    VIM_PLUGIN_VIM_VERSION="${VIM_PLUGIN_VIM_VERSION:-7.3}"

    DEPEND="|| ( >=app-editors/vim-${VIM_PLUGIN_VIM_VERSION}
    @@ -32,6 +44,28 @@ if [[ ${PV} != 9999* ]] ;
  • From Thomas Bracht Laumann Jespersen@21:1/5 to All on Wed Apr 6 16:30:01 2022
    +if ${_DEFINE_VIM_PLUGIN_SRC_PREPARE}; then
    +# @FUNCTION: vim-plugin_src_prepare
    +# @DESCRIPTION:
    +# Moves "after/syntax" plugins to directories to avoid file collisions with +# other packages.
    +# Note that this function is only defined and exported in EAPIs >= 8. +vim-plugin_src_prepare() {

    The eclass writing guide [0] says that @USAGE is always required. But I see it commonly omitted from phase function overrides.

    [0]: https://devmanual.gentoo.org/eclass-writing/index.html#eclass-functions

    -- Thomas

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)