Automated builds for SDL and plugins via GitHub actions

Hello,

I am trying to generate automated builds for SDL and the plugins with GitHub actions. I am using the unofficial GitHub mirrors of the Hg repositories, which can be found here: https://github.com/SDL-mirror. What I need is to produce dynamic libraries (*.dll for Windows, *.dylib for MacOS and *.so for Linux - Ubuntu) to be used by a C# application via platform invoke (PInvoke). I have created a GitHub action for the SDL repository using CMake and everything compiles just fine on all platforms. What gives me trouble are the plugins. I need builds for SDL Image, SDL Mixer and SDL TTF, at least. Apparently the plugins are not setup to be built via CMake. I have tried the regular Make, but the build fails giving me an error it cannot discover the SDL headers and binaries. What do I need to configure on the build agents for the build to succeed? I am sorry to ask such a silly question, but I am a C# guy and all this C++ build stuff is new to me. Any help would be greatly appreciated.

Regards,
Ivan

I did not have enough spare time to continue with my side project recently. Stripping down my GitHub workflow, here is what I have come up so far:

mkdir dist
mkdir dist/include
mkdir dist/lib
export CFLAGS=-I$PWD/dist/include
export LDFLAGS=-L$PWD/dist/lib
cd sdl2
./configure --prefix=$PWD/…/dist
make
make install
cd …/sdl2_image
./configure --prefix=$PWD/…/dist
make
make install
cd …/sdl2_mixer
./configure --prefix=$PWD/…/dist
make
make install
cd …/sdl2_ttf
./configure --prefix=$PWD/…/dist
make
make install
cd …/sdl2_net
./configure --prefix=$PWD/…/dist
make
make install

The above script effectively builds and installs SDL2 and its plugins to the dist subdirectory. My problem is that the plugins SDL2_image, SDL2_mixer, SDL2_ttf have other dependencies, e.g. libpng, libwebp, libogg, libvorbis etc. I could download and build all those dependencies from source code in a similar manner, however I have noticed that the plugins already contain the source code for these dependencies and actually apply some custom .patch files to them upon compilation. Now I am confused how I am supposed to generate those binaries myself, because apparently the plugins are using some ‘customized’ versions of the libraries with bugfixes or whatnot?

Ideally, what I am trying to accomplish is to generate a NuGet package with all the required binaries, so that my entire C# library could be distributed via NuGet, without any extra hassle. Most other C# bindings for SDL2 require installing the binaries manually via apt-get (Linux) or brew (Mac OS), but that is suboptimal. I am pretty sure someone else did this already, so any help would be greatly appreciated.