- Clone emacs repo
git clone https://git.savannah.gnu.org/git/emacs.git cd emacs - Checkout latest
git tag # find the latest git checkout LATEST_TAG - Install Build dependencies
sudo apt update sudo apt install build-essential autoconf texinfo \ libgtk-3-dev libxpm-dev libjpeg-dev libgif-dev libtiff-dev \ libgnutls28-dev libncurses-dev libjansson-dev \ libtree-sitter-dev libgccjit-13-devlibgccjitshould be the same version to your gcc version. - Generate Build system
./autogen.sh - Configure
./configure --with-native-compilation --with-tree-sitter --with-x-toolkit=gtk3 - Build
make -j$(nproc) - Install
sudo make install - Create a desktop launcher
- Create the desktop file
mkdir -p ~/.local/share/applications vim ~/.local/share/applications/emacs.desktop - Paste this:
[Desktop Entry] Name=Emacs (Source Build) GenericName=Text Editor Comment=GNU Emacs built from source Exec=/usr/local/bin/emacs %F Icon=emacs Terminal=false Type=Application Categories=Development;TextEditor; StartupWMClass=Emacs - Finally, run this
update-desktop-database ~/.local/share/applications
- Create the desktop file
How to build emacs from source
·109 words·1 min