Why are implicit package dependencies recorded?

Michael Nottebrock lofi at freebsd.org
Sun May 8 11:44:59 PDT 2005


On Sunday, 8. May 2005 19:04, James E. Flemer wrote:

> I ask mostly because it seems to easy to get the
> sub-dependencies wrong.  A simple case for incorrect sub-deps is this:
>
> There is a package P that depends on a package D.  The package D has an
> optional dependency on S via the make flag WITH_S.  The dependency on S
> defaults to false.  If package D is built with -DWITH_S, then D depends
> on S.  Now, when package P is built the package-depends-list target will
> recurse into D, but omits S from the list (remember the flag defaults to
> false).
>
> The scenario above creates a hidden dependency in P on S (that is not
> recorded in the @pkgdep list).  If the case above is inverted, WITH_S
> defaults to true and D is built with -DWITHOUT_S, then a bogus
> dependency on S is recorded for P.

Dependencies are recorded as they are flagged. If there's an .ifdef 
WITH/WITHOUT_S wrapper around a *_DEPENDS line in a Makefile, the dependency 
will or will not be recorded into the binary package correctly, so it's 
perfectly possible to build customized packages with different dependencies 
than the default ones (I guess that's what you want to do).

> Both of these cases can be avoided by building P with the same flags
> that D was built with.  In the simple case, that does not seem like a
> bad solution, but in practice there can be a huge number of deps and
> sub-deps (mplayer has around 45).
>
> Is there a need for sub-deps to be recorded recursively?  I believe that
> pkg_add will do the right thing if they are not.

I'm quite sure it won't. Have you tried?

-- 
   ,_,   | Michael Nottebrock               | lofi at freebsd.org
 (/^ ^\) | FreeBSD - The Power to Serve     | http://www.freebsd.org
   \u/   | K Desktop Environment on FreeBSD | http://freebsd.kde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20050508/e7820d01/attachment.bin


More information about the freebsd-ports mailing list