summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2020-12-28 17:24:09 -0500
committerMike Gilbert <floppym@gentoo.org>2020-12-28 17:34:16 -0500
commit496198d0ab1971e26e01129cff736fb4073739b8 (patch)
tree3200b39c9b366c4ea10b64c6d6f0da80912f2fef /eclass
parentdev-util/meson-format-array: new package (diff)
downloadgentoo-496198d0ab1971e26e01129cff736fb4073739b8.tar.gz
gentoo-496198d0ab1971e26e01129cff736fb4073739b8.tar.bz2
gentoo-496198d0ab1971e26e01129cff736fb4073739b8.zip
meson.eclass: use meson-format-array
Closes: https://bugs.gentoo.org/759433 Signed-off-by: Mike Gilbert <floppym@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/meson.eclass19
1 files changed, 4 insertions, 15 deletions
diff --git a/eclass/meson.eclass b/eclass/meson.eclass
index 21338280df33..67b7ca831fd2 100644
--- a/eclass/meson.eclass
+++ b/eclass/meson.eclass
@@ -55,7 +55,9 @@ if [[ -z ${_MESON_ECLASS} ]]; then
_MESON_ECLASS=1
MESON_DEPEND=">=dev-util/meson-0.54.0
- >=dev-util/ninja-1.8.2"
+ >=dev-util/ninja-1.8.2
+ dev-util/meson-format-array
+"
if [[ ${EAPI:-0} == [6] ]]; then
DEPEND=${MESON_DEPEND}
@@ -94,19 +96,6 @@ fi
# User-controlled environment variable containing arguments to be passed to
# meson in meson_src_configure.
-read -d '' __MESON_ARRAY_PARSER <<"EOF"
-import shlex
-import sys
-
-# See http://mesonbuild.com/Syntax.html#strings
-def quote(str):
- escaped = str.replace("\\\\", "\\\\\\\\").replace("'", "\\\\'")
- return "'{}'".format(escaped)
-
-print("[{}]".format(
- ", ".join([quote(x) for x in shlex.split(" ".join(sys.argv[1:]))])))
-EOF
-
# @FUNCTION: _meson_env_array
# @INTERNAL
# @DESCRIPTION:
@@ -126,7 +115,7 @@ EOF
# '--unicode-16=𐐷', '--unicode-32=𐤅']
#
_meson_env_array() {
- python -c "${__MESON_ARRAY_PARSER}" "$@"
+ meson-format-array "$@"
}
# @FUNCTION: _meson_get_machine_info