[OE-core] [PATCH 2/3] pkgconfig.bblcass: remove PKG_CONFIG_SYSROOT_DIR from installed .pc files

Richard Purdie richard.purdie at linuxfoundation.org
Thu Dec 18 12:03:37 UTC 2014


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 at 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





More information about the Openembedded-core mailing list