Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
101 lines (75 sloc) 2.9 KB

Build Emacs from Source on Ubuntu using Org Babel

Install latest emacs from src, per Xah Lee: http://ergoemacs.org/emacs/building_emacs_from_git_repository.html

Define Vars

First, set the following variables:

BUILD_DIR
where you’re going to build. This should be an abolute path (because when we sudo to install, we want to install from the place it’s built, not relative to root’s home dir).

This should point to the directory above where .../emacs will be cloned, e.g. it should be something like /home/george/src if you want to clone to and build in /home/george/src/emacs

/home/gmj/git/github.com/mirrors

Install pre-reqs

exec 2>&1;date;set -e; set -u; set -x
sudo apt-get install build-essential  || true
# may have to uncomment deb-src lines in /etc/apt/sources.list
# may have to uncomment deb-src lines in /etc/apt/sources.list
sudo apt-get -y build-dep emacs23 || true 
sudo apt-get install git || true

Update system

exec 2>&1;date;set -e; set -u; set -x
sudo apt-get -y update  && sudo apt-get -y upgrade

Pull the sources

  • Warning, first time, this will take a while
exec 2>&1;date;set -e; set -u; set -x

mkdir -p $build_dir || true

echo build_dir $build_dir
echo '${build_dir}/emacs' ${build_dir}/eamcs

if [ -d ${build_dir}/emacs ]; then
   echo ${build_dir}/emacs exists.  Cleaning up and pulling.
   cd ${build_dir}/emacs  || true
   # discard stuff from last build
   git reset --hard  || true

   # delete all of the last build stuff
   git clean -xdf  || true

   # get latest update
   git pull  || true
else
   echo ${build_dir}/emacs does not exist.  cloning.
   cd ${build_dir}  || true
   git clone https://github.com/mirrors/emacs.git  || true
   cd emacs
fi

Configure

exec 2>&1;date;set -e; set -u; set -x

cd ${build_dir}/emacs
./autogen.sh  || true
./configure  || true

Build

exec 2>&1;date;set -e; set -u; set -x

cd $build_dir/emacs || true
make bootstrap  || true

Install

Not sure if running this with a live emacs is a good idea,

exec 2>&1;date;set -e; set -u; set -x
cd $build_dir/emacs || true
sudo make install   || true

Make sure the new texinfo pages are update/installed