-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
SDL_compat: use SDL3 through sdl2-compat #386495
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does libx11 come from here? Was it propagated by normal SDL2 or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was, see
nixpkgs/pkgs/development/libraries/SDL2/default.nix
Lines 114 to 119 in e3e32b6
It might however make sense to do the following:
This adds extra complexity, but would allow us to not maintain multiple lists of the same thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(not quite familiar with how propagatedBuildInputs works, there might be better ways.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be necessary though, that's what propagation does already - if sdl2-compat is in sdl-compat's
propagatedBuildInputs, sdl2'spropagatedBuildInputswill also be propagated.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thats the issue!!
See
nixpkgs/pkgs/by-name/sd/sdl2-compat/package.nix
Lines 36 to 38 in 74b648b
sdl2-compatis not listingsdl3as propagated build input. THAT is the issue and should be fixed. Then explicit libX11 can be dropped here.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should, however, propagate libX11, because
include/SDL2/SDL_syswm.hrefers to xlib includes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sdl2-compat also does a
dlopenon sdl3 at runtime, see #388079. The fact that is currently missing is more a mistake/bug than anything.(these two PRs really should have been one, huh?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i need to do some testing. But either way, libX11 being in SDL_compat explicitly seems to not be the correct solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that is handled by rpath and doesn't really have to do with propagated build inputs, or am I missing something?
I'm still a bit fuzzy on how exactly propagated build inputs work but I don't understand why that wouldn't be the correct approach. It seems like sdl2-compat doesn't need to propagate libX11, since I've managed to build some games without it, but SDL1 does so that's why it appears here. It's a bit weird that SDL2 propagated libX11 but maybe that was the issue in the first place and now it got accidentally corrected in sdl2-compat?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SDL2 propagated libX11. If sdl2-compat is supposed to be a drop-in replacement, it should do the same imo.