Created
November 22, 2024 15:28
-
-
Save pivaldi/116c22742040834316c90e938411c082 to your computer and use it in GitHub Desktop.
Optimized Emacs Compilation With Tree-sitter Support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# See | |
# - https://www.emacswiki.org/emacs/GccEmacs | |
# - https://www.masteringemacs.org/article/speed-up-emacs-libjansson-native-elisp-compilation | |
# - https://www.masteringemacs.org/article/how-to-get-started-tree-sitter | |
SOURCE_DIR="$HOME/code/emacs_hd/" | |
INSTALL_DIR="/opt/emacs" | |
cd "$SOURCE_DIR" || exit 1 | |
locate libtree-sitter.so > /dev/null || { | |
echo "You must install the libtree-sitter.so : | |
git clone [email protected]:tree-sitter/tree-sitter.git | |
cd tree-sitter && make && make install" | |
exit 1 | |
} | |
sudo apt-get install libjansson4 libjansson-dev || exit 1 | |
sudo apt-get build-dep emacs || exit 1 | |
./autogen.sh && \ | |
./configure --prefix="$INSTALL_DIR" --with-native-compilation --with-tree-sitter --with-json --with-mailutils && \ | |
make -j"$(nproc)" && \ | |
sudo make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See also this more complete Gist