mesonbuild / mesonbuild/meson

Don't add private dependencies to Requires.private when --default-library=shared

Open
#3,970 15 comments 0 reactions 1 assignee View on GitHub

@nirbheek is already working on this.

Since Aug 7, 2018.

bug pkgconfig
Dominant language
Python
Stars
6.6k
Forks
1.9k
Avg merge
2d 6h
Merged PRs (30d)
33

Description

Hi!

Since a few releases, Meson unconditionally adds `Requires.private` libraries to pkg-config .pc files, even if none of the interfaces of these libraries are actually exposed at all in the shared library that is to be installed.
For example, I have a library that uses libxml2 internally, but none if its types are actually exposed and nobody using my library needs to have the development files for libxml2 actually installed on their system.

However, when they now want to link against my library, pkg-config complains with
```
pkg-config --cflags appstream
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libxml-2.0', required by 'appstream', not found
```
This behavior change broke quite a few things, and the only way I seem to be able to control what ends up in the .pc files is to postprocess it with sed, which seems suboptimal.

Can support for controlling what ends up in `Requires.private` & Co. be added, please?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.