Skip to content

Instantly share code, notes, and snippets.

@Calinou
Last active March 7, 2017 20:25
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Calinou/eef7adaf813dbbfe2d372fc763a739c9 to your computer and use it in GitHub Desktop.
Save Calinou/eef7adaf813dbbfe2d372fc763a739c9 to your computer and use it in GitHub Desktop.
Compile Godot for macOS easily
#!/bin/sh -x
# This script must be run from a macOS system with
# Xcode installed.
# Place this script at the root of your Godot Git clone.
# CC0 1.0 Universal
# Number of CPU threads to use for compilation (no "nproc" on macOS...)
nproc=4
# Build 64-bit Godot for OS X
scons p=osx -j$nproc verbose=no bits=64 tools=yes target=release_debug
scons p=osx -j$nproc verbose=no bits=64 tools=no target=release_debug
scons p=osx -j$nproc verbose=no bits=64 tools=no target=release
# Build 32-bit Godot for OS X
scons p=osx -j$nproc verbose=no bits=32 tools=yes target=release_debug
scons p=osx -j$nproc verbose=no bits=32 tools=no target=release_debug
scons p=osx -j$nproc verbose=no bits=32 tools=no target=release
# Install into osx_template.app/ which is in the bin/ directory
# Download osx_template.zip from here: https://archive.hugo.pro/misc/godot/osx_template.zip
# then extract it as osx_template.app in the bin/ directory.
cd bin/
cp godot.osx.opt.debug.64 osx_template.app/Contents/MacOS/godot_osx_debug.64
cp godot.osx.opt.debug.32 osx_template.app/Contents/MacOS/godot_osx_debug.32
cp godot.osx.opt.64 osx_template.app/Contents/MacOS/godot_osx_release.64
cp godot.osx.opt.32 osx_template.app/Contents/MacOS/godot_osx_release.32
# Create .zip of export template and copy it to Godot's templates directory
zip -r9 osx.zip osx_template.app
cp osx.zip $HOME/.godot/templates/
# Install Godot editor binaries into their .app directories, then create .zips
# Download Godot64.zip from here: https://archive.hugo.pro/misc/godot/Godot64.zip
# then extract it as Godot64.app in the bin/ directory.
# Download Godot32.zip from here: https://archive.hugo.pro/misc/godot/Godot32.zip
# then extract it as Godot64.app in the bin/ directory.
cp godot.osx.opt.tools.64 Godot64.app/Contents/MacOS/Godot
cp godot.osx.opt.tools.32 Godot32.app/Contents/MacOS/Godot
zip -r9 $HOME/.godot/editor/godot-osx-x86_64.zip Godot64.app/
zip -r9 $HOME/.godot/editor/godot-osx-x86.zip Godot32.app/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment