public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Mike Gilbert <floppym@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: Mike Gilbert <floppym@gentoo.org>
Subject: [gentoo-dev] [PATCH] systemd.eclass: remove SYSROOT from pkg-config output
Date: Sat,  2 Jan 2021 20:09:04 -0500	[thread overview]
Message-ID: <20210103010904.1158863-1-floppym@gentoo.org> (raw)

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@gentoo.org>
---

This patch has already been pushed, but I figured I would send it for
review in case someone else can think of a failure case, or has a better
solution.

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

diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass
index 81065a0af79a..f6d1fa2d92d6 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}
-- 
2.30.0



             reply	other threads:[~2021-01-03  1:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-03  1:09 Mike Gilbert [this message]
2021-01-03 12:52 ` [gentoo-dev] [PATCH] systemd.eclass: remove SYSROOT from pkg-config output James Le Cuirot
2021-01-03 13:02   ` James Le Cuirot
2021-01-03 15:16   ` Mike Gilbert
2021-01-04 23:18     ` James Le Cuirot
2021-01-04 23:45       ` Mike Gilbert
2021-01-05  0:28         ` Mike Gilbert
2021-01-06 22:47           ` James Le Cuirot
2021-01-06 23:18             ` Mike Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210103010904.1158863-1-floppym@gentoo.org \
    --to=floppym@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox