This repo contains some files useful for bundling Cubyz for MacOS. There are a couple ways to do this.
This is the most direct way to run Cubyz. Download Cubyz.dmg from the Releases. Then open the dmg, drag Cubyz.app into some folder, and right-click -> "Open" -> "Open Anyways".
Cubyz.app will try to install two things: XQuartz and LLVM. These are both necessary for this implementation of Cubyz. LLVM is installed through brew which may require administrator privileges.
To get a Cubyz.app bundle:
- Compile the
Cubyzigexecutable.- This project looks for the executable in
../Cubyz/zig-out/bin/Cubyz.
- This project looks for the executable in
- Obtain
libGL.1.dylib.- This projects expects
libGL.1.dylibandlibglapi.0.dylibin/usr/local/GL/lib/. - You can find these files in Releases or compile Mesa drivers yourself.
- This projects expects
- Go to to Cubyz-app, and run
sh all.sh. That will thengrab_logo.sh: fetches thelogo.pngfrom Cubyz to use as the app icon.setup.sh: collects and installs all necessary libraries into the Cubyz.app bundle.package.sh: compresses Cubyz.app into theCubyz.dmgfor distribution.
Cubyzig is not provided here as Cubyz is in rapid development. Compiling Cubyz for MacOS might require some additional changes, possibly including:
- Make sure XQuartz and a recent version of LLVM are installed.
- Download Cubyz-libs.
- You will need to patch
glfwto support X11 libraries on MacOS. If you don't know how:- Download my fork of
glfwnext to Cubyz. - Update the Cubyz-libs
build.zig.zon's dependency to say.path = "../glfw"
- Download my fork of
- You may need to modify
build.zigto enable vulkan-related blocks labeled withTODO(blackedout)unless you modify Cubyz sources yourself. - Compile:
$CUBYZ_ZIG build native -Doptimize=ReleaseSafe
- Download Mesa.
- Compile Mesa with
x11,llvmpipe,xlib.- Mesa's build system uses
mesonandninja. The docs may be useful. - For reference, check out
mesa-build.shandmesa-rebuild.sh. Be careful though, as those may nuke your system :) - Specific versions of Mesa/LLVM are not compatible with each other. The latest (24.1/21.1.5).
- Make sure it installs in
/usr/local/GL(which may require sudo access), otherwise modifysetup.shto check in a different directory.
- Mesa's build system uses
XCODE_SYSROOT should be set to something like /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk (a directory such that $XCODE_SYSROOT/usr). Remove MOLTENVK_DIR if you don't have the MoltenVK SDK.
It may be possible to compile iris drivers for Intel Macs in addition to llvmpipe. It may be possible to build zink drivers with MoltenVK.