Port to MacOS #1

Open
opened 2026-08-21 20:37:40 +00:00 by Parthen · 5 comments
Owner

make currently assumes GNU/Linux and X11:

LIBS := -lraylib -lGL -lm -lpthread -ldl -lrt -lX11

-lrt does not exist on macOS. The rest of the X11/GL stack does not either. raylib itself already supports PLATFORM_DESKTOP / GLFW on macOS (Intel and Apple Silicon). The engine sources should too -- they only talk to raylib.

Done when

  • make (or a documented make invocation) builds on macOS
  • make run assets/alice.vnrs opens a window and plays the scene
  • make help, make clean, make nuke still make sense
  • README has a macOS quickstart (Xcode CLT, how to build)
  • Linux / X11 keep working. Do not "fix" Linux to please clang on a Mac.

Likely work

  • Detect Darwin in the Makefile (or split a tiny Makefile.macos)
  • Link the usual GLFW/macOS frameworks instead of X11: OpenGL, Cocoa, IOKit, CoreAudio, CoreVideo
  • Drop -lrt / -lX11 / probably -ldl on Darwin
  • find is fine on macOS; no need to invent a new source glob
  • Apple clang is OK. Stick to C99 and CONVENTIONS.md

Out of scope

  • Homebrew bottles, .app bundles, notarization, Game Porting Toolkit, iOS

Patches to develop, please. master is releases.

`make` currently assumes GNU/Linux and X11: ``` LIBS := -lraylib -lGL -lm -lpthread -ldl -lrt -lX11 ``` `-lrt` does not exist on macOS. The rest of the X11/GL stack does not either. raylib itself already supports `PLATFORM_DESKTOP` / GLFW on macOS (Intel and Apple Silicon). The engine sources should too -- they only talk to raylib. ## Done when - `make` (or a documented `make` invocation) builds on macOS - `make run assets/alice.vnrs` opens a window and plays the scene - `make help`, `make clean`, `make nuke` still make sense - README has a macOS quickstart (Xcode CLT, how to build) - Linux / X11 keep working. Do not "fix" Linux to please clang on a Mac. ## Likely work - Detect Darwin in the Makefile (or split a tiny `Makefile.macos`) - Link the usual GLFW/macOS frameworks instead of X11: OpenGL, Cocoa, IOKit, CoreAudio, CoreVideo - Drop `-lrt` / `-lX11` / probably `-ldl` on Darwin - `find` is fine on macOS; no need to invent a new source glob - Apple clang is OK. Stick to C99 and CONVENTIONS.md ## Out of scope - Homebrew bottles, `.app` bundles, notarization, Game Porting Toolkit, iOS Patches to `develop`, please. `master` is releases.
Member

hi! i'll work on it. @Parthen do you have intel mac? i can test only on apple silicon

hi! i'll work on it. @Parthen do you have intel mac? i can test only on apple silicon
Author
Owner

Cool! @sw1pr0g

Do you have Intel Mac

I do not, but I plan to get Mac mini somewhen to this winter.

Apple silicon

My bad, didn't thought about it. Idea is that we in the future should be able to compile all of Vinora with assets to single binary which will run on any MacOS system.

My concerns is:

  1. How interoperability works between ARM/x86? Can we make just an x86 version and will ARM Mac be able to emulate it?
  2. As I know, Apple dropping OpenGL support in favour of Metal. Raylib (OpenGL-only) have support for Mac, but how?

I'm unfamiliar with whole Apple devices, so I genuinely don't know.

Cool! @sw1pr0g >Do you have Intel Mac I do not, but I plan to get Mac mini somewhen to this winter. >Apple silicon My bad, didn't thought about it. Idea is that we in the future should be able to compile all of Vinora with assets to single binary which will run on any MacOS system. My concerns is: 1. How interoperability works between ARM/x86? Can we make just an x86 version and will ARM Mac be able to emulate it? 2. As I know, Apple dropping OpenGL support in favour of Metal. Raylib (OpenGL-only) have support for Mac, but how? I'm unfamiliar with whole Apple devices, so I genuinely don't know.
Member
1. How interoperability works between ARM/x86? Can we make just an x86 version and will ARM Mac be able to emulate it?

Yes, right now. A pure x86_64 binary runs on Apple Silicon Macs through Rosetta 2 (Apple’s binary translation layer). It is not classic emulation — Rosetta translates x86_64 code into native arm64, so performance is usually very good (often 70–90% of native). But Rosetta 2 will remain fully available through macOS 27.

2. As I know, Apple dropping OpenGL support in favour of Metal. Raylib (OpenGL-only) have support for Mac, but how?

Apple deprecated OpenGL in 2018 and froze their implementation at OpenGL 4.1. They strongly push Metal, but they have not removed OpenGL yet. Framework still works on all current macOS versions.

> 1. How interoperability works between ARM/x86? Can we make just an x86 version and will ARM Mac be able to emulate it? Yes, right now. A pure x86_64 binary runs on Apple Silicon Macs through Rosetta 2 (Apple’s binary translation layer). It is not classic emulation — Rosetta translates x86_64 code into native arm64, so performance is usually very good (often 70–90% of native). But Rosetta 2 will remain fully available through macOS 27. > 2. As I know, Apple dropping OpenGL support in favour of Metal. Raylib (OpenGL-only) have support for Mac, but how? Apple deprecated OpenGL in 2018 and froze their implementation at OpenGL 4.1. They strongly push Metal, but they have not removed OpenGL yet. Framework still works on all current macOS versions.
Member

@Parthen

My current thinking: we should ship a Universal Binary (Apple recommends it) — a single file that contains both x86_64 and arm64 slices. It will run natively on both Intel and Apple Silicon Macs without needing Rosetta.

@Parthen My current thinking: we should ship a Universal Binary (Apple recommends it) — a single file that contains both x86_64 and arm64 slices. It will run natively on both Intel and Apple Silicon Macs without needing Rosetta.
Author
Owner

@sw1pr0g

My current thinking: we should ship a Universal Binary (Apple recommends it) — a single file that contains both x86_64 and arm64 slices. It will run natively on both Intel and Apple Silicon Macs without needing Rosetta.

Yeah, sounds like the right thing.

@sw1pr0g > My current thinking: we should ship a Universal Binary (Apple recommends it) — a single file that contains both x86_64 and arm64 slices. It will run natively on both Intel and Apple Silicon Macs without needing Rosetta. Yeah, sounds like the right thing.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Vinora-Project/vinora-engine#1
No description provided.