So a while ago I posted a hideous shell script that I use to build
Emacs on OSX. It was hideous and awful and didn’t in fact solve the
problems that I wanted it to.
My requirements:
don’t build what you don’t have to;
personal configuration should live in ~/Library
shared configuration should live in /Library
the warning about the missing arch-dependent data dir makes me mad enough to punch a nun.
So I’ve hacked together the following, which:
updates my bzr checkout;
builds a non self-contained Emacs;
points the various directories that would live in /usr/local to where I want them;
is doubtless full of bugs.
But I figure, share and enjoy. There are probably, what, four people
in the world who might find this elucidating?
Build my idosyncratic Emacs (build_emacs.zsh)download
#!/bin/zsh# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE# Version 2, December 2004# Copyright (C) 2004 Sam Hocevar# 14 rue de Plaisance, 75014 Paris, France# Everyone is permitted to copy and distribute verbatim or modified# copies of this license document, and changing it is allowed as long# as the name is changed.# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION# 0. You just DO WHAT THE FUCK YOU WANT TO.set -e
export PATH=$HOME/gnu/bin:/usr/bin:/usr/sbin:/bin:/sbin
PREFIX=/Library/Emacs
SRC_DIR=$HOME/src/emacs/trunk
LIBEXEC_DIR=$PREFIX/libexec
SITE_LISP=$HOME/Library/Emacs/site-lisp
NS_SRC_DIR=$SRC_DIR/nextstep
SRC_APP=$NS_SRC_DIR/Emacs.app
rm -rf $SRC_APPcd$SRC_DIRTHREAD_COUNT=$(($(sysctl machdep.cpu.thread_count | cut -c27-)+1))echo"Building @`date`"(/usr/local/bin/bzr revert && /usr/local/bin/bzr update)||exit 4
export CFLAGS="-pipe -march=nocona"make distclean > /dev/null 2>&1 ||true[[ -f "configure"]]|| ./autogen.sh
chmod 0755 ./configure # yikes../configure --without-x \ --with-ns \ --without-dbus \ --disable-ns-self-contained \ --without-gpm \ --without-selinux \ --without-pop \ --with-gameuser=$USER\ --without-gconf \ --prefix=$PREFIX\ --datarootdir=$PREFIX\ --docdir=$PREFIX/doc \ --exec_prefix=$PREFIX\ --enable-locallisppath=$SITE_LISP||exit 1
# Make the actual binary.(make bootstrap libexecdir=$LIBEXEC_DIRarchlibdir=$LIBEXEC_DIR&&\ make -j$THREAD_COUNTarchlibdir=$LIBEXEC_DIRlibexecdir=$LIBEXEC_DIR&& make install archlibdir=$LIBEXEC_DIRlibexecdir=$LIBEXEC_DIR&&\echo"OK")||(echo"UH OH"; exit 2)rm -rf $PREFIX/* ||trueopen $NS_SRC_DIR