Hacking in Debian is so easy (one of the reasons I switched). Take, for instance, building Emacs. This is such a piece of cake compared to the weird hoops you have to go through to get all the build dependencies on other platforms. It’s something I never tried before, simply because it was too daunting trying to figure out all the packages I need to install. But apt-get has this awesome –build-deps switch…
So then, how to build and install Emacs 24 on Debian squeeze, in 6 easy steps? Since Emacs24 is not yet released, there isn’t a package for it in Debian (which is why I’m building my own). But I figured that the build dependencies would not have changed too much from Emacs23, so I used that, and it worked.
- Install the build dependencies:
# apt-get build-dep emacs23This installs all the compilers, parsers, development libraries and other parts of the GNU toolchain that is needed to build the emacs23 package.
- Download the source code. I used the GitHub mirror of the official GNU Savana codebase, and downloaded the newest PKzip archive from there. There is probably a newer one now. Purists probably would check-out direct from either Savana or GitHub rather than download a zip archive… I’m not going to hack emacs itself though, so I don’t care.
- Unzip the archive and generate the configure script (the autogen step is skipped in the INSTALL file by the way, good thing I’ve done my homework):
$ unzip emacsmirror-emacs-EMACS_PRETEST_24_9_92-295-g2dccfc4.zip $ cd emacsmirror-emacssnapshot $ ./autogen.sh - Follow the INSTALL instructions:
$ ./configure $ make - Test it (Note:- if you watch the build, you'll see that after the C core of emacs is built, emacs itself is used to compile the elisp components, so building also makes a fairly good test of the C parts anyway):
$ src/emacs -Q - If okay, install it:
# make install
7 Comments
You can also obtain packages for Emacs 24 for debian and ubuntu from the emacs-snapshot repository at http://emacs.naquadah.org/
I recommend: http://emacs.naquadah.org/
Clear install without making a mess during the instalation.
See http://emacs.naquadah.org/
Thanks guys
You know, I tried this repo first; added the APT key and both the stable and unstable sources, and then “aptitude Install emacs-snapshot”; but it kept telling me that it’s not a real package, or something? I will have to have another play…
The stable one worked for me in Crunchbang (a debian squeeze derivative).
http://oylenshpeegul.typepad.com/blog/2012/01/crunchy-new-year.html
Okay then, I’ll have another go (disable unstable first).
Although I’ll admit: a strong reason to build from source code was for the Star Wars moment when typing C-h C-a and seeing
“GNU Emacs 24.0.92.1 (i686-pc-linux-gnu, GTK+ Version 2.20.1)
of 2012-01-11 on archimedes”
which loosely translated may be read as: “I see you have constructed a new emacs… your skills are complete.”
It’s just as easy on Mac OSX. The magic it seems is not in the –build-deps switch but in Emacs packaging of everything needed to compile and run.