Skip to content

Instantly share code, notes, and snippets.

@kiennq
Last active January 29, 2023 20:32
Show Gist options
  • Star 40 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save kiennq/0f3e65098725b1f9708da8c92972e705 to your computer and use it in GitHub Desktop.
Save kiennq/0f3e65098725b1f9708da8c92972e705 to your computer and use it in GitHub Desktop.
Build emacs-snapshot on Ubuntu 18.04
git clone --single-branch --depth=1 https://github.com/emacs-mirror/emacs.git
cd emacs/
sudo apt install -y autoconf make gcc texinfo libxpm-dev \
libjpeg-dev libgif-dev libtiff-dev libpng-dev libgnutls28-dev \
libncurses5-dev libjansson-dev libharfbuzz-dev
./autogen.sh
./configure --with-json --with-modules --with-harfbuzz --with-compress-install \
--with-threads --with-included-regex --with-zlib --with-cairo --without-rsvg\
--without-sound --without-imagemagick --without-toolkit-scroll-bars \
--without-gpm --without-dbus --without-makeinfo --without-pop \
--without-mailutils --without-gsettings
make -j$(nproc)
sudo make install-strip
git clone -b feature/native-comp --single-branch --depth=1 https://github.com/emacs-mirror/emacs.git
cd emacs/
git fetch origin feature/native-comp
git reset --hard origin/feature/native-comp
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/ppa
sudo apt install -y autoconf make checkinstall texinfo libxpm-dev libjpeg-dev \
libgif-dev libtiff-dev libpng-dev libgnutls28-dev libncurses5-dev \
libjansson-dev libharfbuzz-dev libgccjit-10-dev gcc-10 g++-10
sudo apt update
sudo apt -y upgrade
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
./autogen.sh
./configure --with-json --with-modules --with-harfbuzz --with-compress-install \
--with-threads --with-included-regex --with-zlib --with-cairo --without-rsvg\
--without-sound --without-imagemagick --without-toolkit-scroll-bars \
--without-gpm --without-dbus --without-makeinfo --without-pop \
--without-mailutils --without-gsettings --with-nativecomp
make NATIVE_FULL_AOT=1 -j$(nproc)
sudo checkinstall -y -D --pkgname=emacs28-nativecomp --pkgversion=1$(git rev-parse --short HEAD) \
--requires="libjansson-dev,libharfbuzz-dev,libgccjit-10-dev" --pkggroup=emacs --gzman=yes \
make install-strip
@it-is-wednesday
Copy link

Since now Emacs 27 development has been moved to a separate branch, you might want to replace the first line with the following if you're still interested in Emacs 27 instead of the unstable (as of now) 28:

git clone --single-branch --branch emacs-27 --depth 1 https://github.com/emacs-mirror/emacs.git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment