Created
November 29, 2018 00:58
-
-
Save pedz/2f650dc8fe0f0f3a56d18ccdc3643364 to your computer and use it in GitHub Desktop.
Script to build emacs on Mac OS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
VERSION=emacs-26.1 | |
if [[ ! -d /usr/local/src/${VERSION} ]] ; then | |
cd /usr/local/src | |
tar xf /usr/local/images/${VERSION}/${VERSION}.tar.* | |
fi | |
cd /usr/local/images/${VERSION} | |
image=$( ls -1 ${VERSION}-mac* | tail -1 ) | |
base="${image%.tar.*}" | |
if [[ ! -d "/usr/local/src/${base}" ]] ; then | |
cd /usr/local/src | |
tar xf "/usr/local/images/${VERSION}/${image}" | |
fi | |
echo "Does everything look good? If so, hit return" | |
read not_used | |
# step a. | |
EMACS_SOURCE_TOP=/usr/local/src/${VERSION} | |
# FTP from ftp://ftp.math.s.chiba-u.ac.jp/emacs | |
MACDIR="/usr/local/src/${base}" | |
cd "${EMACS_SOURCE_TOP}" | |
# step b. | |
if ! patch -p1 < $MACDIR/patch-mac ; then | |
echo Patching Failed | |
exit 1 | |
fi | |
# steps c, f, and g. | |
( cd "${MACDIR}" ; tar cf - mac src lisp ) | tar xf - | |
# step d. | |
cp nextstep/Cocoa/Emacs.base/Contents/Resources/Emacs.icns \ | |
mac/Emacs.app/Contents/Resources/Emacs.icns | |
cat << \EOF > Do-Configure | |
#!/bin/bash | |
export LDFLAGS="-L/usr/local/opt/libxml2/lib" | |
export CPPFLAGS="-I/usr/local/opt/libxml2/include/libxml2" | |
./configure --with-mac \ | |
--without-imagemagick \ | |
--enable-mac-app \ | |
--prefix=/Applications/Emacs.app/Contents/Resources \ | |
--exec_prefix=/Applications/Emacs.app/Contents/MacOS && \ | |
make -j10 && \ | |
make DESTDIR=`pwd`/root install && \ | |
open root | |
echo $? | |
EOF | |
chmod +x ./Do-Configure | |
./Do-Configure |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment