[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Should -dev packages providing .pc files depend on pkg-config?



On Wed, 2008-04-16 at 19:15 +0200, Goswin von Brederlow wrote:
> Gabor Gombas <gombasg@sztaki.hu> writes:
> 
> > On Wed, Apr 16, 2008 at 11:23:51AM +0100, Neil Williams wrote:
> >
> >> What about these clauses as a Policy amendment?
> >> 
> >> 1. If a library *only supports the retrieval of FOO_LIBS and / or
> >> FOO_CFLAGS by the use of pkg-config*, pkg-config becomes part of the API
> >> of that library and the -dev package of that library must depend on
> >> pkg-config. The mere presence of a .pc file in the -dev package of the
> >> library does *not* mean that only pkg-config is supported. e.g. where a
> >> library requires the use of an m4 macro that involves calling
> >> pkg-config, this would require the -dev package to depend on pkg-config
> >> but if a library provides a .pc file but also supports alternative
> >> method(s), the -dev package does not need to depend on pkg-config.
> >> 
> >> 2. If a source package uses libraries that package a .pc but where all
> >> the libraries also support other methods of obtaining the relevant data,
> >> and the source package requires the use of pkg-config despite those
> >> other methods being available, then that choice by the source package
> >> upstream must result in a Build-Depends on pkg-config in the source
> >> package.
> >> 
> >> Is that suitable as a Policy clause? (probably needs a few tweaks for
> >> clarity and examples in clause 1).
> >
> > Wow, that's awfully complicated. This is much more straightforward:
> >
> > 	"If a package wants to call /usr/bin/foo during build and fails
> > 	to build properly if /usr/bin/foo is not present, then the
> > 	package MUST Build-Depend: on some other package providing
> > 	/usr/bin/foo".
> >
> > And by this definition, it is the package _invoking_ pkg-config that
> > should Build-Depend on it, not the package that happens to ship a .pc
> > file.
> >
> > Gabor
> 
> You are missing the point.
> 
> What if the library says "You must call /usr/bin/foo during build"?
> The libarry does not use foo, only the user, so no depends?

The library -dev package includes the binary - if that binary needs
other binaries to run, the package containing the binary must depend on
those packages. So if /usr/bin/foo is actually a script that calls
pkg-config, the -dev package containing /usr/bin/foo must depend on
pkg-config. However, unless the application linking against the library
does not use pkg-config for any other libraries that it needs, the
application will be running pkg-config during the ./configure script so
the application will need to Build-Depend on pkg-config as well.

> Or idoes forcing users to use foo make foo part of the API and hence
> the library should depend on it?

Exactly - it does, IMHO. That is why I suggested the more complex
wording, albeit still based on the "you run it, you depend on it"
mantra.

-- 
Neil Williams <codehelp@debian.org>

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: