From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A553A1382C5 for ; Sun, 3 Jan 2021 01:09:22 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2B593E082F; Sun, 3 Jan 2021 01:09:19 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B0D69E0826 for ; Sun, 3 Jan 2021 01:09:18 +0000 (UTC) From: Mike Gilbert To: gentoo-dev@lists.gentoo.org Cc: Mike Gilbert Subject: [gentoo-dev] [PATCH] systemd.eclass: remove SYSROOT from pkg-config output Date: Sat, 2 Jan 2021 20:09:04 -0500 Message-Id: <20210103010904.1158863-1-floppym@gentoo.org> X-Mailer: git-send-email 2.30.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: 2fe0606c-f4bc-40c7-8fa9-2d69cf6edeb6 X-Archives-Hash: 92794cd51a829c5c4faa1dfdd418a671 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 --- 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