All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 2/3] pkgconfig.bblcass: remove PKG_CONFIG_SYSROOT_DIR from installed .pc files
Date: Thu, 18 Dec 2014 12:03:37 +0000	[thread overview]
Message-ID: <1418904217.5106.24.camel@linuxfoundation.org> (raw)
In-Reply-To: <1418900663-20985-3-git-send-email-enrico.scholz@sigma-chemnitz.de>

On Thu, 2014-12-18 at 12:04 +0100, Enrico Scholz wrote:
> Having ${PKG_CONFIG_SYSROOT_DIR} in installed .pc files is nearly
> everytime an error because it next 'pkgconfig' call will prepend
> ${PKG_CONFIG_SYSROOT_DIR} environment variable again resulting into a
> duplication and invalidation of paths.
> 
> Patch removes this string from installed .pc files.
> 
> Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
> ---
>  meta/classes/pkgconfig.bbclass | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/meta/classes/pkgconfig.bbclass b/meta/classes/pkgconfig.bbclass
> index ad1f84f..459a871 100644
> --- a/meta/classes/pkgconfig.bbclass
> +++ b/meta/classes/pkgconfig.bbclass
> @@ -1,2 +1,19 @@
>  DEPENDS_prepend = "pkgconfig-native "
>  
> +PKGCONFIG_FILE_PATTERN ?= "-path '*/pkgconfig/*' -name '*.pc' -type f"
> +PKGCONFIG_FILE_PATTERN[doc] = "Options given to the 'find' utility to \
> + iterate over pkgconfig files"
> +
> +pkgconfig_mangle_pc() {
> +    if test -n '${PKG_CONFIG_SYSROOT_DIR}'; then
> +	# find .pc files, check and give out whether they contain
> +	# the sysroot dir and remove this string
> +	find '${D}' ${PKGCONFIG_FILE_PATTERN} \
> +	     -exec grep '${PKG_CONFIG_SYSROOT_DIR}' '{}' \; \
> +	     -printf "NOTE: removing PKG_CONFIG_SYSROOT_DIR from %P\n" \
> +	     -exec sed -i \
> +	               -e 's!${PKG_CONFIG_SYSROOT_DIR}!!g' \
> +	           '{}' \;
> +    fi
> +}
> +do_install[postfuncs] += "pkgconfig_mangle_pc"

We are *not* going down this route. We should fix the problematic .pc
files which are by definition broken if they're doing this, not start
mangling the .pc files.

The binconfig class is near unmaintainable due to these kinds of
problems, we have no idea which things we need to map and so on. With
pkgconfig, we used to have this madness, we got rid of most of it with
the inclusion of sysroot support in pkgconfig itself.

Cheers,

Richard




  reply	other threads:[~2014-12-18 12:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-18 11:04 [PATCH 0/3] avoid refs to sysroot in pkgconfig files Enrico Scholz
2014-12-18 11:04 ` [PATCH 1/3] insane: added 'pkgconfig-nosysroot' check Enrico Scholz
2014-12-18 11:04 ` [PATCH 2/3] pkgconfig.bblcass: remove PKG_CONFIG_SYSROOT_DIR from installed .pc files Enrico Scholz
2014-12-18 12:03   ` Richard Purdie [this message]
2014-12-18 12:47     ` Enrico Scholz
2014-12-18 11:04 ` [PATCH 3/3] insane: made 'pkgconfig-nosysroot' check critical Enrico Scholz

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=1418904217.5106.24.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=enrico.scholz@sigma-chemnitz.de \
    --cc=openembedded-core@lists.openembedded.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.