[Buildroot] [PATCH 1/1] package/gobject-introspection: fix host version of .pc file for wrapper

Nicolas Cavallari nicolas.cavallari at green-communications.fr
Sun May 3 17:10:36 UTC 2020


On 03/05/2020 13:48, Thomas Petazzoni wrote:
> Hello James,
> 
> On Sat, 2 May 2020 13:36:04 -0600
> James Hilliard <james.hilliard1 at gmail.com> wrote:
> 
>>>> +define HOST_GOBJECT_INTROSPECTION_INSTALL_WRAPPERS
>>>> +     # Set prefix to /usr because pkg-config appends the sysroot directory
>>>> +     $(SED) "s%^prefix=.*%prefix=\/usr%g" \
>>>> +             $(HOST_DIR)/usr/lib/pkgconfig/gobject-introspection-1.0.pc  
>>>
>>> No, the host variant of pkg-config should not append the sysroot
>>> directory. If it does, then it is wrong.  
>> Well this was when building the target package that uses the host
>> pkgconfig libdir.
> 
> And? According to 4e0bc29993376613d200e892d491e31ea5a49622, Meson has
> some understanding of when it is using pkg-config to find libraries to
> build native code or to build target code.
> 
> As you can see in this commit:
> 
> -pkgconfig = '@HOST_DIR@/usr/bin/pkg-config'
> +pkgconfig = '@HOST_DIR@/bin/pkgconf'
> 
> Meson is no longer going through our pkg-config wrapper that passes the
> right environment variables to ensure pkg-config returns values valid
> for building target code.
> 
> Since Meson goes through $(HOST_DIR)/bin/pkgconf directly, we do not
> pass any specific sysroot argument to pkg-config. It is up to Meson to
> pass the appropriate sysroot value when working with target code, and
> to not pass any sysroot value when working on native code.

Look at the logs i posted in this thread. meson uses the 'pkgconfig' in
the cross-file only when finding target libraries. It does not use it
when finding native libraries.

Instead, for native libraries, it expects a native-file, which we don't
provide. As a fallback, it searches for $PKG_CONFIG_FOR_BUILD,
$PKG_CONFIG, or for a 'pkg-config' in $PATH. And we have a pkg-config in
$PATH, it is the target pkgconf wrapper.

The fix in 4e0bc29993376613d200e892d491e31ea5a49622 does not work.
Meson still uses the pkg-config wrapper when working with native code.



More information about the buildroot mailing list