From 98307eefb98e8ec4fa76501aa3bfb877ff59de96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Bar=C4=87?= Date: Tue, 21 Jun 2022 21:35:49 +0200 Subject: [PATCH] app-emacs/compat: check for native JSON parsing support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes: https://bugs.gentoo.org/853322 Signed-off-by: Maciej Barć --- app-emacs/compat/compat-28.1.1.3.ebuild | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app-emacs/compat/compat-28.1.1.3.ebuild b/app-emacs/compat/compat-28.1.1.3.ebuild index c220c6ceb7a3d..e373d5d8f5079 100644 --- a/app-emacs/compat/compat-28.1.1.3.ebuild +++ b/app-emacs/compat/compat-28.1.1.3.ebuild @@ -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 +}