Compiling the Tree-sitter dependency?

Hello,

I would like to prepare GNU Guix for the upcoming 0.5 release, and I need to add the Tree-sitter package first. I looked at its repository, and it seems like Tree-sitter is actually a number of things: a library, a command-line tool and maybe even more things? My question is, what exactly does Neovim depend on? Is it just the C library which I can compile by just running make, or do I need Rust and Node as well?

neovim just links against the library but without the grammars it’s useless so you will need to package them as well. You can have a look at how nix packages those if that helps: nixpkgs/grammar.nix at master · NixOS/nixpkgs · GitHub

If only I knew how to read Nix… Are the grammars that which I download through :TSInstall? Probably not if they need to be shipped along with Neovim. I am looking at the default.nix file from the Nix repo, and it looks like Tree-sitter depends on Rust and Emscripten. This might be beyond my meager Guix knowledge.

You only need the runtime library part of tree-sitter to build neovim, which is a C library without any rust or emscripten dependencies. Grammars are .so files which neovim looks for in both system and user directories, so either option would work for those.