The structure of `.winlib` file?
I'm sorry but it's really a mess to me. I want to help but don't know where to start.
The winlibs recipe file have the extension .winlib and are basically shell scripts that are run in MSYS2 shell.
The basic template for a recipe can be found here: https://github.com/brechtsanders/winlibs_recipes/blob/main/template.winlib
Lines starting with # are ignored (which is typical for shell scripts).
The lines at the top starting with export VARIABLE= are variables that are extracted by the various tools from https://github.com/brechtsanders/winlibs_tools
I still need to document how to set up MSYS2 shell for use with the winlibs tools and how to actually build packages.
Where are you storing patch files? It seems that you included the patches in the .winlib file, making everything a mess.
The .winlib recipes are all-in-one, there are no external patch files (which I think would be a mess).