diff options
author | orbea <orbea@riseup.net> | 2021-04-09 11:38:55 -0700 |
---|---|---|
committer | Mike Gilbert <floppym@gentoo.org> | 2022-05-10 22:13:17 -0400 |
commit | 1c01b84199785b35fa0b79f6ec990964bd09ceae (patch) | |
tree | c9ccac7f83eb69f5af74a6e3476c09f7714f68a4 /eclass | |
parent | profiles: unmask capstone (diff) | |
download | gentoo-1c01b84199785b35fa0b79f6ec990964bd09ceae.tar.gz gentoo-1c01b84199785b35fa0b79f6ec990964bd09ceae.tar.bz2 gentoo-1c01b84199785b35fa0b79f6ec990964bd09ceae.zip |
ninja-utils.eclass: Support dev-util/samurai
samurai is a ninja-compatible build tool written in C which
works with cmake, meson and other users of ninja.
It is feature-complete and supports most of the same options
as ninja.
Signed-off-by: orbea <orbea@riseup.net>
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/ninja-utils.eclass | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/eclass/ninja-utils.eclass b/eclass/ninja-utils.eclass index c5f34934192f..cf98e866d152 100644 --- a/eclass/ninja-utils.eclass +++ b/eclass/ninja-utils.eclass @@ -26,6 +26,16 @@ esac if [[ -z ${_NINJA_UTILS_ECLASS} ]]; then _NINJA_UTILS_ECLASS=1 +# @ECLASS_VARIABLE: NINJA +# @PRE_INHERIT +# @DESCRIPTION: +# Specify a compatible ninja implementation to be used by eninja(). +# At this point only "ninja" and "samu" are explicitly supported, +# but other values can be set where NINJA_DEPEND will then be set +# to a blank variable. +# The default is set to "ninja". +: ${NINJA:=ninja} + # @ECLASS_VARIABLE: NINJAOPTS # @DEFAULT_UNSET # @DESCRIPTION: @@ -35,6 +45,18 @@ _NINJA_UTILS_ECLASS=1 inherit multiprocessing +case "${NINJA}" in + ninja) + NINJA_DEPEND=">=dev-util/ninja-1.8.2" + ;; + samu) + NINJA_DEPEND="dev-util/samurai" + ;; + *) + NINJA_DEPEND="" + ;; +esac + # @FUNCTION: eninja # @USAGE: [<args>...] # @DESCRIPTION: @@ -48,7 +70,8 @@ eninja() { if [[ -z ${NINJAOPTS+set} ]]; then NINJAOPTS="-j$(makeopts_jobs "${MAKEOPTS}" 999) -l$(makeopts_loadavg "${MAKEOPTS}" 0)" fi - set -- ninja -v ${NINJAOPTS} "$@" + [[ -n "${NINJA_DEPEND}" ]] || ewarn "Unknown value '${NINJA}' for \${NINJA}" + set -- "${NINJA}" -v ${NINJAOPTS} "$@" echo "$@" >&2 "$@" || die "${nonfatal_args[@]}" "${*} failed" } |