ovalhub/pyicu

Please use pkg-config to detect icu

hughmcmaster opened this issue · 19 comments

icu-config has been deprecated by its upstream developers for some years now. In icu 63.1, icu-config is optional to install, but installed by default. In the next version, icu-config will no longer be installed by default.

The developers recommend downstream packages use pkg-config to detect the icu libraries.

Please let me know if you need any help with this change.

If you are familiar with autoconf, read https://autotools.io/pkgconfig/pkg_check_modules.html for a good overview of pkg-config.

To use pkg-config with Python, I highly recommend https://github.com/matze/pkgconfig, as its syntax is basically the same as the autoconf macro. This webpage also has some nice examples of calls. (This module is available from https://pypi.org/project/pkgconfig/).

To get started, use pkgconfig.exists('icu-i18n'), pkgconfig.cflags('icu-i18n') and pkgconfig.libs('icu-i18n').

You could also use icu-uc if internationalization is not important (see http://userguide.icu-project.org/howtouseicu).

No problem. pkg-config isn't pre-installed on any operating system, even Linux.

I'm happy to create a patch for you. Just let me know.

Yes. Think of pkg-config as another build-dependency (like a library you might link with).

Distributions such as Debian or Ubuntu will automatically install pkg-config as a required dependency, so users don't need to worry about that. pkg-config is also easily installed on macOS and Windows. Users on those platforms will be familiar with the steps to do that.

Ultimately, though, this decision is yours.

ziima commented

Hi @ovalhub: Although pyicu has packages as part of distributions, it doesn't help in cases we need to use virtualenv. Until now, it just worked, but since icu-config was removed, I don't quite see an easy way out.

ziima commented

In debian it was removed lately, with libicu-dev 61-63, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=920900 that's how I got to this issue.

Currently I lack an alternative way to install pyicu to virtualenv without the icu-config.

wfdd commented

Can't pkg-config be used with an env var fallback?

ziima commented

Thanks for the fix. We tested it and it works both with icu-config and with pkg-config (without icu-config).

fixed by invoking pkg-config like is done for icu-config

ziima commented

Can we expect a new release with the fix?