* [gentoo-dev] [PATCH 1/2] ninja-utils.eclass: EAPI 8 support
@ 2021-06-24 16:40 David Michael
2021-06-24 16:51 ` Ulrich Mueller
0 siblings, 1 reply; 3+ messages in thread
From: David Michael @ 2021-06-24 16:40 UTC (permalink / raw
To: gentoo-dev; +Cc: floppym, mgorny
Also drop support for EAPIs < 5 to match multiprocessing.eclass.
Signed-off-by: David Michael <fedora.dm0@gmail.com>
---
Hi,
Here are a couple patches to support EAPI 8 with meson packages. I also
posted this to https://github.com/gentoo/gentoo/pull/21409 for review.
Thanks.
David
eclass/ninja-utils.eclass | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/eclass/ninja-utils.eclass b/eclass/ninja-utils.eclass
index ca8d67191dc..f8f088b4209 100644
--- a/eclass/ninja-utils.eclass
+++ b/eclass/ninja-utils.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2021 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: ninja-utils.eclass
@@ -8,7 +8,7 @@
# @AUTHOR:
# Michał Górny <mgorny@gentoo.org>
# Mike Gilbert <floppym@gentoo.org>
-# @SUPPORTED_EAPIS: 2 4 5 6 7
+# @SUPPORTED_EAPIS: 5 6 7 8
# @BLURB: common bits to run dev-util/ninja builder
# @DESCRIPTION:
# This eclass provides a single function -- eninja -- that can be used
@@ -21,10 +21,8 @@
if [[ -z ${_NINJA_UTILS_ECLASS} ]]; then
case ${EAPI:-0} in
- 0|1|3) die "EAPI=${EAPI:-0} is not supported (too old)";;
- # copied from cmake-utils
- 2|4|5|6|7) ;;
- *) die "EAPI=${EAPI} is not yet supported" ;;
+ 5|6|7|8) ;;
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
# @ECLASS-VARIABLE: NINJAOPTS
@@ -44,7 +42,7 @@ inherit multiprocessing
# with EAPI 6, it also supports being called via 'nonfatal'.
eninja() {
local nonfatal_args=()
- [[ ${EAPI:-0} != [245] ]] && nonfatal_args+=( -n )
+ [[ ${EAPI} != 5 ]] && nonfatal_args+=( -n )
if [[ -z ${NINJAOPTS+set} ]]; then
NINJAOPTS="-j$(makeopts_jobs) -l$(makeopts_loadavg "${MAKEOPTS}" 0)"
--
2.31.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [gentoo-dev] [PATCH 1/2] ninja-utils.eclass: EAPI 8 support
2021-06-24 16:40 [gentoo-dev] [PATCH 1/2] ninja-utils.eclass: EAPI 8 support David Michael
@ 2021-06-24 16:51 ` Ulrich Mueller
2021-06-24 17:07 ` David Michael
0 siblings, 1 reply; 3+ messages in thread
From: Ulrich Mueller @ 2021-06-24 16:51 UTC (permalink / raw
To: David Michael; +Cc: gentoo-dev, floppym, mgorny
[-- Attachment #1: Type: text/plain, Size: 1521 bytes --]
>>>>> On Thu, 24 Jun 2021, David Michael wrote:
> --- a/eclass/ninja-utils.eclass
> +++ b/eclass/ninja-utils.eclass
> @@ -1,4 +1,4 @@
> -# Copyright 1999-2018 Gentoo Foundation
> +# Copyright 1999-2021 Gentoo Foundation
Please update to "Gentoo Authors".
> # Distributed under the terms of the GNU General Public License v2
>
> # @ECLASS: ninja-utils.eclass
> @@ -8,7 +8,7 @@
> # @AUTHOR:
> # Michał Górny <mgorny@gentoo.org>
> # Mike Gilbert <floppym@gentoo.org>
> -# @SUPPORTED_EAPIS: 2 4 5 6 7
> +# @SUPPORTED_EAPIS: 5 6 7 8
> # @BLURB: common bits to run dev-util/ninja builder
> # @DESCRIPTION:
> # This eclass provides a single function -- eninja -- that can be used
> @@ -21,10 +21,8 @@
> if [[ -z ${_NINJA_UTILS_ECLASS} ]]; then
>
> case ${EAPI:-0} in
This could be simplified to "case ${EAPI} in".
> - 0|1|3) die "EAPI=${EAPI:-0} is not supported (too old)";;
> - # copied from cmake-utils
> - 2|4|5|6|7) ;;
> - *) die "EAPI=${EAPI} is not yet supported" ;;
> + 5|6|7|8) ;;
> + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
> esac
>
> # @ECLASS-VARIABLE: NINJAOPTS
> @@ -44,7 +42,7 @@ inherit multiprocessing
> # with EAPI 6, it also supports being called via 'nonfatal'.
> eninja() {
> local nonfatal_args=()
> - [[ ${EAPI:-0} != [245] ]] && nonfatal_args+=( -n )
> + [[ ${EAPI} != 5 ]] && nonfatal_args+=( -n )
>
> if [[ -z ${NINJAOPTS+set} ]]; then
> NINJAOPTS="-j$(makeopts_jobs) -l$(makeopts_loadavg "${MAKEOPTS}" 0)"
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 507 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [gentoo-dev] [PATCH 1/2] ninja-utils.eclass: EAPI 8 support
2021-06-24 16:51 ` Ulrich Mueller
@ 2021-06-24 17:07 ` David Michael
0 siblings, 0 replies; 3+ messages in thread
From: David Michael @ 2021-06-24 17:07 UTC (permalink / raw
To: Ulrich Mueller; +Cc: gentoo-dev, Mike Gilbert, Michał Górny
On Thu, Jun 24, 2021 at 12:51 PM Ulrich Mueller <ulm@gentoo.org> wrote:
> >>>>> On Thu, 24 Jun 2021, David Michael wrote:
> > --- a/eclass/ninja-utils.eclass
> > +++ b/eclass/ninja-utils.eclass
> > @@ -1,4 +1,4 @@
> > -# Copyright 1999-2018 Gentoo Foundation
> > +# Copyright 1999-2021 Gentoo Foundation
>
> Please update to "Gentoo Authors".
>
> > # Distributed under the terms of the GNU General Public License v2
> >
> > # @ECLASS: ninja-utils.eclass
> > @@ -8,7 +8,7 @@
> > # @AUTHOR:
> > # Michał Górny <mgorny@gentoo.org>
> > # Mike Gilbert <floppym@gentoo.org>
> > -# @SUPPORTED_EAPIS: 2 4 5 6 7
> > +# @SUPPORTED_EAPIS: 5 6 7 8
> > # @BLURB: common bits to run dev-util/ninja builder
> > # @DESCRIPTION:
> > # This eclass provides a single function -- eninja -- that can be used
> > @@ -21,10 +21,8 @@
> > if [[ -z ${_NINJA_UTILS_ECLASS} ]]; then
> >
> > case ${EAPI:-0} in
>
> This could be simplified to "case ${EAPI} in".
Okay, I've updated https://github.com/gentoo/gentoo/pull/21409 and
also moved the EAPI check outside the inherit guard, since that's what
other eclasses seem to do.
Thanks.
David
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-06-24 17:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-24 16:40 [gentoo-dev] [PATCH 1/2] ninja-utils.eclass: EAPI 8 support David Michael
2021-06-24 16:51 ` Ulrich Mueller
2021-06-24 17:07 ` David Michael
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox