Here are the commands I'm running
First I install tree-sitter
make PREFIX=${HOME}/.tree-sitter
make PREFIX=${HOME}/.tree-sitter install
This populates ~/.tree-sitter
directory
├── include
│ └── tree_sitter
│ └── api.h
└── lib
├── libtree-sitter.a
├── libtree-sitter.so -> libtree-sitter.so.0.0
├── libtree-sitter.so.0 -> libtree-sitter.so.0.0
├── libtree-sitter.so.0.0
└── pkgconfig
└── tree-sitter.pc
Then I install emacs
wget https://ftp.gnu.org/gnu/emacs/emacs-29.1.tar.gz
tar -xf emacs-29.1.tar.gz
cd emacs-29.1
TREE_SITTER_CFLAGS=-I~/.tree-sitter/include TREE_SITTER_LIBS="-L~/.tree-sitter/lib -ltree-sitter" ./configure --prefix=${HOME}/emacs --bindir=${HOME}/.local/bin --with-tree-sitter --with-gnutls=ifavailable
LD_LIBRARY_PATH=~/.tree-sitter/lib make install
And the last install command errors out with
CC emacs.o
In file included from emacs.c:142:
treesit.h:27:10: fatal error: tree_sitter/api.h: No such file or directory
27 | #include <tree_sitter/api.h>
api.h
actually exist in~/.tree-sitter/include/tree_sitter
?docker run -ti -v ~/repos/tree-sitter:/tree-sitter -v ~/emacs:${HOME}/emacs -v ~/.local/bin:/emacs-bin jammy