commit: 98307eefb98e8ec4fa76501aa3bfb877ff59de96 Author: Maciej Barć <xgqt <AT> gentoo <DOT> org> AuthorDate: Tue Jun 21 19:35:49 2022 +0000 Commit: Maciej Barć <xgqt <AT> gentoo <DOT> org> CommitDate: Tue Jun 21 19:36:11 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=98307eef
app-emacs/compat: check for native JSON parsing support Closes: https://bugs.gentoo.org/853322 Signed-off-by: Maciej Barć <xgqt <AT> gentoo.org> 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 c220c6ceb7a3..e373d5d8f507 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 +}
