My issue (and this is sort of off topic) is that I’m actually trying to package this as a pip installable package on pypi.
Well, I can’t say that’s the right choice of tool, it is for python packages, although you can stuff whatever you want in there.
I thought that the solution would be to use pysdl2-dll.
I believe this package is just for things like FFI. The thing you need:
but not the symbols or macros. Seems like a dead end.
They should come from system installed dependencies.
Python’s way is to provide prebuilds for most popular platforms, and if there’s no match for the end user, then compile the program. The latter almost always means using system-installed libraries, and it could fail if the user doesn’t have developer packages installed. You can show message like “Compilation failed make sure you installed libsdl2-dev”. It is also correct to assume that end users will have libABC installed if they want to use compiled python-libABC.
how do I create a platform independent build script? Should I attempt to download SDL3 and use cmake to compile it from the setup.py? Is there a guide anywhere?
This is certainly a hell of a rabbit hole , and you have countless ways to deal with it.
For your program, I will recommend that you only depend on the libraries installed in the system, since you only have one external dependency, libsdl.
I will not advise you to try SDL3 until it is finally released (which will be really soon btw!) as not every Linux disto package it, on the other hand SDL2 is available pretty much everywhere.
If you plan to support windows, then prebuilds are the thing, as the package management there is a wild west.
It will probably be better if you ship an AppImage of your application instead of a python package. The things you want to do are possible, but honestly very annoying.