This is happening because the build wishes to use the file sha1.h which is part of the emacs-mac-app source code, but erroneously the flag -I/opt/local/include
is being used prior to the project's own -I
flags, which means that the file /opt/local/include/sha1.h which must have come from some other port is being used instead. The order of the -I
flags must be fixed.
Where did this file come from? Find out with:
port provides /opt/local/include/sha1.h
I could not find a port providing that file by searching https://ports.macports.org.
If you were using macOS 12 or earlier you could work around the problem using trace mode:
sudo port clean emacs-mac-app
sudo port -t install emacs-mac-app
But since you are using macOS 13 and trace mode is broken in macOS 13 and later, the solution would be to sudo port -f deactivate
whatever port provided /opt/local/include/sha1.h, then install emacs-mac-app, then, if desired, sudo port activate
the port that provided sha1.h again.