Subject: Re: rpath and prefix option for binary packages
To: None <tech-pkg@netbsd.org>
From: Christian Biere <christianbiere@gmx.de>
List: tech-pkg
Date: 12/08/2006 19:08:50
Joerg Sonnenberger wrote:
> On Fri, Dec 08, 2006 at 06:01:52PM +0100, Anthony Mallet wrote:
> > Correct me if I am wrong: I think that binary packages installed with
> > pkg_add -p <path> with a different path than the one used to generate the
> > package get installed with the wrong RPATH for shared libraries.
>
> It also generates a wrong pkgdb, which is even worse.
>
> > Has anyone already thought about some workaround for this?
>
> It can be done very limited (like e.g. chrpath). It is not perfect and
> like Hubert said, doesn't cover all the other path names built into
> binaries. In general, I don't think it is worth the trouble.
One possibility would be introducing a path discovery system through sysconf or
similar, so that applications could query the system for the path prefix to be
used instead of using compile-time configured paths. Environment variables
exist but that might not be a good solution, an admin might really want to have
control over the paths used.
I'd think the most important and actively developed applications would support
such a simple feature in no time. Of course on many popular systems this
problem does not exist because everything is simply thrown into
/usr/{include,lib/bin}.
Maybe this could be integrated into pkg-config actually. The API would be
as simple as this:
const char *package_config_get_path_prefix(const char *package_name);
or possibly support different paths for icons, shared data and such. Albeit
you can probably just use symlinks for the same purpose, so this would be
over-engineering.
--
Christian