Gentoo Archives: gentoo-dev

From: Thomas Bracht Laumann Jespersen <t@×××××××.xyz>
To: gentoo-dev@l.g.o
Cc: lack@g.o, soap@g.o, Thomas Bracht Laumann Jespersen <t@×××××××.xyz>
Subject: [gentoo-dev] [PATCH v2] gkrellm-plugin.eclass: Support EAPI 8
Date: Fri, 18 Mar 2022 20:54:46
Message-Id: 20220318205424.19344-1-t@laumann.xyz
1 The most notable changes are:
2
3 * BDEPEND on "virtual/pkgconfig" instead of DEPEND
4
5 * Add @DEFAULT_UNSET to the variables PLUGIN_SERVER_SO and PLUGIN_DOCS
6
7 Looking over the eclass, it doesn't appear to use any functionality that was
8 modified or banned in EAPI 7 or 8.
9
10 Signed-off-by: Thomas Bracht Laumann Jespersen <t@×××××××.xyz>
11 ---
12
13 v1 -> v2: Change the EAPI guard to a more standardized version.
14
15 eclass/gkrellm-plugin.eclass | 33 ++++++++++++++++++---------------
16 1 file changed, 18 insertions(+), 15 deletions(-)
17
18 diff --git a/eclass/gkrellm-plugin.eclass b/eclass/gkrellm-plugin.eclass
19 index fb3800f56b7..c247e6362eb 100644
20 --- a/eclass/gkrellm-plugin.eclass
21 +++ b/eclass/gkrellm-plugin.eclass
22 @@ -7,7 +7,8 @@
23 # @AUTHOR:
24 # Original author: Jim Ramsay <lack@g.o>
25 # EAPI 6 author: David Seifert <soap@g.o>
26 -# @SUPPORTED_EAPIS: 6
27 +# EAPI 8 author: Thomas Bracht Laumann Jespersen <t@×××××××.xyz>
28 +# @SUPPORTED_EAPIS: 6 8
29 # @PROVIDES: multilib
30 # @BLURB: Provides src_install used by (almost) all gkrellm plugins
31 # @DESCRIPTION:
32 @@ -15,6 +16,8 @@
33 # - Provides a common src_install method to avoid code duplication
34 #
35 # Changelog:
36 +# 17 March 2022: Thomas Bracht Laumann Jespersen <t@×××××××.xyz>
37 +# - Port to EAPI 8
38 # 03 January 2018: David Seifert <soap@g.o>
39 # - Port to EAPI 6, remove built_with_use, simplify a lot
40 # 12 March 2007: Jim Ramsay <lack@g.o>
41 @@ -29,35 +32,35 @@
42 # the plugin dir. Defaults to "${PN}$(get_modname)". Has to be a bash array.
43
44 # @ECLASS-VARIABLE: PLUGIN_SERVER_SO
45 +# @DEFAULT_UNSET
46 # @DESCRIPTION:
47 # The name of the plugin's server plugin $(get_modname) portion.
48 # Unset by default. Has to be a bash array.
49
50 # @ECLASS-VARIABLE: PLUGIN_DOCS
51 +# @DEFAULT_UNSET
52 # @DESCRIPTION:
53 # An optional list of docs to be installed, in addition to the default
54 # DOCS variable which is respected too. Has to be a bash array.
55
56 -case ${EAPI:-0} in
57 - [0-5])
58 - die "${ECLASS} is banned in EAPI ${EAPI:-0}"
59 - ;;
60 - 6)
61 - ;;
62 - *)
63 - die "Unknown EAPI ${EAPI:-0}"
64 - ;;
65 +case ${EAPI} in
66 + 6|8) ;;
67 + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
68 esac
69
70 inherit multilib
71
72 -EXPORT_FUNCTIONS src_install
73 -
74 if [[ ! ${_GKRELLM_PLUGIN_R1} ]]; then
75 +_GKRELLM_PLUGIN_R1=1
76
77 -DEPEND="virtual/pkgconfig"
78 +if [[ ${EAPI} == 6 ]]; then
79 + DEPEND="virtual/pkgconfig"
80 +else
81 + BDEPEND="virtual/pkgconfig"
82 +fi
83
84 # @FUNCTION: gkrellm-plugin_src_install
85 +# @USAGE:
86 # @DESCRIPTION:
87 # Install the plugins and call einstalldocs
88 gkrellm-plugin_src_install() {
89 @@ -71,7 +74,6 @@ gkrellm-plugin_src_install() {
90 die "PLUGIN_SO has to be a bash array!"
91 fi
92
93 -
94 if [[ -n ${PLUGIN_SERVER_SO} ]]; then
95 exeinto /usr/$(get_libdir)/gkrellm2/plugins-gkrellmd
96
97 @@ -97,5 +99,6 @@ gkrellm-plugin_src_install() {
98 fi
99 }
100
101 -_GKRELLM_PLUGIN_R1=1
102 fi
103 +
104 +EXPORT_FUNCTIONS src_install
105 --
106 2.34.1