1 |
Signed-off-by: Anna Vyalkova <cyber+gentoo@×××××.in> |
2 |
--- |
3 |
|
4 |
Some ebuilds will need to override src_install as shown in example. |
5 |
|
6 |
eclass/vim-plugin.eclass | 38 +++++++++++++++++++++++++++++++------- |
7 |
1 file changed, 31 insertions(+), 7 deletions(-) |
8 |
|
9 |
diff --git a/eclass/vim-plugin.eclass b/eclass/vim-plugin.eclass |
10 |
index eac7dea52d..cbf4525354 100644 |
11 |
--- a/eclass/vim-plugin.eclass |
12 |
+++ b/eclass/vim-plugin.eclass |
13 |
@@ -31,13 +31,29 @@ if [[ ${PV} != 9999* ]] ; then |
14 |
fi |
15 |
SLOT="0" |
16 |
|
17 |
-# @FUNCTION: vim-plugin_src_install |
18 |
+# @ECLASS_VARIABLE: _VIM_PLUGIN_ALLOWED_DIRS |
19 |
+# @INTERNAL |
20 |
+# @DESCRIPTION: |
21 |
+# Vanilla Vim dirs. |
22 |
+# See /usr/share/vim/vim* for reference. |
23 |
+_VIM_PLUGIN_ALLOWED_DIRS=( |
24 |
+ after autoload colors compiler doc ftdetect ftplugin indent keymap |
25 |
+ macros plugin spell syntax |
26 |
+) |
27 |
+ |
28 |
+# @FUNCTION: vim-plugin_src_install [<dir>...] |
29 |
# @USAGE: |
30 |
# @DESCRIPTION: |
31 |
# Overrides the default src_install phase. In order, this function: |
32 |
-# * fixes file permission across all files in ${S}. |
33 |
# * installs help and documentation files. |
34 |
-# * installs all files in "${ED}"/usr/share/vim/vimfiles. |
35 |
+# * installs all files recognized by default Vim installation and directories |
36 |
+# passed to this function as arguments in "${ED}"/usr/share/vim/vimfiles. |
37 |
+# @EXAMPLE: |
38 |
+# @CODE |
39 |
+# src_install() { |
40 |
+# vim-plugin_src_install syntax_checkers |
41 |
+# } |
42 |
+# @CODE |
43 |
vim-plugin_src_install() { |
44 |
|
45 |
# Install non-vim-help-docs |
46 |
@@ -46,10 +62,18 @@ vim-plugin_src_install() { |
47 |
# Install remainder of plugin |
48 |
insinto /usr/share/vim/vimfiles/ |
49 |
local d |
50 |
- for d in *; do |
51 |
- [[ -d "${d}" ]] || continue |
52 |
- doins -r "${d}" |
53 |
- done |
54 |
+ case ${EAPI:-0} in |
55 |
+ 6|7) |
56 |
+ for d in *; do |
57 |
+ [[ -d "${d}" ]] || continue |
58 |
+ doins -r "${d}" |
59 |
+ done ;; |
60 |
+ *) |
61 |
+ for d in "${_VIM_PLUGIN_ALLOWED_DIRS[@]}" "${@}"; do |
62 |
+ [[ -d "${d}" ]] || continue |
63 |
+ doins -r "${d}" |
64 |
+ done ;; |
65 |
+ esac |
66 |
} |
67 |
|
68 |
# @FUNCTION: vim-plugin_pkg_postinst |
69 |
-- |
70 |
2.35.1 |