commit:     ac07a890dd55813eee120b328a17ee413e5c3489
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sat Jan  2 23:37:39 2021 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sat Jan  2 23:48:26 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ac07a890

systemd.eclass: remove SYSROOT from pkg-config output

When cross-compiling, users will typically have
PKG_CONFIG_SYSROOT=${SYSROOT} defined via pkg-config wrapper.

When PKG_CONFIG_SYSROOT is set, all paths included in pkg-config
output get prefixed with this value.

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 eclass/systemd.eclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass
index 81065a0af79..f6d1fa2d92d 100644
--- a/eclass/systemd.eclass
+++ b/eclass/systemd.eclass
@@ -50,6 +50,7 @@ _systemd_get_dir() {
 
        if $(tc-getPKG_CONFIG) --exists systemd; then
                d=$($(tc-getPKG_CONFIG) --variable="${variable}" systemd) || die
+               d=${d#${SYSROOT}}
                d=${d#${EPREFIX}}
        else
                d=${fallback}

Reply via email to