Web lists-archives.com

Re: pkg-config: required as dep so often - How and where to report?

On 2018-05-04 15:48 +0200, Alexander Traud wrote:

> To compile a (quite large) project, I had to install several packages
> (dependencies). The project required the tool pkg-config. However, that
> was not mentioned anywhere. Still the project compiled/built, because
> one of the other dependencies (libsrtp2-dev) installed pkg-config as
> side effect. So, I had pure luck that it succeeded.
> When a package declares another package as "Depends" or "Recommends" in
> the file "control.in", it gets installed as side effect (Debian Policy).

In debian/control, not control.in.  And Recommends may or not be
installed, depending on the admin's decision.

> However, libsrtp2-dev needs pkg-config only when I compile it myself.

I'm not sure I can parse that.  The libsrtp2-dev package surely both
depends and build-depends on pkg-config.

> Consequently, pkg-config should be declared just as Build-Depends. This
> is a minor bug, I am going to report with that package. However then, I
> investigated a bit more and found seven (optional) dependencies of that
> project which would have installed pkg-config as a side effect too. OK,
> this is a bigger issue. Then I investigated further:
> $ apt-cache rdepends --no-suggests pkg-config
> On Ubuntu 18.04 LTS, this gives me 250 development packages (-dev)
> which install pkg-config as a side effect.
> $ apt-cache rdepends --no-recommends --no-suggests pkg-config
> Still 186 packages.
> Those packages come with a .pc file. However, the tool pkg-config should
> be "suggested" and not "required".

This very much depends on the package.  If you cannot just link against
libfoo with -lfoo but need special linker flags, then IMHO libfoo-dev is
well advised to add pkg-config to Depends, for instance.

| $ pkg-config --libs gtk+-3.0
| -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lfribidi -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0

You cannot really expect anyone to get this right without pkg-config,
and so libgtk-3-dev depends on pkg-config.