summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2020-04-08 16:32:38 -0400
committerMike Gilbert <floppym@gentoo.org>2020-04-12 11:20:13 -0400
commitd10179534fb46fb407853f0a8f1f73846e8c94c7 (patch)
tree4bf2545eea5d85b09a59ececa9e1575aedc09b18 /eclass
parentmeson.eclass: clean up meson_src_configure (diff)
downloadgentoo-d10179534fb46fb407853f0a8f1f73846e8c94c7.tar.gz
gentoo-d10179534fb46fb407853f0a8f1f73846e8c94c7.tar.bz2
gentoo-d10179534fb46fb407853f0a8f1f73846e8c94c7.zip
meson.eclass: add MYMESONARGS variable
This was requested to allow users to pass aribtrary arguments to meson. Signed-off-by: Mike Gilbert <floppym@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/meson.eclass11
1 files changed, 11 insertions, 0 deletions
diff --git a/eclass/meson.eclass b/eclass/meson.eclass
index 3e3a2e2f7a2e..0932a7ed427f 100644
--- a/eclass/meson.eclass
+++ b/eclass/meson.eclass
@@ -84,6 +84,11 @@ fi
# Optional meson test arguments as Bash array; this should be defined before
# calling meson_src_test.
+# @VARIABLE: MYMESONARGS
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# User-controlled environment variable containing arguments to be passed to
+# meson in meson_src_configure.
read -d '' __MESON_ARRAY_PARSER <<"EOF"
import shlex
@@ -236,6 +241,9 @@ meson_src_configure() {
BUILD_DIR="${BUILD_DIR:-${WORKDIR}/${P}-build}"
+ # Handle quoted whitespace
+ eval "local -a MYMESONARGS=( ${MYMESONARGS} )"
+
mesonargs+=(
# Arguments from ebuild
"${emesonargs[@]}"
@@ -243,6 +251,9 @@ meson_src_configure() {
# Arguments passed to this function
"$@"
+ # Arguments from user
+ "${MYMESONARGS[@]}"
+
# Source directory
"${EMESON_SOURCE:-${S}}"