Building Multi-TTY Emacs from CVS on Ubuntu Gutsy Gibbon

October 21, 2007 at 06:25 PM | categories: emacs, linux | View Comments

(Historical note May 2008: The build instructions below, while they should still work, are unnecessary as Multi-TTY has been merged into the main Emacs 23 branch and is available in ubuntu repositories: apt-get install emacs-snapshot)

Last spring I wrote an article about Multi-TTY Emacs. I had promised that I would update instructions for building it on Ubuntu, but since then I have been mainly using Gentoo on my laptop and never got around to updating it. Sorry :)

I switched to Ubuntu Gutsy Gibbon yesterday. I also got Multi-TTY Emacs running, and here's the video to prove it (If this is too small to see, download the original ogg theora version) :

Building CVS Emacs the old fashioned way

For those of you that want the easy way out, I've prebuilt an emacs CVS package that includes the Multi-TTY patch. I've tested that the package works on both Gutsy as well as Feisty.

For those of you that would like to learn how this is done, here's my recipe:

Install all the dependencies

sudo apt-get install build-essential cvs texinfo libx11-dev libxpm-dev libjpeg-dev \
libpng-dev libgif-dev libtiff-dev libgtk2.0-dev checkinstall

Check out the Emacs code from CVS

cvs -z3 co emacs

Compile the source

cd emacs
./configure --with-gtk --prefix=/usr/local
make bootstrap

Checkinstall will build a basic emacs package for us with a minimum of fuss. We don't want to automatically install this package though for reasons we'll see below

sudo checkinstall -D --install=no

Checkinstall will ask you to change some values. I changed the maintainer email and the version number.

Checkinstall is great, and works for 99% percent of the packages that I've tried it with. Emacs is a bit different though -- the package that checkinstall creates doesn't include everything that emacs requires, like all the .el files in the lisp folder among other things. So we have to edit the package a bit. For the following code, we'll assume the .deb file that checkinstall creates is just called "emacs_cvs-10202007-1_i386.deb", so adjust for whatever checkinstall called your .deb file:

Extract the data from the .deb

dpkg-deb -x emacs_cvs-10202007-1_i386.deb emacs_cvs-10202007-1_i386 
#Or whatever your .deb is called

Extract the control information from the .deb

dpkg-deb -e emacs_cvs-10202007-1_i386.deb emacs_cvs-10202007-1_i386/DEBIAN

Now we need to add some of the files that checkinstall left out of the package

cp -a lisp/* emacs_cvs-10202007-1_i386/usr/local/share/emacs/23.0.50/site-lisp/
mkdir emacs_cvs-10202007-1_i386/usr/local/share/emacs/23.0.50/lisp
mkdir -p emacs_cvs-10202007-1_i386/usr/local/libexec/emacs/23.0.50/i686-pc-linux-gnu
cp -a etc emacs_cvs-10202007-1_i386/usr/local/share/emacs/23.0.50/
mkdir emacs_cvs-10202007-1_i386/etc
ln -s ../usr/local/share/emacs/23.0.50/etc/termcap.src emacs_cvs-10202007-1_i386/etc/termcap

Rebuild the modified package

dpkg-deb -b emacs_cvs-10202007-1_i386 emacs_modified.deb

To totally revolutionize the way you use Emacs, remember to check out my earlier post on Multi-TTY Emacs.

blog comments powered by Disqus