app-emacs/compat: check for native JSON parsing support

Closes: https://bugs.gentoo.org/853322
Signed-off-by: Maciej Barć <xgqt@gentoo.org>
This commit is contained in:
Maciej Barć
2022-06-21 21:35:49 +02:00
parent 190df0ab05
commit 98307eefb9

View File

@@ -29,3 +29,19 @@ ELISP_TEXINFO="${PN}.texi"
src_compile() {
emake compile ${PN}.info
}
src_test() {
local has_json="$("${EMACS}" ${EMACSFLAGS} --eval "(princ (fboundp 'json-parse-string))")"
if [[ "${has_json}" != t ]] ; then
local line
while read line ; do
ewarn "${line}"
done <<-EOF
Your current Emacs version does not support native JSON parsing,
which is required for running tests of ${CATEGORY}/${PN}.
Use "eselect emacs" to select an Emacs version with such feature.
EOF
else
emake test
fi
}