• [gentoo-dev] [PATCH] meson.eclass: allow disabling verbose compilation

    From Matt Turner@21:1/5 to All on Mon Jul 17 17:00:01 2023
    From: Jonas Rakebrandt <xarblu@protonmail.com>

    This works similar to cmake.eclass's ${CMAKE_VERBOSE}.

    Closes: https://github.com/gentoo/gentoo/pull/28942
    Signed-off-by: Jonas Rakebrandt <xarblu@protonmail.com>
    Signed-off-by: Matt Turner <mattst88@gentoo.org>
    ---
    eclass/meson.eclass | 14 ++++++++++++--
    1 file changed, 12 insertions(+), 2 deletions(-)

    diff --git a/eclass/meson.eclass b/eclass/meson.eclass
    index 2c274b213191..1acdee9325b2 100644
    --- a/eclass/meson.eclass
    +++ b/eclass/meson.eclass
    @@ -55,6 +55,12 @@ BDEPEND=">=dev-util/meson-0.62.2
    # Build directory, location where all generated files should be placed.
    # If this isn't set, it defaults to ${WORKDIR}/${P}-build.

    +# @ECLASS_VARIABLE: MESON_QUIET
    +# @USER_VARIABLE
    +# @DEFAULT_UNSET
    +# @DESCRIPTION:
    +# Disables verbose messages during compilation if non-empty.
    +
    # @ECLASS_VARIABLE: EMESON_BUILDTYPE
    # @DESCRIPTION:
    # The buildtype value to pass to meson setup.
    @@ -385,10 +391,14 @@ meson_src_compile() {
    -C "${BUILD_DIR}"
    --jobs "$(makeopts_jobs "${MAKEOPTS}" 0)"
    --load-average "$(makeopts_loadavg "${MAKEOPTS}" 0)"
    - --verbose
    - "$@"
    )

    + if [[ -z ${MESON_QUIET} ]]; then
    + mesoncompileargs+=( --verbose )
    + fi
    +
    + mesoncompileargs+=( "$@" )
    +
    set --
  • From Matt Turner@21:1/5 to mattst88@gentoo.org on Mon Jul 17 17:30:01 2023
    On Mon, Jul 17, 2023 at 10:51 AM Matt Turner <mattst88@gentoo.org> wrote:

    From: Jonas Rakebrandt <xarblu@protonmail.com>

    This works similar to cmake.eclass's ${CMAKE_VERBOSE}.

    ... except that it's _QUIET, rather than _VERBOSE.

    I've sent patches to add NINJA_VERBOSE to ninja-utils.eclass and
    another to support CMAKE_VERBOSE with ninja.

    This makes me think we should keep things consistent here by switching
    this to MESON_VERBOSE.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Matt Turner@21:1/5 to All on Tue Jul 18 18:50:01 2023
    From: Jonas Rakebrandt <xarblu@protonmail.com>

    This works similar to cmake.eclass's ${CMAKE_VERBOSE}.

    Closes: https://github.com/gentoo/gentoo/pull/28942
    Signed-off-by: Jonas Rakebrandt <xarblu@protonmail.com>
    Signed-off-by: Matt Turner <mattst88@gentoo.org>
    ---
    eclass/meson.eclass | 15 +++++++++++++--
    1 file changed, 13 insertions(+), 2 deletions(-)

    diff --git a/eclass/meson.eclass b/eclass/meson.eclass
    index 2c274b213191..3b30f66bf30a 100644
    --- a/eclass/meson.eclass
    +++ b/eclass/meson.eclass
    @@ -55,6 +55,12 @@ BDEPEND=">=dev-util/meson-0.62.2
    # Build directory, location where all generated files should be placed.
    # If this isn't set, it defaults to ${WORKDIR}/${P}-build.

    +# @ECLASS_VARIABLE: MESON_VERBOSE
    +# @USER_VARIABLE
    +# @DESCRIPTION:
    +# Set to OFF to disable verbose messages during compilation
    +: "${MESON_VERBOSE:=ON}"
    +
    # @ECLASS_VARIABLE: EMESON_BUILDTYPE
    # @DESCRIPTION:
    # The buildtype value to pass to meson setup.
    @@ -385,10 +391,15 @@ meson_src_compile() {
    -C "${BUILD_DIR}"
    --jobs "$(makeopts_jobs "${MAKEOPTS}" 0)"
    --load-average "$(makeopts_loadavg "${MAKEOPTS}" 0)"
    - --verbose
    - "$@"
    )

    + case ${MESON_VERBOSE} in
    + OFF) ;;
    + *) mesoncompileargs+=( --verbose ) ;;
    + esac
    +
    + mesoncompileargs+