Skip to content

[libspng] Install pkg-config on Windows - #53510

Open
Billy O'Neal (BillyONeal) wants to merge 3 commits into
microsoft:masterfrom
BillyONeal:libspng-pkgconfig
Open

[libspng] Install pkg-config on Windows#53510
Billy O'Neal (BillyONeal) wants to merge 3 commits into
microsoft:masterfrom
BillyONeal:libspng-pkgconfig

Conversation

@BillyONeal

Copy link
Copy Markdown
Member

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:

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.

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.

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.
Comment thread ports/libspng/libspng-pr-286.diff Outdated
- 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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which names did this install, and which names does it install now?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@BillyONeal

Billy O'Neal (BillyONeal) commented Aug 21, 2026

Copy link
Copy Markdown
Member Author

GPT 5.6 Sol reports (lest you think I would exempt myself):

  • The new pkg-config generation still derives the module filename from the CMake target name. On static triplets the only target is spng_static, so libspng-pr-286.diff installs spng_static.pc, not the canonical spng.pc expected by libjpeg-turbo and installed by libspng's Meson build. Please make the static package expose module spng while retaining the correct static library link name.

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.

  • The custom usage documents only CMake. Since this PR adds a supported pkg-config integration, add the spng module to the usage text after correcting its static-triplet name.

Stand by...

@BillyONeal

Copy link
Copy Markdown
Member Author

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.

On the other hand Debian is only ever installing the dynamic one. Maybe we should fix it up to always not have _static since that becomes obnoxious for downstreams.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants