Gentoo Archives: gentoo-dev

From: Anna Vyalkova <cyber+gentoo@×××××.in>
To: gentoo-dev@l.g.o
Cc: vim@g.o, Thomas Bracht Laumann Jespersen <t@×××××××.xyz>
Subject: [gentoo-dev] [PATCH v3 2/8] vim-plugin.eclass: support EAPI 8
Date: Wed, 06 Apr 2022 13:53:13
Message-Id: 20220406135203.24882-3-cyber+gentoo@sysrq.in
In Reply to: [gentoo-dev] [PATCH v3 0/8] Vim eclasses by Anna Vyalkova
1 From: Thomas Bracht Laumann Jespersen <t@×××××××.xyz>
2
3 * Drop EAPI 0, 1, 2 workarounds
4 * Move EXPORT_FUNCTIONS to end of file
5 * Add required @USAGE on functions
6 * Add _VIM_PLUGIN_ECLASS guard
7
8 Bug: https://bugs.gentoo.org/830867
9 Bug: https://bugs.gentoo.org/830866
10 Signed-off-by: Thomas Bracht Laumann Jespersen <t@×××××××.xyz>
11 Signed-off-by: Anna Vyalkova <cyber+gentoo@×××××.in>
12 ---
13 eclass/vim-plugin.eclass | 24 +++++++++++++++---------
14 1 file changed, 15 insertions(+), 9 deletions(-)
15
16 diff --git a/eclass/vim-plugin.eclass b/eclass/vim-plugin.eclass
17 index 50e727e98f..a29991129c 100644
18 --- a/eclass/vim-plugin.eclass
19 +++ b/eclass/vim-plugin.eclass
20 @@ -1,10 +1,10 @@
21 -# Copyright 1999-2021 Gentoo Authors
22 +# Copyright 1999-2022 Gentoo Authors
23 # Distributed under the terms of the GNU General Public License v2
24
25 # @ECLASS: vim-plugin.eclass
26 # @MAINTAINER:
27 # vim@g.o
28 -# @SUPPORTED_EAPIS: 6 7
29 +# @SUPPORTED_EAPIS: 6 7 8
30 # @BLURB: used for installing vim plugins
31 # @DESCRIPTION:
32 # This eclass simplifies installation of app-vim plugins into
33 @@ -13,12 +13,13 @@
34 # documentation, for which we make a special case via vim-doc.eclass.
35
36 case ${EAPI} in
37 - 6|7);;
38 - *) die "EAPI ${EAPI:-0} unsupported (too old)";;
39 + 6|7|8);;
40 + *) die "${ECLASS}: EAPI ${EAPI:-0} unsupported (too old)";;
41 esac
42
43 +if [[ ! ${_VIM_PLUGIN_ECLASS} ]]; then
44 +
45 inherit vim-doc
46 -EXPORT_FUNCTIONS src_install pkg_postinst pkg_postrm
47
48 VIM_PLUGIN_VIM_VERSION="${VIM_PLUGIN_VIM_VERSION:-7.3}"
49
50 @@ -32,13 +33,13 @@ fi
51 SLOT="0"
52
53 # @FUNCTION: vim-plugin_src_install
54 +# @USAGE:
55 # @DESCRIPTION:
56 # Overrides the default src_install phase. In order, this function:
57 # * fixes file permission across all files in ${S}.
58 # * installs help and documentation files.
59 # * installs all files in "${ED}"/usr/share/vim/vimfiles.
60 vim-plugin_src_install() {
61 - has "${EAPI:-0}" 0 1 2 && ! use prefix && ED="${D}"
62
63 # Install non-vim-help-docs
64 einstalldocs
65 @@ -53,6 +54,7 @@ vim-plugin_src_install() {
66 }
67
68 # @FUNCTION: vim-plugin_pkg_postinst
69 +# @USAGE:
70 # @DESCRIPTION:
71 # Overrides the pkg_postinst phase for this eclass.
72 # The following functions are called:
73 @@ -71,7 +73,6 @@ vim-plugin_pkg_postinst() {
74 # This function calls the update_vim_helptags and update_vim_afterscripts
75 # functions and eventually removes a bunch of empty directories.
76 vim-plugin_pkg_postrm() {
77 - has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
78 update_vim_helptags # from vim-doc
79 update_vim_afterscripts # see below
80
81 @@ -82,12 +83,11 @@ vim-plugin_pkg_postrm() {
82 }
83
84 # @FUNCTION: update_vim_afterscripts
85 +# @USAGE:
86 # @DESCRIPTION:
87 # Creates scripts in /usr/share/vim/vimfiles/after/*
88 # comprised of the snippets in /usr/share/vim/vimfiles/after/*/*.d
89 update_vim_afterscripts() {
90 - has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
91 - has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
92 local d f afterdir="${EROOT}"/usr/share/vim/vimfiles/after
93
94 # Nothing to do if the dir isn't there
95 @@ -115,6 +115,7 @@ update_vim_afterscripts() {
96 }
97
98 # @FUNCTION: display_vim_plugin_help
99 +# @USAGE:
100 # @DESCRIPTION:
101 # Displays a message with the plugin's help file if one is available. Uses the
102 # VIM_PLUGIN_HELPFILES env var. If multiple help files are available, they
103 @@ -160,3 +161,8 @@ display_vim_plugin_help() {
104 fi
105 fi
106 }
107 +
108 +_VIM_PLUGIN_ECLASS=1
109 +fi
110 +
111 +EXPORT_FUNCTIONS src_install pkg_postinst pkg_postrm
112 --
113 2.35.1