Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
build emacs mac port bundle
# usage: ./ <emacs-mac-port-source-directory>
version=26.1 # update the version nunber
compver=x86_64-apple-darwin`uname -r`
# if you install texinfo by homebrew and key-only
export PATH="/usr/local/opt/texinfo/bin:$PATH"
cd $1
# make an emacs bundle
# no longer need this I believe?
#find . -name *.elc | xargs rm
if [[ -d $installprefix ]]; then
echo "$installprefix already exists, abort."
echo "Please remove or rename this directory and try again"
exit 1;
# rm -rf $installprefix
mkdir $installprefix
set -e
./configure PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig --with-mac --enable-mac-app=$installprefix --prefix=$installprefix
make install
set +e
mv $installprefix/share/emacs/$version/* $app_dir
mv $installprefix/share/info $app_dir
mv $installprefix/share/man $app_dir
rm -rf $installprefix/share
mv $installprefix/var $app_dir
mv $installprefix/bin $app_dir/../MacOS/bin
# mkdir $app_dir/../MacOS/libexec
mv $installprefix/libexec/emacs/$version/$compver $app_dir/../MacOS/libexec
rm -rf $installprefix/libexec
mv $installprefix/lib $app_dir
echo 'Done! Find your at '$installprefix'.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment