Mailing List Archive

[PATCH 2/2] meson.eclass: EAPI 8 support
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
Re: [PATCH 2/2] meson.eclass: EAPI 8 support [ In reply to ]
>>>>> 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