public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] wxwidgets.eclass: Support EAPI 8
@ 2021-08-01 12:36 Ulrich Müller
  2021-08-01 12:40 ` Michał Górny
  2021-08-01 16:47 ` [gentoo-dev] [PATCH v2] " Ulrich Müller
  0 siblings, 2 replies; 5+ messages in thread
From: Ulrich Müller @ 2021-08-01 12:36 UTC (permalink / raw
  To: gentoo-dev; +Cc: Ulrich Müller, Mart Raudsepp, David Seifert

Reviewed-by: Mart Raudsepp <leio@gentoo.org>
Reviewed-by: David Seifert <soap@gentoo.org>
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
---
 eclass/wxwidgets.eclass | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/eclass/wxwidgets.eclass b/eclass/wxwidgets.eclass
index 4357e7367cc7..28735aaac6fd 100644
--- a/eclass/wxwidgets.eclass
+++ b/eclass/wxwidgets.eclass
@@ -4,7 +4,7 @@
 # @ECLASS: wxwidgets.eclass
 # @MAINTAINER:
 # wxwidgets@gentoo.org
-# @SUPPORTED_EAPIS: 7
+# @SUPPORTED_EAPIS: 7 8
 # @BLURB: Manages build configuration for wxGTK-using packages.
 # @DESCRIPTION:
 # This eclass sets up the proper environment for ebuilds using the wxGTK
@@ -21,10 +21,9 @@
 # The configuration chosen is based on the version required and the flags
 # wxGTK was built with.
 
-case ${EAPI:-0} in
-	[0-6]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;;
-	7)     ;;
-	*)     die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;;
+case ${EAPI} in
+	7|8) ;;
+	*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
 if [[ -z ${_WXWIDGETS_ECLASS} ]]; then
@@ -37,7 +36,9 @@ _WXWIDGETS_ECLASS=1
 # The SLOT of the x11-libs/wxGTK you're targeting.  Needs to be defined before
 # inheriting the eclass.  Can be either "3.0" or "3.0-gtk3".
 case ${WX_GTK_VER} in
-	3.0|3.0-gtk3) ;;
+	3.0-gtk3)     ;;
+	3.0)          [[ ${EAPI} == 7 ]] \
+		              || die "GTK 2 no longer supported in EAPI ${EAPI}" ;;
 	"")           die "WX_GTK_VER not declared" ;;
 	*)            die "Invalid WX_GTK_VER: must be set to a valid wxGTK SLOT ('3.0' or '3.0-gtk3')" ;;
 esac
-- 
2.32.0



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

* Re: [gentoo-dev] [PATCH] wxwidgets.eclass: Support EAPI 8
  2021-08-01 12:36 [gentoo-dev] [PATCH] wxwidgets.eclass: Support EAPI 8 Ulrich Müller
