Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add libsdl3 #6225

Draft
wants to merge 31 commits into
base: dev
Choose a base branch
from
Draft

Add libsdl3 #6225

wants to merge 31 commits into from

Conversation

SirLynix
Copy link
Member

#6156

I took the libsdl package and removed all deprecated stuff, I may have missed some things though.

packages/l/libsdl3/xmake.lua Outdated Show resolved Hide resolved
@luadebug
Copy link
Contributor

luadebug commented Jan 23, 2025

actions/runner-images#10980 (comment)
Altering 2022 MSVC CI maybe would help, though I do not understand exactly how this change should look like.

 windows:
    runs-on: windows-2025

Either swapping win SDK ver either swapping ninja ver helped them as well it seems, what is really confusing to understand what was exactly a solution.

on_load(function (package)
    if package:is_plat("windows") then
        package:add("deps", "ninja")
        package:set("policy", "package.cmake_generator.ninja", true)
    end

Maybe we miss UniformTypeIdentifiers framework for Macos? Although I'm already confused seeing brew::sdl3 does it really exist?
https://github.com/xmake-io/xmake-repo/blob/dev/packages%2Fn%2Fnativefiledialog-extended%2Fxmake.lua#L23
https://github.com/conan-io/conan-center-index/blob/master/recipes%2Fqt%2F6.x.x%2Fconanfile.py#L1208
(It's presence so rarely)

@SirLynix
Copy link
Member Author

I don't think it's the best way to fix this since some users will have 2022 CI as well.

@Kbz-8
Copy link
Contributor

Kbz-8 commented Jan 24, 2025

if the new package name is libsdl3, wouldn't it be logical to name the "old" one libsdl2 instead of libsdl ?

@SirLynix
Copy link
Member Author

Yes indeed, the next step is to rename libsdl to libsdl2 and keep a libsdl package using libsdl2 as a base, like this:

package("libsdl")
    set_base("libsdl2")

    on_load(function (package)
        wprint("libsdl package has been renamed to libsdl2 following the release of SDL3 which is also available under the name libsdl3.${clear}")
    end)

packages/l/libsdl3/xmake.lua Outdated Show resolved Hide resolved
Comment on lines 24 to 25
add_configs("x11", {description = "Enables X11 support (requires it on the system)", default = true, type = "boolean"})
add_configs("wayland", {description = "Enables Wayland support", default = true, type = "boolean"})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't do linux development, but is there a reason why these are enabled by default on that platform? I thought you could develop a libsdl3 application without these?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of the main feature of SDL (and reason people use it) is input and window management, which need x11/wayland to work.
It's very rare to use libsdl without these

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm always wary about defaults being enabled because you can't really take it back later. Even if it's rare, minimal dependencies by default should still be a consideration.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand, but libsdl is a bit special, it only requires headers to build as it doesn't link x11 nor wayland, it loads them manually (dlopen/dlsym) at runtime only if they're available.

A good default for libsdl is to build it with as many deps as possible for this reason

@SirLynix
Copy link
Member Author

SirLynix commented Feb 3, 2025

cross and linux ARM64 fail because of wayland not supporting cross-building at the moment (because of wayland-scanner), I think this should be addressed. I'm disabling wayland by default for now on cross-platforms

@SirLynix SirLynix marked this pull request as draft February 3, 2025 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants