added preliminary freebsd support #16
Loading…
Reference in a new issue
No description provided.
Delete branch "cathalo/wbg:freebsd"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This project was not too hard to get working on freebsd. I say preliminary as I have only observed it working with a .png file, however I wanted to make a pr so I can start working on a freebsd port that would not need patches to upstream.
@ -12,3 +13,3 @@add_project_arguments(['-D_POSIX_C_SOURCE=200809L', '-D_GNU_SOURCE'] +(is_freebsd ? [] : ['-D_POSIX_C_SOURCE=200809L', '-D_GNU_SOURCE'] ),Does it fail to build with these macros defined?
Yeah both of them are problematic for the build. The freebsd headers seem to not define stuff like
memfd_createwith these set.memfd_create is a linux extension. And it seems like it was added in FreeBSD 13. You can take inspiration from foot https://codeberg.org/dnkl/foot/src/branch/master/shm.c#L343-L365 and https://codeberg.org/dnkl/foot/src/branch/master/meson.build#L15-L17
So that it supports older versions of freebsd ? I tryed to add back the flags, however using the same logic as foot
MEMFD_CREATEis defined and the functions are not exported due to the flags. I think-D_POSIX_C_SOURCE=200809Lflag is specifically the culprit: this is not in foot either.I can change it to be the same as foot and specify
-D_GNU_SOURCE=200809Lwithout any condition for linux or freebsdYes?, tbh I don't know what dnkl prefers.
Just do whatever foot does. It makes maintenance easier.
As for whether we need/should support older versions, I don't really have an opinion. I don't mind supporting it, so it's really up to you.
@ -88,0 +92,4 @@if is_freebsdadd_project_arguments('-D__freebsd__=1', language: 'c')elseadd_project_arguments('-D__linux__=1', language: 'c')The preprocessor already defines
__linux__and__FreeBSD___depending on the platform.@ -150,3 +165,3 @@image_format_sources,wl_proto_src + wl_proto_headers, version,dependencies: [pixman, png, jpg, jxl, jxl_threads, webp, svg, wayland_client, tllist],dependencies: dependencies,You can use
libepoll = dependency('epoll-shim', required: false)and add it here directly (like foot).ahh cool, I have never used meson before so thanks for fixing the smells !
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.