@ 2021-08-01 12:40 ` Michał Górny
  2021-08-01 14:40   ` Ulrich Mueller
  2021-08-01 16:47 ` [gentoo-dev] [PATCH v2] " Ulrich Müller
  1 sibling, 1 reply; 5+ messages in thread
From: Michał Górny @ 2021-08-01 12:40 UTC (permalink / raw
  To: gentoo-dev; +Cc: Ulrich Müller, Mart Raudsepp, David Seifert

On Sun, 2021-08-01 at 14:36 +0200, Ulrich Müller wrote:
> Reviewed-by: Mart Raudsepp <leio@gentoo.org>
> Reviewed-by: David Seifert <soap@gentoo.org>
> Signed-off-by: Ulrich Müller <ulm@gentoo.org>
> ---
>  eclass/wxwidgets.eclass | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/eclass/wxwidgets.eclass b/eclass/wxwidgets.eclass
> index 4357e7367cc7..28735aaac6fd 100644
> --- a/eclass/wxwidgets.eclass
> +++ b/eclass/wxwidgets.eclass
> @@ -4,7 +4,7 @@
>  # @ECLASS: wxwidgets.eclass
>  # @MAINTAINER:
>  # wxwidgets@gentoo.org
> -# @SUPPORTED_EAPIS: 7
> +# @SUPPORTED_EAPIS: 7 8
>  # @BLURB: Manages build configuration for wxGTK-using packages.
>  # @DESCRIPTION:
>  # This eclass sets up the proper environment for ebuilds using the wxGTK
> @@ -21,10 +21,9 @@
>  # The configuration chosen is based on the version required and the flags
>  # wxGTK was built with.
>  
> -case ${EAPI:-0} in
> -	[0-6]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;;
> -	7)     ;;
> -	*)     die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;;
> +case ${EAPI} in
> +	7|8) ;;
> +	*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
>  esac
>  
>  if [[ -z ${_WXWIDGETS_ECLASS} ]]; then
> @@ -37,7 +36,9 @@ _WXWIDGETS_ECLASS=1
>  # The SLOT of the x11-libs/wxGTK you're targeting.  Needs to be defined before
>  # inheriting the eclass.  Can be either "3.0" or "3.0-gtk3".
>  case ${WX_GTK_VER} in
> -	3.0|3.0-gtk3) ;;
> +	3.0-gtk3)     ;;
> +	3.0)          [[ ${EAPI} == 7 ]] \
> +		              || die "GTK 2 no longer supported in EAPI ${EAPI}" ;;

Let's make it:

  [[ ${EAPI} != 7 ]] && die ...

to keep the logic more straightforward (and consistent with 'if ...;
then').

>  	"")           die "WX_GTK_VER not declared" ;;
>  	*)            die "Invalid WX_GTK_VER: must be set to a valid wxGTK SLOT ('3.0' or '3.0-gtk3')" ;;
>  esac

-- 
Best regards,
Michał Górny




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

* Re: [gentoo-dev] [PATCH] wxwidgets.eclass: Support EAPI 8
  2021-08-01 12:40 ` Michał Górny
@ 2021-08-01 14:40   ` Ulrich Mueller
  2021-08-01 16:12     ` Michał Górny
  0 siblings, 1 reply; 5+ messages in thread
