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.

  1. Install the build dependencies:
    # apt-get build-dep emacs23
    This installs all the compilers, parsers, development libraries and other parts of the GNU toolchain that is needed to build the emacs23 package.

  2. 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.

  3. 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

  4. Follow the INSTALL instructions:
    $ ./configure
    $ make

  5. 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

  6. If okay, install it:
    # make install