RFC: Re-work pkgdep/DEPORIGIN? (was: Re: How to LIB_DEPEND on pgsql client?)

Ulrich Spoerlein q at uni.de
Mon Jun 7 12:57:44 GMT 2004

On Wed, 02.06.2004 at 14:58:40 -0700, Kris Kennaway wrote:
> > Hi,
> > What do I need to tell to my Makefile to make a port depend on
> > Postgresql client, which was removed ? The client can be built with
> > -DWITHOUT_SERVER, but how do I do this from the Makefile; should I use a
> > custom script ?
> You can't (think about how users would add packages).  For now -- until
> someone can redo the client/server split properly, in a way that
> doesn't break ports that try to use it -- you need to depend on the
> single postgresql package,

The real fix is IMHO not to blindly record the dependancy provided in
the Makefile. That is:

LIB_DEPENDS+=   pq.3:${PORTSDIR}/databases/postgresql7-client

will record databases/postgresql7 as dependancy, no matter what package
actually provided the libpq.so.3 in the first place. Postgres is not the
only place where this is wrong, lang/php4 has the same problems. Most
Ports require www/mod_php which I dont have installed. Instead I'm using
lang/php4 with WITH_APACHE.

x11/nvidia-driver has it too:
Stale dependency: nvidia-driver-1.0.4365_2 -> linux_base-7.1_7 (emulators/linux_base):
linux_base-8-8.0_4 (score:62%) ? ([y]es/[n]o/[a]ll) [no] 

In general, almost every slave port has this problem. The fix now would
be to make pkg_info -W work with -o and then using this output in the
pkgdep field.

% pkg_info -W /usr/local/lib/libpq.so.3
/usr/local/lib/libpq.so.3 was installed by package postgresql-7.4.2

Now we use this, instead of the
"${PORTSDIR}/databases/postgresql7-client" supplied in the LIB_DEPENDS

% pkg_info -oW /usr/local/lib/libpq.so.3

This should work without problems for ports, but I can't say if this
works for packages. AFAIK the +CONTENTS just gets extracted to
/var/db/pkg, but one would have to re-write it, to check which package
realy satisfied which dependancy.

Something like a new DEPFILE comment, which has the file we depend on
(libpq.so.3 in the example) and pkg_add checks if this is in sync with
the DEPORIGIN comment. If they differ, DEPORIGIN gets re-written. If
libpq.so.3 is provided by no package (check via pkg_info -W) but is
existent, we can print out errors.

I had this idea since the first time pkgdb gave me trouble because of
postgresql and php4, but I don't have any patches yet, as I'm not very
familiar with 'make package' and pkg_add. And I don't even know if
people here agree that this is the right direction to take.

So, do you want me to come up with patches?

Ulrich Spoerlein
PGP Key ID: F0DB9F44				Get it while it's hot!
PGP Fingerprint: F1CE D062 0CA9 ADE3 349B  2FE8 980A C6B5 F0DB 9F44
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."	-- Benjamin Franklin
-------------- 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/20040607/5e1782ff/attachment.bin

More information about the freebsd-ports mailing list