Re:Emacs 29.1 Released
by adr1an on Sunday July 30, 2023 @10:00AM
(#36931198)
Yes! I have Ubuntu at my office and is difficult to get the latest emacs. I found a PPA but it has a bit of lagging behind..
[ Parent
| on HN ]
* * *
There's a snap that's updated very quickly:
https://github.com/alexmurray/emacs-snap/
In fact, it's already updated
Does this have native-comp enabled? Or do you still have to build from source for that?
No, it's enabled by default. Last I built Emacs, it took me more than an hour to build.
The default branch has native-compilation, tree-sitter, and json enabled. See here for the enabled flags:
https://github.com/alexmurray/emacs-snap/blob/master/snapcra...
It would definitely be nice to have an updated PPA, but compared to some apps, Emacs is simple and fast to compile - just a ./configure followed by make. (The first time, you need to install a few dependencies, but that's automated too, something like apt-get build-dep emacs).
> fast to compile
Last I tried building Emacs, it took me more than hour. I now use a snap that's updated very quickly and is already updated to 29.1:
It takes under a minute with an ancient i5 for me, so I'm not sure what would cause yours to be so slow.
I have a script to build it myself, took a little but of time to get right, but now it works nicely and I can stay at the bleeding edge.
All these answers got me inspired. Might as well try this. But for the sake of not reinventing the wheel, Would you mind sharing? Maybe as a github gist or any pastebin would suffice. (PS. I'm already afraid the GCC version of my Ubuntu 20 throws issues hehe! Let's see!!)
Sure, here's the gist of it with some unrelated stuff removed. This was made for Ubuntu 18.04, but the deb will work on 20.04 as well.
apt-get update
apt-get install -y git software-properties-common make checkinstall autoconf texinfo
add-apt-repository -y ppa:ubuntu-toolchain-r/ppa
add-apt-repository -y ppa:ubuntu-toolchain-r/test
apt-get update
apt-get install -y gcc-10 g++-10 libgccjit0 libgccjit-10-dev libjansson4 libjansson-dev libgtk-3-dev
apt-get install -y libjpeg-dev libxpm-dev libgif-dev libtiff-dev libgnutls28-dev libncurses-dev
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
git clone --depth=1 git://git.sv.gnu.org/emacs.git --branch=master # or use emacs-28.1 or whatever tag
cd emacs || exit
./autogen.sh
./configure \
--with-cairo \
--with-gnutls \
--with-harfbuzz \
--with-jpeg \
--with-json \
--with-mailutils \
--with-modules \
--with-native-compilation \
--with-pgtk \
--with-png \
--with-rsvg \
--with-tiff \
--with-wide-int \
--with-x-toolkit=gtk3 \
--with-xft \
--with-xml2 \
--with-xpm \
--without-compress-install \
--without-gconf \
--without-gsettings \
--without-imagemagick \
--without-toolkit-scroll-bars \
--without-xaw3d \
--without-xwidgets \
CFLAGS="-O3 -mtune=native -march=native -fomit-frame-pointer" \
prefix=/usr/local
make -j"$(nproc)" NATIVE_FULL_AOT=1
checkinstall -y -D --install=no \
--pkgname=${pkgname}-nativecomp \
--pkgversion=1"$(git rev-parse --short HEAD)" \
--requires="libjansson-dev,libharfbuzz-dev,libgccjit-10-dev" \
--pkggroup=emacs \
--gzman=yes \
make install-strip