1 |
This was requested to allow users to pass aribtrary arguments to meson. |
2 |
|
3 |
Signed-off-by: Mike Gilbert <floppym@g.o> |
4 |
--- |
5 |
eclass/meson.eclass | 11 +++++++++++ |
6 |
1 file changed, 11 insertions(+) |
7 |
|
8 |
diff --git a/eclass/meson.eclass b/eclass/meson.eclass |
9 |
index 3e3a2e2f7a2e..0932a7ed427f 100644 |
10 |
--- a/eclass/meson.eclass |
11 |
+++ b/eclass/meson.eclass |
12 |
@@ -84,6 +84,11 @@ fi |
13 |
# Optional meson test arguments as Bash array; this should be defined before |
14 |
# calling meson_src_test. |
15 |
|
16 |
+# @VARIABLE: MYMESONARGS |
17 |
+# @DEFAULT_UNSET |
18 |
+# @DESCRIPTION: |
19 |
+# User-controlled environment variable containing arguments to be passed to |
20 |
+# meson in meson_src_configure. |
21 |
|
22 |
read -d '' __MESON_ARRAY_PARSER <<"EOF" |
23 |
import shlex |
24 |
@@ -236,6 +241,9 @@ meson_src_configure() { |
25 |
|
26 |
BUILD_DIR="${BUILD_DIR:-${WORKDIR}/${P}-build}" |
27 |
|
28 |
+ # Handle quoted whitespace |
29 |
+ eval "local -a MYMESONARGS=( ${MYMESONARGS} )" |
30 |
+ |
31 |
mesonargs+=( |
32 |
# Arguments from ebuild |
33 |
"${emesonargs[@]}" |
34 |
@@ -243,6 +251,9 @@ meson_src_configure() { |
35 |
# Arguments passed to this function |
36 |
"$@" |
37 |
|
38 |
+ # Arguments from user |
39 |
+ "${MYMESONARGS[@]}" |
40 |
+ |
41 |
# Source directory |
42 |
"${EMESON_SOURCE:-${S}}" |
43 |
|
44 |
-- |
45 |
2.26.0 |