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