Mac Developer Support
This issue is about merging the necessary modifications to allow Cubyz to compile on Mac.
This has several benefits:
- Prevent my modifications from constantly going stale.
- Allow Mac developers to contribute to Cubyz more easily, and potentially test features themselves.
- Forms an initial step for later pursuing #299.
- Allows us to give feedback to Zig and Mesa developers on their own Mac support.
This is similar but distinct to issue #299. #299 refers to native Cubyz support for Mac, which requires adapting Cubyz or OpenGL to work on Mac with native performance. This issue only requires that Cubyz compiles, regardless of playability.
Changes to consider:
Cubyz:- Update
build.zigwith Mac libraries.- Note: Mac
libGLwill have to be in a non-standard location, unless we ship it withCubyz-libs.
- Note: Mac
- Allow GLFW context to be switched to EGL at runtime for debugging the Zink driver.
- Unfortunately, from past experience,
run_linux.shmight also involve rather invasive manual linking.
- Update
Cubyz-libs:- Update
build.zigto build libraries for Mac. - Note: because of the new platforms, this requires duplicating
libcubyz_deps.aseveral times (20 MB with-Doptimize=ReleaseSmall), which may be undesirable.
- Update
- Other niceties, with secondary utility:
- Install scripts or instructions for additional libraries/applications, such as Mesa LLVMpipe/Zink
libGL. Alternatively ship our own versions of these. - Include GLFW as a submodule referencing the official GLFW repo or our own fork. This is for isolating those changes and updating the dependency easier.
- Include an "official" build script for Cubyz-libs releases.
- Install scripts or instructions for additional libraries/applications, such as Mesa LLVMpipe/Zink
I'm mostly in favor of this. However since the future probably involves vulkan #102 I would like to avoid adding too much extra stuff, especially all the zink stuff, to the repositories for now.
Install scripts or instructions for additional libraries/applications, such as Mesa LLVMpipe/Zink libGL. Alternatively ship our own versions of these.
You are the only person on mac who will be going through all that trouble to get a barely playable game, so honestly we don't need install instructions for now. I think install instruction might actually be harmful because their existence would give the impression that the game would work on mac, which it doesn't.
Include GLFW as a submodule
Git submodules are annoying to use. It's better to use the zig package manager for that (similarly to how I did it for freetype and harfbuzz).
Note: because of the new platforms, this requires duplicating libcubyz_deps.a several times (20 MB with -Doptimize=ReleaseSmall), which may be undesirable.
Include an "official" build script for Cubyz-libs releases.
I've decided to extract these into a separate issue #325 which would be a requirement for this.
By the way hasn't this been fixed a while ago? You have been able to develop on mac for quite a while I think.