public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 2/2] meson.eclass: EAPI 8 support
@ 2021-06-24 16:41 David Michael
  2021-06-24 16:59 ` Ulrich Mueller
  0 siblings, 1 reply; 2+ messages in thread
From: David Michael @ 2021-06-24 16:41 UTC (permalink / raw
  To: gentoo-dev; +Cc: floppym, williamh

Signed-off-by: David Michael <fedora.dm0@gmail.com>
---

Hi,

This updates meson.eclass to conform to conventions that other eclasses
seem to follow.  E.g. conditional inherits are first (presumably for
function precedence), and defining the inherit guard at the end.  It
also removes the split inherit guard.  The only reason I saw for it is
https://bugs.gentoo.org/619178#c4 with no further details.  Are there
actually any examples of this being a problem?  A couple Python eclasses
seem to be the only other instances of this.

Thanks.

David

 eclass/meson.eclass | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/eclass/meson.eclass b/eclass/meson.eclass
index c9a5e0b5956..583cc30c8c3 100644
--- a/eclass/meson.eclass
+++ b/eclass/meson.eclass
@@ -5,7 +5,7 @@
 # @MAINTAINER:
 # William Hubbs <williamh@gentoo.org>
 # Mike Gilbert <floppym@gentoo.org>
-# @SUPPORTED_EAPIS: 6 7
+# @SUPPORTED_EAPIS: 6 7 8
 # @BLURB: common ebuild functions for meson-based packages
 # @DESCRIPTION:
 # This eclass contains the default phase functions for packages which
@@ -15,7 +15,7 @@
 # Typical ebuild using meson.eclass:
 #
 # @CODE
-# EAPI=6
+# EAPI=8
 #
 # inherit meson
 #
@@ -23,7 +23,7 @@
 #
 # src_configure() {
 # 	local emesonargs=(
-# 		$(meson_use qt4)
+# 		$(meson_use qt5)
 # 		$(meson_feature threads)
 # 		$(meson_use bindist official_branding)
 # 	)
@@ -35,31 +35,23 @@
 # @CODE
 
 case ${EAPI:-0} in
-	6|7) ;;
-	*) die "EAPI=${EAPI} is not supported" ;;
+	6|7|8) ;;
+	*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
 if [[ -z ${_MESON_ECLASS} ]]; then
 
+[[ ${EAPI} == 6 ]] && inherit eapi7-ver
 inherit multiprocessing ninja-utils python-utils-r1 toolchain-funcs
 
-if [[ ${EAPI} == 6 ]]; then
-	inherit eapi7-ver
-fi
-
-fi
-
 EXPORT_FUNCTIONS src_configure src_compile src_test src_install
 
-if [[ -z ${_MESON_ECLASS} ]]; then
-_MESON_ECLASS=1
-
 MESON_DEPEND=">=dev-util/meson-0.56.0
 	>=dev-util/ninja-1.8.2
 	dev-util/meson-format-array
 "
 
-if [[ ${EAPI:-0} == [6] ]]; then
+if [[ ${EAPI} == 6 ]]; then
 	DEPEND=${MESON_DEPEND}
 else
 	BDEPEND=${MESON_DEPEND}
@@ -426,4 +418,5 @@ meson_src_install() {
 	popd > /dev/null || die
 }
 
+_MESON_ECLASS=1
 fi
-- 
2.31.1


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

* Re: [gentoo-dev] [PATCH 2/2] meson.eclass: EAPI 8 support
  2021-06-24 16:41 [gentoo-dev] [PATCH 2/2] meson.eclass: EAPI 8 support David Michael
@ 2021-06-24 16:59 ` Ulrich Mueller
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Mueller @ 2021-06-24 16:59 UTC (permalink / raw
  To: David Michael; +Cc: gentoo-dev, floppym, williamh

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

>>>>> On Thu, 24 Jun 2021, David Michael wrote:

>  if [[ -z ${_MESON_ECLASS} ]]; then

Here would be a good place to assign _MESON_ECLASS=1. It should go
_before_ any inherit commands, otherwise it won't prevent circular
inherits.

>  
> +[[ ${EAPI} == 6 ]] && inherit eapi7-ver
>  inherit multiprocessing ninja-utils python-utils-r1 toolchain-funcs
 
> [...]
 
> +_MESON_ECLASS=1

Too late here.

>  fi

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

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

end of thread, other threads:[~2021-06-24 16:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-24 16:41 [gentoo-dev] [PATCH 2/2] meson.eclass: EAPI 8 support David Michael
2021-06-24 16:59 ` Ulrich Mueller

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