From fbe4bc7b9dc970271127a5f167c95da78e32e282 Mon Sep 17 00:00:00 2001 From: Vadim Misbakh-Soloviov Date: Thu, 22 Feb 2024 00:59:50 +0700 Subject: tree-sitter-grammar.eclass: extended packaging 1) put grammar library to additional well-known path 2) also put queries See-Also: https://pkgs.alpinelinux.org/contents?branch=edge&name=tree%2dsitter%2dlua&arch=x86_64&repo=community See-Also: https://pkgs.alpinelinux.org/contents?branch=edge&name=tree%2dsitter%2dcss&arch=x86_64&repo=community Refer: https://github.com/gentoo/gentoo/pull/35475 Closes: https://bugs.gentoo.org/933833 Closes: https://bugs.gentoo.org/922146 Signed-off-by: Vadim Misbakh-Soloviov Signed-off-by: Brahmajit Das Closes: https://github.com/gentoo/gentoo/pull/37122 Signed-off-by: Arthur Zamarin --- eclass/tree-sitter-grammar.eclass | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'eclass') diff --git a/eclass/tree-sitter-grammar.eclass b/eclass/tree-sitter-grammar.eclass index 24473fb98b1f..ff0c4cb979e6 100644 --- a/eclass/tree-sitter-grammar.eclass +++ b/eclass/tree-sitter-grammar.eclass @@ -205,6 +205,19 @@ tree-sitter-grammar_src_install() { dolib.so "${WORKDIR}/${soname}" dosym "${soname}" /usr/$(get_libdir)/lib${PN}$(get_libname) + # Install symlinks to grammars so that they can be found by NeoVim. + # /usr/$(get_libdir)/tree-sitter gets added to the NeoVim runtimepath. + # See neovim/runtime/doc/treesitter.txt for info. + keepdir /usr/$(get_libdir)/tree-sitter + dosym ../"${soname}" \ + /usr/$(get_libdir)/tree-sitter/parser/${PN##tree-sitter-}$(get_libname) + + # Install queries (e.g. highlight.scm) so that they can be found by NeoVim. + if [[ -d "${S}/../queries" ]]; then + keepdir /usr/share/tree-sitter + insinto /usr/share/tree-sitter + doins -r "${S}/../queries" + fi fi local binding -- cgit v1.2.3-65-gdbad