Pretty Emacs: Compile guide for unsupported platforms

If you are using a platform other than a i386, you will need to compile my Emacs packages yourself. So, here a simple guide how to do this.

  1. First, make sure you have the source repository enabled, by adding deb-src gutsy main to your /etc/apt/sources.list.
  2. Install the build-dependencies and some packaging tools:
    sudo apt-get update
    sudo apt-get build-dep emacs-snapshot
    sudo apt-get install dpkg-dev devscripts fakeroot emacsen-common
  3. Download the source package and compile it with:
    fakeroot apt-get --compile source emacs-snapshot
  4. Finally, install the newly built packages:
    sudo dpkg -i emacs-snapshot*.deb

Note, this final step may fail if you have an older version of the package already installed. If it is the case, just do it again.

· RSS feed for comments on this post


  1. Justin said,

    April 17, 2007 @ 5:29 am

    Thanks for this!

  2. rgrant said,

    June 7, 2007 @ 5:15 pm

    very helpful, thanks! step 3 needs fakeroot.

  3. Alexandre said,

    June 7, 2007 @ 5:20 pm

    Fixed, thanks!

  4. Ryan said,

    June 28, 2007 @ 12:07 am

    I had to sudo aptitude install emacsen-common before step 4 would work for me.

  5. Alexandre said,

    June 30, 2007 @ 5:38 pm

    Fixed too, thanks!

  6. Tomasz said,

    July 1, 2007 @ 11:07 pm

    Works like a charm!

  7. ob said,

    July 3, 2007 @ 7:25 pm

    Does this work on Debian? I tried it on debian 4.0 and I’m getting a core dump from the shell :(

    Compiling /home/ob/tmp/emacs-snapshot-20070630/lisp/./mail/emacsbug.el
    Fatal error (11)/bin/sh: line 4:  1694 Segmentation fault
    EMACSLOADPATH=/home/ob/tmp/emacs-snapshot-20070630/lisp LC_ALL=C ../src/bootstrap-emacs -batch --no-site-file --multibyte -f batch-byte-compile-if-not-done $el
    make[3]: *** [compile] Error 1
    make[3]: Leaving directory `/home/ob/tmp/emacs-snapshot-20070630/lisp'
    make[2]: *** [bootstrap-build] Error 2
    make[2]: Leaving directory `/home/ob/tmp/emacs-snapshot-20070630'
    make[1]: *** [bootstrap] Error 2
    make[1]: Leaving directory `/home/ob/tmp/emacs-snapshot-20070630'
    make: *** [bootstrap-stamp] Error 2
    Build command 'cd emacs-snapshot-20070630 && dpkg-buildpackage -b -uc' failed.
    E: Child process failed
  8. Alexandre said,

    July 4, 2007 @ 11:36 am


    It should work on Debian. Honestly, I don’t know why you are getting a segfault. Do you mind sending me the full build log to my email address? Please include the core file if you still have it.

  9. amicky said,

    July 14, 2007 @ 5:47 am

    I have juste finished compiling and installing emacs under ubuntu festy fawn 7.4 and everything is well done!! ;) thank you.

  10. borrey said,

    July 30, 2007 @ 7:40 pm

    I can’t get it to work either

    sudo apt-get build-dep emacs-snapshot
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Could not open file /var/lib/apt/lists/debs.peadrop.com_dists_feisty_backports_source_Sources - open (2 No such file or directory)
  11. Alexandre said,

    July 30, 2007 @ 9:40 pm

    borrey, I have you correctly added my source repository by adding deb-src feisty backports to your /etc/apt/sources.list?

  12. Bill said,

    August 1, 2007 @ 11:03 am

    I am having exactly the same problem as borrey. Yes, I did append “deb-src feisty backports” to the end of /etc/apt/sources.list Also, for what it’s worth, this is a fairly virgin Ubuntu installation.

  13. Alexandre said,

    August 1, 2007 @ 2:44 pm

    You need to run sudo apt-get update before sudo apt-get build-dep emacs-snapshot.

  14. Bill said,

    August 4, 2007 @ 2:27 pm

    I should have mentioned my problem in the earlier step (sudo apt-get update):

    Failed to fetch Unable to find expected entry backports/binary-amd64/Packages in Meta-index file (malformed Release file?)

  15. Alexandre said,

    August 4, 2007 @ 3:08 pm

    Bill, you got this error message because my repository doesn’t have binary packages for the amd64. Just remove deb feisty backports, while keeping the deb-src one, from your sources.list.

  16. Dave said,

    August 18, 2007 @ 10:51 am

    After fakeroot apt-get –compile source emacs-snapshot

    I get this error:

    x86_64-linux-gnu-gcc -c -D_BSD_SOURCE   -Demacs -DHAVE_CONFIG_H -DUSE_LUCID  -I. -I/home/dave/old-dave/emacs-snapshot-20070705/src -D_BSD_SOURCE -I/usr/include/alsa -DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2 search.c
    search.c: In function ‘Freplace_match’:
    search.c:2383: warning: comparison is always true due to limited range of data type
    x86_64-linux-gnu-gcc -c -D_BSD_SOURCE   -Demacs -DHAVE_CONFIG_H -DUSE_LUCID  -I. -I/home/dave/old-dave/emacs-snapshot-20070705/src -D_BSD_SOURCE -I/usr/include/alsa -DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2 regex.c
    regex.c: In function ‘re_compile_pattern’:
    regex.c:6513: internal compiler error: in for_each_index, at tree-ssa-loop-im.c:222
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See  for instructions.
    For Debian GNU/Linux specific bug reporting instructions,
    see .
    The bug is not reproducible, so it is likely a hardware or OS problem.
    make[4]: *** [regex.o] Error 1
  17. Dave said,

    August 18, 2007 @ 10:57 am

    I found this old thread from 2005 fixing a bug in GCC

    Here is my GCC

    gcc -v
    Using built-in specs.
    Target: x86_64-linux-gnu
    Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --enable-checking=release x86_64-linux-gnu
    Thread model: posix
    gcc version 4.1.2 (Ubuntu 4.1.2-0ubuntu4)

  18. wilk said,

    August 27, 2007 @ 2:21 am

    I’ve been happily using your configured versions of emacs for a while now, without any problem. I need to manually compile it since I’m running a 64bit machine (on Ubuntu gutsy)

    There is one tiny problem though. At the moment, the emacs-snapshot from the official repos is newer than yours and update-notifier is always proposing to upgrade yours… What’s the cleanest way to modify the Makefile to add a suffix to the programs compiled ?

    Thanks a lot for Pretty Emacs.