Gentoo Archives: gentoo-dev

From: Mike Gilbert <floppym@g.o>
To: Gentoo Dev <gentoo-dev@l.g.o>
Cc: orbea <orbea@××××××.net>
Subject: [gentoo-dev] Re: [PATCH 1/5] ninja-utils.eclass: Support dev-util/samurai
Date: Mon, 09 May 2022 14:59:23
Message-Id: CAJ0EP40SKVaa4C2LzZuMp3ebrmtYhePZRVNFnhor8db3pr79cA@mail.gmail.com
In Reply to: [gentoo-dev] [PATCH 1/5] ninja-utils.eclass: Support dev-util/samurai by Sam James
1 On Sun, May 8, 2022 at 7:07 PM Sam James <sam@g.o> wrote:
2 >
3 > From: orbea <orbea@××××××.net>
4 >
5 > samurai is a ninja-compatible build tool written in C which
6 > works with cmake, meson and other users of ninja.
7 >
8 > It is feature-complete and supports most of the same options
9 > as ninja.
10 >
11 > Signed-off-by: orbea <orbea@××××××.net>
12 > Signed-off-by: Sam James <sam@g.o>
13 > ---
14 > eclass/ninja-utils.eclass | 24 +++++++++++++++++++++++-
15 > 1 file changed, 23 insertions(+), 1 deletion(-)
16 >
17 > diff --git a/eclass/ninja-utils.eclass b/eclass/ninja-utils.eclass
18 > index c5f34934192f..67f7a6b5e8a7 100644
19 > --- a/eclass/ninja-utils.eclass
20 > +++ b/eclass/ninja-utils.eclass
21 > @@ -26,6 +26,15 @@ esac
22 > if [[ -z ${_NINJA_UTILS_ECLASS} ]]; then
23 > _NINJA_UTILS_ECLASS=1
24 >
25 > +# @ECLASS_VARIABLE: NINJA
26 > +# @PRE_INHERIT
27 > +# @DEFAULT_UNSET
28 > +# @DESCRIPTION:
29 > +# Specify a compatible ninja implementation to be used by eninja.
30 > +# At this point only "ninja" and "samu" are supported.
31 > +# The default is set to "ninja".
32 > +: ${NINJA:=ninja}
33
34 This is tagged as @DEFAULT_UNSET, but the description and
35 implementation indicate that it defaults to "ninja".
36
37 > # @ECLASS_VARIABLE: NINJAOPTS
38 > # @DEFAULT_UNSET
39 > # @DESCRIPTION:
40 > @@ -35,6 +44,19 @@ _NINJA_UTILS_ECLASS=1
41 >
42 > inherit multiprocessing
43 >
44 > +case "${NINJA}" in
45 > + ninja)
46 > + NINJA_DEPEND=">=dev-util/ninja-1.8.2"
47 > + ;;
48 > + samu)
49 > + NINJA_DEPEND="dev-util/samurai"
50 > + ;;
51 > + *)
52 > + eerror "Unknown value for \${NINJA}"
53 > + die "Value ${NINJA} is not supported"
54 > + ;;
55 > +esac
56
57 The NINJA environment variable is used directly by meson and may
58 contain an absolute path. I don't think it makes sense to restrict
59 possible values to just "ninja" and "samu". That will make it more
60 difficult for users to override it with a local copy of either tool,
61 or to use a different implementation should someone write one in the
62 future.
63
64 It might make sense to introduce a different eclass variable to
65 control NINJA_DEPEND and the default value for NINJA.