Building Godot 4 for large world sizes on Mac

See the prior thread for info on building for large world sizes in general, but here I’m going to cover the somewhat poorly documented process for setting up a build and export that works on macOS.
I haven’t gotten a paid dev key for Apple yet, so that final piece will be updated later when I can.

First up on macOS, you’re going to install Brew. This is probably not essential, but it will make a lot of things easier.

As of this writing, installing brew is just:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Next up, create your directory and clone your version of Godot. I recommend specifying the version so you don’t get a moving target.

git clone https://github.com/godotengine/godot.git -b 4.5

# add support for Windows if desired:
brew install mingw-w64

First we build the editor:

export SCRIPT_AES256_ENCRYPTION_KEY="(if using a key)"; scons platform=macos arch=x86_64 precision=double -j4
export SCRIPT_AES256_ENCRYPTION_KEY="(if using a key)"; scons platform=macos arch=arm64 precision=double -j4 generate_bundle=yes

Now we build the export template:

#Bundle goes on the LAST command issued to put both in a single set, ie Universal Binary
export SCRIPT_AES256_ENCRYPTION_KEY="(if using a key)"; scons platform=macos arch=x86_64 precision=double -j4 target=template_release production=yes tools=no

export SCRIPT_AES256_ENCRYPTION_KEY="(if using a key)"; scons platform=macos arch=arm64 precision=double -j4 target=template_release production=yes tools=no generate_bundle=yes

So that’s all pretty simple, cut and dried, just like the windows or linux builds.
Here’s where it goes completely off the rails, IME:
The zip file created is non-runnable and doesn’t do anything, unlike the Windows and Linux builds. So expand the zip file godot/bin/godot_4.5.2_macos_template_double.zip and then right-click and select “Show Package Contents”.

Edit Contents\Info.plist in a text editor. You can’t open it in Xcode because it’s a broken format - in theory the Godot Editor will use this zip file to create a proper binary when you export, but as of 4.5.2 it doesn’t seem to do that properly when you export for macOS. Maybe it does if you aren’t using a shared PCK format, or if you’re on the standard commerical release. If that worked, you wouldn’t be here, though, would you?

Edit the Info.plist, find and replace all the fields that have “$” in there with the correct values. There are quite a few of them - it wants your package name, your company name, SDK, Xcode version, etc. For friendly names, look at the export fields in the Editor.

Once that’s all set, navigate to the Resources folder and replace icons.icns with your own personal icns file, then the last tricky bit, go to the MacOS folder and next to the godot_macos_release.universal executable, place your PCK file. Call it godot_macos_release.pck and you’re golden.

Back out of the package, and now it should have your icon and show as an executable package. Until you register with Apple you will still confront a warning if you launch this on a machine other than yours, but it’s now possible to launch.

I’ll update later if/when I pay for the developer key!