[libspng] Install pkg-config on Windows - #53510
Conversation
Related: microsoft#52891 Related: randy408/libspng#286 This changes libspng to install pkg-config on all platforms matching that installed by Debian. Also fix the declared licenses to match the SPDX expression. Their README says: >## License > >Code is licensed under the BSD 2-clause "Simplified" License. > >The project contains optimizations and test images from libpng, these are licensed under the [PNG Reference Library License version 2](http://www.libpng.org/pub/png/src/libpng-LICENSE.txt). but they don't have a copy of the license. The content under that license is incorporated into the .c so we have to install the whole thing.
| - foreach(libname ${spng_TARGETS}) | ||
| - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/libspng.pc.in ${CMAKE_CURRENT_BINARY_DIR}/cmake/lib${libname}.pc @ONLY) | ||
| +foreach(libname ${spng_TARGETS}) | ||
| + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/spng.pc.in ${CMAKE_CURRENT_BINARY_DIR}/cmake/${libname}.pc @ONLY) |
There was a problem hiding this comment.
Which names did this install, and which names does it install now?
There was a problem hiding this comment.
Kai Pastor (@dg0yt) libspng has two build systems. A meson one and a CMake one. The meson one installs spng.pc, which is also the name used in the Debian package and expected by libjpeg-turbo. This CMake one installs libspng.pc or libspng_static.pc. This PR resolves the conflict in favor of their meson build system on the grounds that that is what I see downstream customers expecting.
|
GPT 5.6 Sol reports (lest you think I would exempt myself):
I agree this is suboptimal but appears to be an explicit decision upstream has made so I think my hands are tied. The meson build system we are trying to match does not have the contrivance to build both static and dynamic in the same build like the CMake one has.
Stand by... |
On the other hand Debian is only ever installing the dynamic one. Maybe we should fix it up to always not have |
|
We could simply always install the "official basename" ( But in the end upstream needs to cleanup. |
| libspng provides pkg-config modules: | ||
|
|
||
| # PNG decoding and encoding library | ||
| @PC_NAME@ |
There was a problem hiding this comment.
IMO this is the harmful pattern:
The instruction seen in static triplets is a recipe for failure in dynamic triplets.
There is really no other reasonable way: always install a basename file, at least as a proxy for the actual _static file.
There was a problem hiding this comment.
I was on the fence about going this far because it seems to explicitly regard what upstream is doing but there's an argument that upstream's behavior is unreasonable.
|
GPT also reported:
|
…talled header for direct-include customers.
|
|
||
| vcpkg_copy_pdbs() | ||
|
|
||
| if (VCPKG_LIBRARY_LINKAGE STREQUAL "static") |
There was a problem hiding this comment.
For future maintenance, it would be nice to jot down what finding / error led to this fix. To my understanding, it is that libspng upstream is inconsistent with the naming of its pkg-config files: in meson it's always spng but in cmake it can be libspng or libspng_static`. And that this inconsistency causes pain for downstream consumers, so you unify them here.
though the PR also captures this, so the info is there. No blockers.
Related: #52891
Related: randy408/libspng#286
This changes libspng to install pkg-config on all platforms matching that installed by Debian.
Also fix the declared licenses to match the SPDX expression. Their README says:
but they don't have a copy of the license. The content under that license is incorporated into the .c so we have to install the whole thing.