On Tue, Aug 24, 2021 at 1:35 AM William Hubbs <[email protected]> wrote:
>
> Use the compile and install subcommands of meson instead of calling
> ninja. This allows for the possibility of a different back end.
>
> Signed-off-by: William Hubbs <[email protected]>
> ---
>  eclass/meson.eclass | 24 +++++++++++++++++++++---
>  1 file changed, 21 insertions(+), 3 deletions(-)
>
> diff --git a/eclass/meson.eclass b/eclass/meson.eclass
> index 2a563e367c6..e9c9b155096 100644
> --- a/eclass/meson.eclass
> +++ b/eclass/meson.eclass
> @@ -379,7 +379,21 @@ meson_src_configure() {
>  meson_src_compile() {
>         debug-print-function ${FUNCNAME} "$@"
>
> -       eninja -C "${BUILD_DIR}" "$@"
> +       local mesoncompileargs=(
> +               -C "${BUILD_DIR}"
> +       )
> +       if [[ -n ${NINJAOPTS} ]]; then
> +               mesoncompileargs+=(
> +                       --jobs "$(makeopts_jobs ${NINJAOPTS})"
> +                       --load-average "$(makeopts_loadavg ${NINJAOPTS})"
> +               )
> +       elif [[ -n ${MAKEOPTS} ]]; then
> +               mesoncompileargs+=(
> +                       --jobs "$(makeopts_jobs ${MAKEOPTS})"
> +                       --load-average "$(makeopts_loadavg ${MAKEOPTS})"

${MAKEOPTS} should be quoted on the above 2 lines.

makeopts_loadavg outputs 999 by default if the load average is not
specified. Please override this as "0" by passing it as the second
argument.

> +               )
> +
> +       meson compile "${mesoncompileargs[@]}" "$@" || die "compile failed"
>  }
>
>  # @FUNCTION: meson_src_test
> @@ -406,13 +420,17 @@ meson_src_test() {
>  }
>
>  # @FUNCTION: meson_src_install
> -# @USAGE: [extra ninja install arguments]
> +# @USAGE: [extra meson install arguments]
>  # @DESCRIPTION:
>  # This is the meson_src_install function.
>  meson_src_install() {
>         debug-print-function ${FUNCNAME} "$@"
>
> -       DESTDIR="${D}" eninja -C "${BUILD_DIR}" install "$@"
> +       local mesoninstallargs=(
> +               -C "${BUILD_DIR}" "$@"
> +               --destdir "${D}"
> +       )
> +       meson install "${mesoninstallargs[@]}" "$@"

You are including "$@" twice: once in mesoninstallargs, and once on
the above line. Please remove it from mesoninstallargs.

Reply via email to