A while back, I wrote a how-to for building Emacs on Macos (for people who have no interest in using Macos), but I based that recipe on HomeBrew. There was recently a Macports-related bug report, so I set up a VM with Macports, and I thought I might as well write that up, too.
It turns out that this is even easier than using HomeBrew.
1) Open a Terminal window (by clicking on the spy-glass at the top there and write “Terminal” and then clicking on the icon).
2) Type “gcc” in the terminal. It’ll pop up a dialogue — just answer “yes” to everything.
3) Go to the Macports web page in Safari (it’s the icon that looks vaguely like a compass) and click on the installer for your version of Macos. Then click on the box icon again a couple of times, and answer “yes” some more.
4) Turn on the ssh server by typing “remote login” in the spyglass thing. Switch “Remote login” on for all users.
5) Now you can go back to your free OS, and do the rest via ssh.
sudo port selfupdate sudo port -N install git `port deps emacs | sed 's/^.*://' | sed 's/,//g' | tail -n 2` git clone https://git.savannah.gnu.org/git/emacs.git cd emacs make -j8 ./src/emacs -nw