I have ported Wayland (that is libwayland-client, libwayland-server, libwayland-cursor, and wayland-scanner) from Linux to Darwin (Mac OS X 10.6 Snow Leopard to be exact).
Wayland relies on many little things that are specific to Linux (examples: epoll, timerfd, SO_PEERCRED, <linux/input-event-codes.h>), so I had to try and come up with ways to make it work without them.
Plus, I couldn't really use autotools or Meson or CMake (nor clone anything over HTTPS) because of the OS being this old, so I had to hand-write and/or generate some Makefiles.
I have then ported some of the clients, including a few from #Weston. And to do that, I had to port the Weston toytoolkit.
I had to also port several libraries that Wayland and Weston depend on — among them, libffi, libxslt and libxkbcommon.
To top it off, I've written my very own Wayland compositor on top of libwayland-server and Cocoa.
The name's Owl; "wl" stands for Wayland, and "O" for the language it's written in (hint: it's not Swift).
Owl is the server to its Wayland clients and a client to Quartz. You can kinda call it WaylandQuartz, like XWayland and XQuartz, but I like the name Owl way better.
I've learned so much about writing a Wayland compositor without #wlroots, and even some new things about Darwin. Like, who knew OS X < 10.9 doesn't support using pty-s in kqueue? (Oh, that pipe-fork-select-proxy workaround I've implemented for this in weston-terminal!)
Any specific reason for using 10.6?
Answer A: I'm not a big fan of today's Apple nor of today's macOS, but I'm fascinated by the old versions. And Snow Leopard was the best classic OS X release.
Answer B: No particular reason; it's more fun this way because there's more of a challenge, perhaps?
@Shamar I mostly had to workaround the lack of these rather than reimplement them, but here you go:
• MSG_NOSIGNAL, MSG_DONTWAIT
• clock_gettime() and related APIs
• signalfd, timerfd
• strndup(), strncpy()
• O_CLOEXEC, SOCK_CLOEXEC, F_DUPFD_CLOEXEC, MSG_CMSG_CLOEXEC
• SO_PEERCRED, struct ucred
• (old versions of cairo and pixman)
It's a lot of Linux specific stuff to emulate for a new operating system. I'm rather surprised that it's so unportable for a "new" project, but I guess portability is not a huge issue to #Wayland developers: they focus on performance most.
I have to admit that I have no idea about #X11's portability but I guess it's not so coupled with Linux as over years it has been ported a lot.
Anyway, really @bugaevc, thank for sharing!
@bugaevc that's awesome!
Quick! Version control and backup asap!
@bugaevc Weston seemed insanely responsive when I tried it. But I don't know if that's because it's not very featureful yet 😋
@kai Mutter is too going to be super smooth when they fix frame scheduling and stuff
does it also run on mojave? would be quite useful for development
I haven't tried it (yet), but I see no reason why it wouldn't work.
@bugaevc That looks like quite an old macOS version. Is this 10.5 on PPC?
@js this is 10.6 (it's in the screenshot and mentioned further in the thread), on Intel.
I need to double-check, but IIRC Owl itself is 32-bit (since there was no 64-bit Cocoa), but the clients are 64-bit. The libraries are universal.
@bugaevc holy shit!!! 😱 Congratulations!!!
@bugaevc Nice, do you have plans to release it?
@benwaffle aha, finally somebody asked me that! :D
I have not yet decided what to do about this. I do want to eventually release it so that perhaps someone could even use it for something, and others could contribute if they're interested. But I need to fix many TODOs first, clean up the code in general, write build instructions, etc. etc., and I'm not sure when I'm going to get enough motivation to work on that.
That being said, if you're interested, PM me and I'll send you the sources.
@bugaevc what i would do is just toss the sources up regardless of the quality
@bugaevc That is fucking awesome.
@npyl how come this is your first toot, of all things?
Do I know you? You're the one that asked about Darling Foundation, right?
@bugaevc Yup, im the one that asked. I saw the mastodon link on your github profile and when i followed it first tout was this one! :)
@npyl ah, that explains it! :D
Well, welcome to then! Do you known your way around here or do you need some pointers?
And note that that toot is the beginning of a longer thread (that's why it's marked "0/5"); perhaps you've noticed but maybe you didn't.
@bugaevc Yup i noticed that too, and I kinda found them awesome aswell. xD
It's good to be a part of this community, though I'm totally new here, if you are so kind any pointers would be welcome! :)
• read these: https://blog.joinmastodon.org/2018/08/mastodon-quick-start-guide/ https://github.com/joyeusenoelle/GuideToMastodon/
• follow some interesting people! Here are some recommendations from me to bootstrap your home feed: @jamey @JPEG @alcinnz @brunoph @brion @wezm @ikyle @uliwitness @schlink (don't forget to untag all these people if you reply to this toot!)
• there's always interesting stuff on the local timeline
• search for # introductions, post your own
• interact with people, make friends!
The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!