Subject: Re: pkgconfig and pkgviews
To: Jeremy C. Reed <reed@reedmedia.net>
From: Julio M. Merino Vidal <jmmv@menta.net>
List: tech-pkg
Date: 04/27/2004 21:04:30
On Tue, 27 Apr 2004 10:32:48 -0700 (PDT)
"Jeremy C. Reed" <reed@reedmedia.net> wrote:

> 
> This is wrong.
> 
> So I added to devel/pkgconfig/Makefile.
> 
>  +# define location for *.pc files -- needed when using pkgviews
>  +CONFIGURE_ARGS+=       --libdir=${LOCALBASE}/lib
> 
> And now it works when running manually.

This is IMHO wrong, because only works for the default view.

We've got a problem with this, and many other packages that use a single
directory to look for files.  Configured without arguments makes them to
only look in their depot directory.  Configured with an explicit path to
prefix makes it only work for the default view.

The only solution I see to this is to define a global environment variable,
say VIEWBASE, that the user can set to point to their view (in general,
/usr/pkg).  We'd have to modify several packages to honour it, but it could
be good to have, I think.

And to avoid requiring the user to set the variable manually, easily driving
to errors (hey, my path is blah, but package foo is picking files from the
bar view!), we could automagically create wrappers in viewbase/bin/*, instead
of just symlinks.  Those wrappers could then set up the environment and call
the right program from its depot directory.

This way you could have completely independent views and, with the right
VIEWBASE value, programs symlinked into them could only look for files in
that view.

What do you think?

Cheers

-- 
Julio M. Merino Vidal <jmmv@menta.net>
The NetBSD Project - http://www.NetBSD.org/