tech-pkg archive

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

Re: missing system search paths for pkg-config



Am Sat, 08 May 2021 09:03:50 -0400
schrieb Greg Troxel <gdt%lexort.com@localhost>: 

> There are two separate things lurking here.  One is that pkgconf when
> used in building a package probably has these default paths turned off
> so only buildlink3'd pc files appear.  I'll assume you are not meaning
> to chagne that.

Yes. I assume the buildlink/wrapper stuff ensures that only .pc files
from intended deps are found … including linked ones from the base
system for builtin stuff? I'm not sure of the latter part right now but
it seems like the right thing.

The default search path including the system dirs would be for users
calling pkg-config for their own builds outside the pkgsrc framework,
but relying on software from pkgsrc.

> that it should be the set of paths that the base system ought to include
> if pkg-config is native (which might be the set it does include), plus
> the pkg-prefix pc directory.

Agree. And in the order that pkg-prefix supersedes the system ones.

> If the base has pkg-config, and it can be extracted, that seems
> conceptually ok.   Otherwise, it seems like having a list per system
> perhaps set in platform.mk, perhaps in something that's logically like
> that, is in order.

My method of extraction is rather crude, but seems to work nicely. A
list in platform.mk also begs the question how well-curated it is for
differing Linux distros and versions, or other OS that also start using
multiarch-like setups.

Another way to get at the directories:

$ pkg-config --debug 2>&1  | grep 'directory #'  
Cannot open directory #1 '/usr/local/lib/x86_64-linux-gnu/pkgconfig' in package search path: No such file or directory
Scanning directory #2 '/usr/local/lib/pkgconfig'
Cannot open directory #3 '/usr/local/share/pkgconfig' in package search path: No such file or directory
Scanning directory #4 '/usr/lib/x86_64-linux-gnu/pkgconfig'
Scanning directory #5 '/usr/lib/pkgconfig'
Scanning directory #6 '/usr/share/pkgconfig'

That's the traditional pkg-config … pkgconf behaves differnently:

$ /data/pkg/bin/pkg-config --debug --exists foobarfutz 2>&1 | grep trying\ path
libpkgconf/pkg.c:533 [pkgconf_pkg_try_specific_path]: trying path: /data/pkg/lib/pkgconfig for foobarfutz
libpkgconf/pkg.c:533 [pkgconf_pkg_try_specific_path]: trying path: /data/pkg/share/pkgconfig for foobarfutz
libpkgconf/pkg.c:533 [pkgconf_pkg_try_specific_path]: trying path: /usr/lib/pkgconfig for foobarfutz

One could check for these two, but that would mean two calls to
pkg-config for each bmake run. Sadly, I don't see an equivalent to

$ gcc --print-search-dirs


Alrighty then,

Thomas

-- 
Dr. Thomas Orgis
HPC @ Universität Hamburg


Home | Main Index | Thread Index | Old Index