On Mon, Jan 4, 2021 at 6:18 PM James Le Cuirot <ch...@gentoo.org> wrote:
> $ PKG_CONFIG_SYSROOT_DIR=/foo pkg-config --variable=udevdir udev
> /lib/udev
>
> The udevdir variable is not affected by PKG_CONFIG_SYSROOT_DIR at all.
> And why would it be? The man page says that this variable is only
> applied to -I and -L flags. I don't know for sure but I suspect that
> pkg-config just sees this as some arbitrary variable with no special
> path handling at all. I wonder what led you to think that this fix was
> necessary?

Interesting!

pkg-config behaves differently on my system:

% PKG_CONFIG_SYSROOT_DIR=/foo pkg-config --variable=udevdir udev
/foo/lib/udev

This appears to be a difference in behavior between dev-util/pkgconfig
and dev-util/pkgconf. I am using pkgconf, and I would guess you are
using pkgconfig.

I guess I will ask pkgconf upstream for help on this; it seems like
this is probably an unintended behavior.

> One last question. Why is this dynamic at all? Shouldn't it just be
> hardcoded to /lib/udev? Sure, a user could patch udev to make it
> something different if they really wanted but there are plenty of other
> paths we just assume. What makes this one special?

sys-apps/systemd has a USE flag called "split-usr". This is meant to
allow users to perform a /usr merge if desired. When split-usr is
disabled, udevdir becomes /usr/lib/udev instead of /lib/udev.

Reply via email to