Building Emacs On macOS

I often see posts on reddit and similar venues from people asking for help in building Emacs on Macs. On the one hand, it could hardly be simpler: you just download the code and call make. On the other hand, there are some wrinkles. Those wrinkles amount to installing the required libraries.

For a long time I did this by hand but then you have to worry about keeping them up to date for each new Emacs installation. I can’t even remember what those prerequisites are so keeping them up to date probably isn’t happening.

The right way to do this, it seems to me, is with Homebrew. It will take care of installing them and it’s easy to update them whenever you want to build a new Emacs or other application that depend on them. That still leaves knowing what prerequisites to install. You can try building Emacs and add them one by one when the builds fail but, happily, Lars Ingebrigtsen has come to our rescue with some step-by-step instructions for building Emacs on macOS with Homebrew.

His instructions are really how to do it via SSH from a Linux machine but the same process works if you do it directly on an macOS terminal. The one thing he doesn’t cover is moving the Emacs app into /Applications. I do that with a recursive copy but there are probably other ways. The important thing is to get Emacs.app into /Applications. Before I do the copy, I generally rename my current Emacs.app to something else and leave it in /Applications so I have a backup. The only other issue is getting macOS to open the new app the first time. The way to do this seems to change with each new OS release so you should ask DuckDuckGo for the current method.

This entry was posted in General and tagged , . Bookmark the permalink.