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

    From Anna Vyalkova@21:1/5 to All on Mon Apr 11 14:40:01 2022
    Signed-off-by: Anna Vyalkova <cyber+gentoo@sysrq.in>
    ---
    eclass/vim-plugin.eclass | 39 ++++++++++++++++++++++++++++++++++++---
    1 file changed, 36 insertions(+), 3 deletions(-)

    diff --git a/eclass/vim-plugin.eclass b/eclass/vim-plugin.eclass
    index 0c323e0d09..a7b5f258b0 100644
    --- a/eclass/vim-plugin.eclass
    +++ b/eclass/vim-plugin.eclass
    @@ -1,192 +1,225 @@
    # Copyright 1999-2022 Gentoo Authors
    # Distributed under the terms of the GNU General Public License v2

    # @ECLASS: vim-plugin.eclass
    # @MAINTAINER:
    # vim@gentoo.org
    # @SUPPORTED_EAPIS: 6 7 8
    # @BLURB: used for installing vim plugins
    # @DESCRIPTION:
    # This eclass simplifies installation of app-vim plugins into
    # /usr/share/vim/vimfiles. This is a version-independent directory
    # which is read automatically by vim. The only exception is
    # 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} not supported" ;;
    esac

    if [[ ! ${_VIM_
  • From Thomas Bracht Laumann Jespersen@21:1/5 to All on Mon Apr 11 15:00:01 2022
    case ${EAPI} in
    - 6|7|8) ;;
    + 6|7) ;;
    + 8) _DEFINE_VIM_PLUGIN_SRC_PREPARE=true ;;
    *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
    esac

    if [[ ! ${_VIM_PLUGIN_ECLASS} ]]; then

    inherit vim-doc

    +fi
    +
    +EXPORT_FUNCTIONS src_install pkg_postinst pkg_postrm

    Not sure how to deal with this best, but EXPORT_FUNCTIONS should still go _after_ the inherit guard, at the bottom of the file.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anna Vyalkova@21:1/5 to Thomas Bracht Laumann Jespersen on Mon Apr 11 15:10:01 2022
    On 2022-04-11 14:53, Thomas Bracht Laumann Jespersen wrote:
    case ${EAPI} in
    - 6|7|8) ;;
    + 6|7) ;;
    + 8) _DEFINE_VIM_PLUGIN_SRC_PREPARE=true ;;
    *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
    esac

    if [[ ! ${_VIM_PLUGIN_ECLASS} ]]; then

    inherit vim-doc

    +fi
    +
    +EXPORT_FUNCTIONS src_install pkg_postinst pkg_postrm

    Not sure how to deal with this best, but EXPORT_FUNCTIONS should still go _after_ the inherit guard, at the bottom of the file.

    Copycat from distutils-r1. Phase functions are exported after inherits
    outside of the guard, so it should be correct.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anna Vyalkova@21:1/5 to All on Thu Apr 14 05:20:01 2022
    Signed-off-by: Anna Vyalkova <cyber+gentoo@sysrq.in>
    ---

    Changed _DEFINE_VIM_PLUGIN_SRC_PREPARE as floppym suggested. https://github.com/gentoo/gentoo/pull/24941#discussion_r848445641

    eclass/vim-plugin.eclass | 39 ++++++++++++++++++++++++++++++++++++---
    1 file changed, 36 insertions(+), 3 deletions(-)

    diff --git a/eclass/vim-plugin.eclass b/eclass/vim-plugin.eclass
    index 0c323e0d09..5a68b2957d 100644
    --- a/eclass/vim-plugin.eclass
    +++ b/eclass/vim-plugin.eclass
    @@ -1,192 +1,225 @@
    # Copyright 1999-2022 Gentoo Authors
    # Distributed under the terms of the GNU General Public License v2

    # @ECLASS: vim-plugin.eclass
    # @MAINTAINER:
    # vim@gentoo.org
    # @SUPPORTED_EAPIS: 6 7 8
    # @BLURB: used for installing vim plugins
    # @DESCRIPTION:
    # This eclass simplifies installation of app-vim plugins into
    # /usr/share/vim/vimfiles. This is a version-independent directory
    # which is read automatically by vim. The only exception is
    # documentation, for which we make a special case via vim-doc.eclass.

    case ${EAPI} in
    - 6|7|8) ;;
    + 6|
  • From Ulrich Mueller@21:1/5 to All on Thu Apr 14 07:20:01 2022
    On Thu, 14 Apr 2022, Anna Vyalkova wrote:

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

    [...]

    -EXPORT_FUNCTIONS src_install pkg_postinst pkg_postrm

    What is the rationale for moving EXPORT_FUNCTIONS? The standard nowadays
    is to have it at the end of the eclass (so it's immediately clear that
    inherit order will be as expected).

    Ulrich

    --=-=-Content-Type: application/pgp-signature; name="signature.asc"

    -----BEGIN PGP SIGNATURE-----

    iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAmJXrKoPHHVsbUBnZW50 b28ub3JnAAoJEFGIM1CIQV4uGx8IAI7AwWAqICOYmwMigMy0yq4RFzy0ZjrEvVvp tTkMFzIXKQrlNONJgu0Yoy++AfAlAManPYSWrXQfWGphDJe49RAipy5wUjgC0CqB 6UiwLtIG4tddBaixH0b2FpWTbbHSDeVJ09L3LMywNk2VgfDY4il/KJh1BBKfZ5tu etprL5s1Pnm4F3bApgYXPomdGw6vxoIKOE5gxPa5bGpNGOtTDSllRZZomQ+no6J+ iSfUUt/gA7Ylp7989w+gJ9joz6W+nJI8kfCluybLu5FIrlO4DH0/BcLzBzFa01Y5 mB/52AveQK0JPwiymdrpIiK2mz0BwglpxFNunR5u+QaoXkaGD/w=jIt2
    -----END PGP SIGNATURE-----

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