Thread: allow meson to find ICU in non-standard localtion

allow meson to find ICU in non-standard localtion

From
Jeff Davis
Date:
I attached a simple patch that allows meson to find ICU in a non-
standard location if if you specify -Dextra_lib_dirs and
-Dextra_include_dirs.

I'm not sure it's the right thing to do though. One downside is that it
doesn't output the version that it finds, it only outputs "YES".

Attachment

Re: allow meson to find ICU in non-standard localtion

From
Nazir Bilal Yavuz
Date:
Hi,

Thanks for the patch.

On Wed, 22 Feb 2023 at 21:26, Jeff Davis <pgsql@j-davis.com> wrote:
>
> I'm not sure it's the right thing to do though. One downside is that it
> doesn't output the version that it finds, it only outputs "YES".

-  icu = dependency('icu-uc', required: icuopt.enabled())
-  icu_i18n = dependency('icu-i18n', required: icuopt.enabled())

I think you can do dependency checks with 'required: false' first and
if they weren't found by dependency checks; then you can do
cc.find_library() checks. This also solves only the outputting "YES"
problem if they were found by dependency checks.

Regards,
Nazir Bilal Yavuz
Microsoft



Re: allow meson to find ICU in non-standard localtion

From
Andres Freund
Date:
Hi,

On 2023-02-22 10:26:23 -0800, Jeff Davis wrote:
> I attached a simple patch that allows meson to find ICU in a non-
> standard location if if you specify -Dextra_lib_dirs and
> -Dextra_include_dirs.

If you tell meson where to find the pkg-config file in those directories it'd
also work. -Dpkg_config_path=...

Does that suffice?

Greetings,

Andres Freund



Re: allow meson to find ICU in non-standard localtion

From
Jeff Davis
Date:
On Sun, 2023-02-26 at 09:57 -0800, Andres Freund wrote:
> If you tell meson where to find the pkg-config file in those
> directories it'd
> also work. -Dpkg_config_path=...

Setup is able to find it, which is good, but it seems like it's not
adding it to RPATH so it's not working.

I think we need some doc updates to clarify which features are affected
by -Dextra_lib_dirs/-Dpkg_config_path.

Regards,
    Jeff Davis




Re: allow meson to find ICU in non-standard localtion

From
Jacob Champion
Date:
On Sun, Feb 26, 2023 at 7:36 PM Jeff Davis <pgsql@j-davis.com> wrote:
>
> On Sun, 2023-02-26 at 09:57 -0800, Andres Freund wrote:
> > If you tell meson where to find the pkg-config file in those
> > directories it'd
> > also work. -Dpkg_config_path=...
>
> Setup is able to find it, which is good, but it seems like it's not
> adding it to RPATH so it's not working.

For my custom OpenSSL setups using -Dpkg_config_path, meson initially
adds the correct RPATH during build, then accidentally(?) strips it
during the `ninja install` step. This has been complained about [1],
and it seems like maybe they intended to fix it back in 0.55, but I'm
not convinced they did. :)

I work around it by manually setting -Dextra_lib_dirs. I just tried
doing that with ICU 72, and it worked without a patch. Hopefully that
helps some?

--Jacob

[1] https://github.com/mesonbuild/meson/issues/6541



Re: allow meson to find ICU in non-standard localtion

From
Jeff Davis
Date:
On Wed, 2023-03-01 at 11:43 -0800, Jacob Champion wrote:
> I work around it by manually setting -Dextra_lib_dirs. I just tried
> doing that with ICU 72, and it worked without a patch. Hopefully that
> helps some?

Yes, works, thank you.

Obviously we'd like a little better solution so that others don't get
confused, but it's not really a problem for me any more.

Also there's the issue that libxml2.so pulls in the system's ICU
regardless. I don't think that causes a major problem, but I thought
I'd mention it.

Regards,
    Jeff Davis




Re: allow meson to find ICU in non-standard localtion

From
Peter Eisentraut
Date:
On 01.03.23 21:30, Jeff Davis wrote:
> On Wed, 2023-03-01 at 11:43 -0800, Jacob Champion wrote:
>> I work around it by manually setting -Dextra_lib_dirs. I just tried
>> doing that with ICU 72, and it worked without a patch. Hopefully that
>> helps some?
> 
> Yes, works, thank you.
> 
> Obviously we'd like a little better solution so that others don't get
> confused, but it's not really a problem for me any more.

So should we withdraw the patch from the commit fest?



Re: allow meson to find ICU in non-standard localtion

From
Jeff Davis
Date:
On Wed, 2023-03-08 at 17:30 +0100, Peter Eisentraut wrote:
> So should we withdraw the patch from the commit fest?

Withdrawn. If someone else is interested we can still pursue some
improvements.

Regards,
    Jeff Davis