meson.eclass
Description
This eclass contains the default phase functions for packages which use the meson build system.
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
- meson_format_array
-
Parses the command line flags and converts them into an array suitable for use in a cross file.
- Input: --single-quote=' --double-quote=" --dollar=$ --backtick=\`
-
--backslash=\ --full-word-double="Hello World" --full-word-single='Hello World' --full-word-backslash=Hello World --simple --unicode-8=© --unicode-16=𐐷 --unicode-32=𐤅
- Output: ['--single-quote='', '--double-quote="', '--dollar=$',
-
'--backtick=`', '--backslash=\', '--full-word-double=Hello World', '--full-word-single=Hello World', '--full-word-backslash=Hello World', '--simple', '--unicode-8=©', '--unicode-16=𐐷', '--unicode-32=𐤅']
- meson_add_machine_file <name> < <data>
-
Appends --native-file or --cross-file to emesonargs with the data given via standard input. Assumes emesonargs has already been defined as an array.
- meson_add_native_file <name> < <data>
-
Appends --native-file (never --cross-file) to emesonargs with the data given via standard input. Assumes emesonargs has already been defined as an array.
- 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.
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}
Function Variables
- emesonargs
-
Optional meson arguments as Bash array; this should be defined before calling meson_src_configure, meson_add_machine_file, or meson_add_native_file.
- MYMESONARGS
-
User-controlled environment variable containing arguments to be passed to meson in meson_src_configure.
- EMESON_SKIP_TEST_SUITES
-
Array of test suites that should be skipped.
- EMESON_SKIP_TESTS
-
Array of tests that should be skipped.
Reporting Bugs
Please report bugs via https://bugs.gentoo.org/