msys2 / MINGW-packages

Package scripts for MinGW-w64 targets to build under MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
2.28k stars 1.21k forks source link

Static libraries missing #10594

Closed MayaPosch closed 2 years ago

MayaPosch commented 2 years ago

Problem: No static libraries (*.a) are provided.

Summary: For distributing binaries compiled with MinGW64 etc., it's convenient to do a static build to not have to distribute DLLs along when only a fraction of their methods are used by the executable.

The current workaround is to uninstall the pacman package and do a manual build and install from source, but it would be convenient if this was possible by default.

Currently for a project like my NymphCast project, I can compile all of the dependencies statically using pacman-provided packages, except for poco.

1480c1 commented 2 years ago

Do you have a list of which specific packages are missing static libraries, is it only poco? Currently, for static libraries, we have to go through individual packages and add additional code to compile them depending on the build system

MayaPosch commented 2 years ago

Of the list of dependencies which I'm using with NymphCast, the following have unmet dependencies when compiling with -static:

mingw-w64-x86_64-poco mingw-w64-x86_64-vlc

Of the other dependencies, including SDL2, ffmpeg, etc. static libraries are available.

1480c1 commented 2 years ago

From what I remember off the top of my head, it was extremely hard to get vlc to compile with --enable-static (didn't manage it in the end while trying to have the same --enable-lib stuff)

MayaPosch commented 2 years ago

I have eliminated libvlc as a dependency from my project. This leaves just the libPoco entries that would need a static library. Would this be possible?

Much obliged.

Biswa96 commented 2 years ago

Thank you for reporting the issue. I have added a pull request to fix this issue. Would you like to test the packages from GitHub Actions artifacts of that pull request? The test packages can be downloaded from here https://github.com/msys2/MINGW-packages/actions/runs/1736828359