tech-pkg archive

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

using pkg-config modules from host (Re: wip/py-numpy + blas)



I'm bringing this back from private discussion with wiz, as it is a
broader question, IMHO. I guess I could hack the configure script in
this case, but I'd rather have a generic 'proper' solution.

A question for the public of pkg experts:

How to properly make a build find and use pkg-config files from the
host system?

Python 3.11 builds its NIS module only if it finds libnsl (which needs
libtirpc), which is the part to do NIS/YP on glibc systems since that
code got split out. We have logic in the Makefile which looks for
certain headers, but that is not enough now, unless configure is
patched.

Inside the build-env,

$PKG_CONFIG --exists --print-errors "libnsl"

will not find the host system's libnsl.cp (and libtirpc.pc), at least
not when certain paths are enforced in pkgsrc config. Pkgsrc uses its
on pkg-config with its own default paths, and intentionally limits
things to buildlink.

The configure script is happy when I do

ln -s /usr/lib/x86_64-linux-gnu/pkgconfig/libnsl.pc /data/projekte/pkgsrc/work/lang/python311/work/.buildlink/lib/pkgconfig/
ln -s /usr/lib/x86_64-linux-gnu/pkgconfig/libtirpc.pc /data/projekte/pkgsrc/work/lang/python311/work/.buildlink/lib/pkgconfig/

but those source paths are not universal to all Linux disros. I'd have
to locate them. And I ask if that is the proper way to handle such,
anyway.

The generic question is: How to make pkgsrc's pkg-config in builds find
and use .pc files from the host environment?

Pkgsrc package builds use PKG_CONFIG_LIBDIR (replace default search
path) instead of PKG_CONFIG_PATH (prepend to search list). I know that
for my user environments, I need to add stuff like
/usr/lib64/pkgconfig:/usr/share/pkgconfig to PKG_CONFIG_PATH
to make all builds of pkg-config find also the system stuff. Should
pkgsrc bootstrap do that itself? Just like system lib directories that
are used by the linker, the pkg-config files should also be picked up.


Alrighty then,

Thomas


PS: A side question is if whatever the Python NIS module does is
relevant to non-glibc systems. As-is, it won't ever be built elsewhere,
even if the host does use NIS/YP.

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


Home | Main Index | Thread Index | Old Index