-
Notifications
You must be signed in to change notification settings - Fork 482
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
Replaced downloading SDL2 from libsdl.org with git submodule SDL release 2.0.16 #1150
Conversation
…odule SDL with tag release-2.0.16. Removed the old patches. Simplified the build script. Added support for custom SDL2 toolchain and build profile. Removed bundled include files.
I think it looks fine, but reviewing your code I did indeed find the .patch fields being removed. Do you know if they have been fixed upstream? We might want to add one way or another to add custom patches. 🤔 |
For one, it looks like none of the patches were actually applied, as they were created for the different SDL versions (the chosen version was 2.0.14, while the patches were for 2.0.12): Yeah, I'm ready to put the patching infrastructure back, just do not know the best way to do it. Maybe we should copy source files to a separate directory inside OUT_DIR during build and patch there? The other way would be maintaining an SDL2 fork in Rust-SDL2 account, however this may be too much hassle? What would you prefer? |
…d to bundle hidapi yourselves as it is build in shared mode).
To clarify a bit on patches: the only patch remaining in build.rs was |
Then perhaps the patches are not needed anymore. What we could do maybe if patches are required in the future, is to fork SDL, apply our patches, and use that as a submodule? Do you think this would be a good idea? |
Yes, I believe potential SDL fork is one of the strong points for submodule approach. |
I'm extremely sorry, I consistenly forget to run cargo fmt after changing files =( |
No worries, thanks for the PR! |
Fixes #1148. I took the liberty of updating SDL2 to release-2.0.16 along the way. I've also done a minor cleanup of sdl2-sys/build.rs.
Tested on Windows 10 + MSVC 19, macOS 11.6 and Ubuntu Focal.
UPDATE: I have also fixed a couple of static link issues on Android: added required
rustc-link-lib=
directives and copy all libraries even for static-link builds (SDL2 builds their libhidapi.so shim for Android even in static mode).