Gentoo Archives: gentoo-dev

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

Replies

Subject Author
Re: [gentoo-dev] [PATCH 2/2] vim-plugin.eclass: support EAPI 8 Anna Vyalkova <cyber+gentoo@×××××.in>