From: Ulrich Mueller @ 2021-08-01 14:40 UTC (permalink / raw
  To: Michał Górny; +Cc: gentoo-dev, Mart Raudsepp, David Seifert

[-- Attachment #1: Type: text/plain, Size: 729 bytes --]

>>>>> On Sun, 01 Aug 2021, Michał Górny wrote:

>> +	3.0)          [[ ${EAPI} == 7 ]] \
>> +		              || die "GTK 2 no longer supported in EAPI ${EAPI}" ;;

> Let's make it:

>   [[ ${EAPI} != 7 ]] && die ...

> to keep the logic more straightforward (and consistent with 'if ...;
> then').

Generally, I like the "<successful statement> || die" style more,
because it is more common. It is also more consistent about the return
status of the whole expression. With the && operator above, it would
return shell false in case of success.

Of course, there's no functional difference here, but if you have it at
the end of a function or before an explicit return statement it may play
a role.

Ulrich

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 507 bytes --]

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

* Re: [gentoo-dev] [PATCH] wxwidgets.eclass: Support EAPI 8
  2021-08-01 14:40   ` Ulrich Mueller
@ 2021-08-01 16:12     ` Michał Górny
  0 siblings, 0 replies; 5+ messages in thread
From: Michał Górny @ 2021-08-01 16:12 UTC (permalink / raw
  To: gentoo-dev; +Cc: Mart Raudsepp, David Seifert

On Sun, 2021-08-01 at 16:40 +0200, Ulrich Mueller wrote:
> > > > > > On Sun, 01 Aug 2021, Michał Górny wrote:
> 
> > > +	3.0)          [[ ${EAPI} == 7 ]] \
> > > +		              || die "GTK 2 no longer supported
> > > in EAPI ${EAPI}" ;;
> 
> > Let's make it:
> 
> >   [[ ${EAPI} != 7 ]] && die ...
> 
> > to keep the logic more straightforward (and consistent with 'if ...;
> > then').
> 
> Generally, I like the "<successful statement> || die" style more,
> because it is more common. It is also more consistent about the return
> status of the whole expression. With the && operator above, it would
> return shell false in case of success.

A user requested the other style in one of my earlier patches,
and I kinda agree that this reverse logic can easily get confusing.

> Of course, there's no functional difference here, but if you have it
> at
> the end of a function or before an explicit return statement it may
> play
> a role.

...only if it's nonfatal-friendly.

-- 
Best regards,
Michał Górny




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

* [gentoo-dev] [PATCH v2] wxwidgets.eclass: Support EAPI 8
  2021-08-01 12:36 [gentoo-dev] [PATCH] wxwidgets.eclass: Support EAPI 8 Ulrich Müller
  2021-08-01 12:40 ` Michał Górny
@ 2021-08-01 16:47 ` Ulrich Müller
  1 sibling, 0 replies; 5+ messages in thread
From: Ulrich Müller @ 2021-08-01 16:47 UTC (permalink / raw
  To: gentoo-dev; +Cc: Ulrich Müller, Mart Raudsepp, David Seifert

Reviewed-by: Mart Raudsepp <leio@gentoo.org>
Reviewed-by: David Seifert <soap@gentoo.org>
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
---
v2: Use negative logic in EAPI test

 eclass/wxwidgets.eclass | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/eclass/wxwidgets.eclass b/eclass/wxwidgets.eclass
index 4357e7367cc7..273e6ac72d41 100644
--- a/eclass/wxwidgets.eclass
+++ b/eclass/wxwidgets.eclass
@@ -4,7 +4,7 @@
 # @ECLASS: wxwidgets.eclass
 # @MAINTAINER:
 # wxwidgets@gentoo.org
-# @SUPPORTED_EAPIS: 7
+# @SUPPORTED_EAPIS: 7 8
 # @BLURB: Manages build configuration for wxGTK-using packages.
 # @DESCRIPTION:
 # This eclass sets up the proper environment for ebuilds using the wxGTK
@@ -21,10 +21,9 @@
 # The configuration chosen is based on the version required and the flags
 # wxGTK was built with.
 
-case ${EAPI:-0} in
-	[0-6]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;;
-	7)     ;;
-	*)     die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;;
+case ${EAPI} in
+	7|8) ;;
+	*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
 if [[ -z ${_WXWIDGETS_ECLASS} ]]; then
@@ -37,9 +36,14 @@ _WXWIDGETS_ECLASS=1
 # The SLOT of the x11-libs/wxGTK you're targeting.  Needs to be defined before
 # inheriting the eclass.  Can be either "3.0" or "3.0-gtk3".
 case ${WX_GTK_VER} in
-	3.0|3.0-gtk3) ;;
-	"")           die "WX_GTK_VER not declared" ;;
-	*)            die "Invalid WX_GTK_VER: must be set to a valid wxGTK SLOT ('3.0' or '3.0-gtk3')" ;;
+	3.0-gtk3) ;;
+	3.0)
+		if [[ ${EAPI} != 7 ]]; then
+			die "${ECLASS}: GTK 2 no longer supported in EAPI ${EAPI}"
+		fi
+		;;
+	"") die "WX_GTK_VER not declared" ;;
+	*)  die "Invalid WX_GTK_VER: must be set to a valid wxGTK SLOT ('3.0' or '3.0-gtk3')" ;;
 esac
 readonly WX_GTK_VER
 
-- 
2.32.0



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

end of thread, other threads:[~2021-08-01 16:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-01 12:36 [gentoo-dev] [PATCH] wxwidgets.eclass: Support EAPI 8 Ulrich Müller
2021-08-01 12:40 ` Michał Górny
2021-08-01 14:40   ` Ulrich Mueller
2021-08-01 16:12     ` Michał Górny
2021-08-01 16:47 ` [gentoo-dev] [PATCH v2] " Ulrich Müller

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