public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] gkrellm-plugin.eclass: Support EAPI 8
@ 2022-03-18 19:38 Thomas Bracht Laumann Jespersen
  2022-03-18 20:32 ` Anna Vyalkova
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Bracht Laumann Jespersen @ 2022-03-18 19:38 UTC (permalink / raw
  To: gentoo-dev; +Cc: lack, soap, Thomas Bracht Laumann Jespersen

The most notable changes are:

 * BDEPEND on "virtual/pkgconfig" instead of DEPEND

 * Add @DEFAULT_UNSET to the variables PLUGIN_SERVER_SO and PLUGIN_DOCS

Looking over the eclass, it doesn't appear to use any functionality that was
modified or banned in EAPI 7 or 8.

Signed-off-by: Thomas Bracht Laumann Jespersen <t@laumann.xyz>
---
 eclass/gkrellm-plugin.eclass | 30 +++++++++++++++++++++---------
 1 file changed, 21 insertions(+), 9 deletions(-)

diff --git a/eclass/gkrellm-plugin.eclass b/eclass/gkrellm-plugin.eclass
index fb3800f56b7..7ae124fb67e 100644
--- a/eclass/gkrellm-plugin.eclass
+++ b/eclass/gkrellm-plugin.eclass
@@ -7,7 +7,8 @@
 # @AUTHOR:
 # Original author: Jim Ramsay <lack@gentoo.org>
 # EAPI 6 author: David Seifert <soap@gentoo.org>
-# @SUPPORTED_EAPIS: 6
+# EAPI 8 author: Thomas Bracht Laumann Jespersen <t@laumann.xyz>
+# @SUPPORTED_EAPIS: 6 8
 # @PROVIDES: multilib
 # @BLURB: Provides src_install used by (almost) all gkrellm plugins
 # @DESCRIPTION:
@@ -15,6 +16,8 @@
 # - Provides a common src_install method to avoid code duplication
 #
 # Changelog:
+#   17 March 2022: Thomas Bracht Laumann Jespersen <t@laumann.xyz>
+#     - Port to EAPI 8
 #   03 January 2018: David Seifert <soap@gentoo.org>
 #     - Port to EAPI 6, remove built_with_use, simplify a lot
 #   12 March 2007: Jim Ramsay <lack@gentoo.org>
@@ -29,20 +32,25 @@
 # the plugin dir. Defaults to "${PN}$(get_modname)". Has to be a bash array.
 
 # @ECLASS-VARIABLE: PLUGIN_SERVER_SO
+# @DEFAULT_UNSET
 # @DESCRIPTION:
 # The name of the plugin's server plugin $(get_modname) portion.
 # Unset by default. Has to be a bash array.
 
 # @ECLASS-VARIABLE: PLUGIN_DOCS
+# @DEFAULT_UNSET
 # @DESCRIPTION:
 # An optional list of docs to be installed, in addition to the default
 # DOCS variable which is respected too. Has to be a bash array.
 
-case ${EAPI:-0} in
+case ${EAPI} in
 	[0-5])
-		die "${ECLASS} is banned in EAPI ${EAPI:-0}"
+		die "${ECLASS} is banned in EAPI ${EAPI}"
 		;;
-	6)
+	7)
+		die "${ECLASS}: EAPI ${EAPI} not supported"
+		;;
+	6|8)
 		;;
 	*)
 		die "Unknown EAPI ${EAPI:-0}"
@@ -51,13 +59,17 @@ esac
 
 inherit multilib
 
-EXPORT_FUNCTIONS src_install
-
 if [[ ! ${_GKRELLM_PLUGIN_R1} ]]; then
+_GKRELLM_PLUGIN_R1=1
 
-DEPEND="virtual/pkgconfig"
+if [[ ${EAPI} == 6 ]]; then
+	DEPEND="virtual/pkgconfig"
+else
+	BDEPEND="virtual/pkgconfig"
+fi
 
 # @FUNCTION: gkrellm-plugin_src_install
+# @USAGE:
 # @DESCRIPTION:
 # Install the plugins and call einstalldocs
 gkrellm-plugin_src_install() {
@@ -71,7 +83,6 @@ gkrellm-plugin_src_install() {
 		die "PLUGIN_SO has to be a bash array!"
 	fi
 
-
 	if [[ -n ${PLUGIN_SERVER_SO} ]]; then
 		exeinto /usr/$(get_libdir)/gkrellm2/plugins-gkrellmd
 
@@ -97,5 +108,6 @@ gkrellm-plugin_src_install() {
 	fi
 }
 
-_GKRELLM_PLUGIN_R1=1
 fi
+
+EXPORT_FUNCTIONS src_install
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] [PATCH] gkrellm-plugin.eclass: Support EAPI 8
  2022-03-18 19:38 [gentoo-dev] [PATCH] gkrellm-plugin.eclass: Support EAPI 8 Thomas Bracht Laumann Jespersen
@ 2022-03-18 20:32 ` Anna Vyalkova
  2022-03-18 20:50   ` Thomas Bracht Laumann Jespersen
  0 siblings, 1 reply; 3+ messages in thread
From: Anna Vyalkova @ 2022-03-18 20:32 UTC (permalink / raw
  To: gentoo-dev

On 2022-03-18 20:38, Thomas Bracht Laumann Jespersen wrote:
> The most notable changes are:
> 
>  * BDEPEND on "virtual/pkgconfig" instead of DEPEND
> 
>  * Add @DEFAULT_UNSET to the variables PLUGIN_SERVER_SO and PLUGIN_DOCS
> 
> Looking over the eclass, it doesn't appear to use any functionality that was
> modified or banned in EAPI 7 or 8.
> 
> Signed-off-by: Thomas Bracht Laumann Jespersen <t@laumann.xyz>
> ---
>  eclass/gkrellm-plugin.eclass | 30 +++++++++++++++++++++---------
>  1 file changed, 21 insertions(+), 9 deletions(-)
> 
> diff --git a/eclass/gkrellm-plugin.eclass b/eclass/gkrellm-plugin.eclass
> index fb3800f56b7..7ae124fb67e 100644
> --- a/eclass/gkrellm-plugin.eclass
> +++ b/eclass/gkrellm-plugin.eclass
> @@ -7,7 +7,8 @@
>  # @AUTHOR:
>  # Original author: Jim Ramsay <lack@gentoo.org>
>  # EAPI 6 author: David Seifert <soap@gentoo.org>
> -# @SUPPORTED_EAPIS: 6
> +# EAPI 8 author: Thomas Bracht Laumann Jespersen <t@laumann.xyz>
> +# @SUPPORTED_EAPIS: 6 8
>  # @PROVIDES: multilib
>  # @BLURB: Provides src_install used by (almost) all gkrellm plugins
>  # @DESCRIPTION:
> @@ -15,6 +16,8 @@
>  # - Provides a common src_install method to avoid code duplication
>  #
>  # Changelog:
> +#   17 March 2022: Thomas Bracht Laumann Jespersen <t@laumann.xyz>
> +#     - Port to EAPI 8
>  #   03 January 2018: David Seifert <soap@gentoo.org>
>  #     - Port to EAPI 6, remove built_with_use, simplify a lot
>  #   12 March 2007: Jim Ramsay <lack@gentoo.org>
> @@ -29,20 +32,25 @@
>  # the plugin dir. Defaults to "${PN}$(get_modname)". Has to be a bash array.
>  
>  # @ECLASS-VARIABLE: PLUGIN_SERVER_SO
> +# @DEFAULT_UNSET
>  # @DESCRIPTION:
>  # The name of the plugin's server plugin $(get_modname) portion.
>  # Unset by default. Has to be a bash array.
>  
>  # @ECLASS-VARIABLE: PLUGIN_DOCS
> +# @DEFAULT_UNSET
>  # @DESCRIPTION:
>  # An optional list of docs to be installed, in addition to the default
>  # DOCS variable which is respected too. Has to be a bash array.
>  
> -case ${EAPI:-0} in
> +case ${EAPI} in
>  	[0-5])
> -		die "${ECLASS} is banned in EAPI ${EAPI:-0}"
> +		die "${ECLASS} is banned in EAPI ${EAPI}"
>  		;;
> -	6)
> +	7)
> +		die "${ECLASS}: EAPI ${EAPI} not supported"
> +		;;
> +	6|8)
>  		;;
>  	*)
>  		die "Unknown EAPI ${EAPI:-0}"

Could you standartize EAPI guard?
https://devmanual.gentoo.org/eclass-writing/index.html#handling-incorrect-usage-of-an-eclass

> @@ -51,13 +59,17 @@ esac
>  
>  inherit multilib
>  
> -EXPORT_FUNCTIONS src_install
> -
>  if [[ ! ${_GKRELLM_PLUGIN_R1} ]]; then
> +_GKRELLM_PLUGIN_R1=1
>  
> -DEPEND="virtual/pkgconfig"
> +if [[ ${EAPI} == 6 ]]; then
> +	DEPEND="virtual/pkgconfig"
> +else
> +	BDEPEND="virtual/pkgconfig"
> +fi
>  
>  # @FUNCTION: gkrellm-plugin_src_install
> +# @USAGE:
>  # @DESCRIPTION:
>  # Install the plugins and call einstalldocs
>  gkrellm-plugin_src_install() {
> @@ -71,7 +83,6 @@ gkrellm-plugin_src_install() {
>  		die "PLUGIN_SO has to be a bash array!"
>  	fi
>  
> -
>  	if [[ -n ${PLUGIN_SERVER_SO} ]]; then
>  		exeinto /usr/$(get_libdir)/gkrellm2/plugins-gkrellmd
>  
> @@ -97,5 +108,6 @@ gkrellm-plugin_src_install() {
>  	fi
>  }
>  
> -_GKRELLM_PLUGIN_R1=1
>  fi
> +
> +EXPORT_FUNCTIONS src_install
> -- 
> 2.34.1
> 
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] [PATCH] gkrellm-plugin.eclass: Support EAPI 8
  2022-03-18 20:32 ` Anna Vyalkova
@ 2022-03-18 20:50   ` Thomas Bracht Laumann Jespersen
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Bracht Laumann Jespersen @ 2022-03-18 20:50 UTC (permalink / raw
  To: gentoo-dev

> Could you standartize EAPI guard?
> https://devmanual.gentoo.org/eclass-writing/index.html#handling-incorrect-usage-of-an-eclass

Absolutely. Thanks for the feedback.

-- Thomas


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-18 20:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-18 19:38 [gentoo-dev] [PATCH] gkrellm-plugin.eclass: Support EAPI 8 Thomas Bracht Laumann Jespersen
2022-03-18 20:32 ` Anna Vyalkova
2022-03-18 20:50   ` Thomas Bracht Laumann Jespersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox