These are the steps I took to get a version of SWI-prolog built using homebrew with xpce support, so ‘edit’, etc works.
Install XQuartz, the X11 server:
brew install --cask xquartz
Turn developer mode on so we can edit the swi-prolog formula:
brew developer on
Download the developer formulae:
brew tap homebrew/core
Allow installing modified formula:
export HOMEBREW_NO_INSTALL_FROM_API=1
Edit the swi-prolog formula:
brew edit swi-prolog
Add the following to the “depends_on” section:
depends_on "freetype"
depends_on "libx11"
Change ‘args’ to allow X packages:
args = ["-DSWIPL_PACKAGES_JAVA=OFF", "-DSWIPL_PACKAGES_X=ON", "-DCMAKE_INSTALL_RPATH=#{loader_path}"]
Exit the editor, saving the changes. Install swi-prolog from source, optionally adding “–head” to get the latest source.
brew install swi-prolog --build-from-source --head
Run XQuartz from the Mac OS Applications, then start swipl
with DISPLAY set to point to it:
DISPLAY=:0 swipl