MESON.ECLASS

Section: eclass-manpages (5)
Updated: Apr 2024
Index Return to Main Contents

NAME

meson.eclass - common ebuild functions for meson-based packages

DESCRIPTION

This eclass contains the default phase functions for packages which use the meson build system.

SUPPORTED EAPIS

7 8

EXAMPLE

Typical ebuild using meson.eclass:

EAPI=8

inherit meson

...

src_configure() {
        local emesonargs=(
                $(meson_use qt5)
                $(meson_feature threads)
                $(meson_use bindist official_branding)
        )
        meson_src_configure
}

...

FUNCTIONS

emesonargs
Optional meson arguments as Bash array; this should be defined before calling meson_src_configure.
MYMESONARGS
User-controlled environment variable containing arguments to be passed to meson in meson_src_configure.
meson_use <USE flag> [option name]
Given a USE flag and meson project option, outputs a string like:


  -Doption=true
  -Doption=false

If the project option is unspecified, it defaults to the USE flag.

meson_feature <USE flag> [option name]
Given a USE flag and meson project option, outputs a string like:


  -Doption=enabled
  -Doption=disabled

If the project option is unspecified, it defaults to the USE flag.

setup_meson_src_configure
Calculate the command line which meson should use, and other relevant variables. Invoke via "${MESONARGS[@]}" in the calling environment. This function is called from meson_src_configure.
meson_src_configure [extra meson arguments]
This is the meson_src_configure function.
meson_src_compile [extra ninja arguments]
This is the meson_src_compile function.
meson_src_test [extra meson test arguments]
This is the meson_src_test function.
meson_install [extra meson install arguments]
Calls meson install with suitable arguments
meson_src_install [extra meson install arguments]
This is the meson_src_install function.

ECLASS VARIABLES

BUILD_DIR
Build directory, location where all generated files should be placed. If this isn't set, it defaults to ${WORKDIR}/${P}-build.
MESON_VERBOSE ?= ON (USER VARIABLE)
Set to OFF to disable verbose messages during compilation
EMESON_BUILDTYPE = plain}"
The buildtype value to pass to meson setup.
EMESON_SOURCE
The location of the source files for the project; this is the source directory to pass to meson. If this isn't set, it defaults to ${S}

MAINTAINERS

base-system@gentoo.org

REPORTING BUGS

Please report bugs via https://bugs.gentoo.org/

FILES

meson.eclass

SEE ALSO

ebuild(5)
https://gitweb.gentoo.org/repo/gentoo.git/log/eclass/meson.eclass


Index

NAME
DESCRIPTION
SUPPORTED EAPIS
EXAMPLE
FUNCTIONS
ECLASS VARIABLES
MAINTAINERS
REPORTING BUGS
FILES
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 03:27:01 GMT, April 13, 2024