Last active
May 30, 2018 15:54
-
-
Save railwaycat/10988446 to your computer and use it in GitHub Desktop.
build emacs mac port bundle
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/sh | |
# usage: ./build-emacs.app.sh <emacs-mac-port-source-directory> | |
installprefix=`pwd`/emacs-mac-out | |
app_dir=$installprefix/Emacs.app/Contents/Resources | |
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; | |
fi | |
# rm -rf $installprefix | |
mkdir $installprefix | |
set -e | |
./autogen.sh | |
./configure PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig --with-mac --enable-mac-app=$installprefix --prefix=$installprefix | |
make | |
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 Emacs.app at '$installprefix'.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment