bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cygwin Package gettext 0.22


From: Brian Inglis
Subject: Re: Cygwin Package gettext 0.22
Date: Fri, 23 Jun 2023 19:20:59 -0600
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0

On 2023-06-23 11:00, Bruno Haible wrote:
Attached are the latest Cygwin patches applied to the "native" Cygwin build of
the latest gettext.
It would be nice if you could ever find some time to consider these, and apply
or make these (or equivalent changes) part of your sources.

... and for those that I don't consider, I will tell you why I find that they
are bad ideas. :)

Cygwin has dropped some Windows compatibility, unsupported Windows versions, and
32 bit support, while still providing as much Windows interoperability as
possible

Understood.

Hi Bruno,

Also below just trying to explain why something may have happened based on the log and commitdiffs, as I adopted the package after five years without updates, as other packages I maintained needed it updated; for history see:

        https://cygwin.com/git/?p=git/cygwin-packages/gettext.git

gettext-0.22-gettext-tools-gnulib-lib-localename-c.patch
gettext-0.22-gettext-runtime-intl-gnulib-lib-localename-c.patch
gettext-0.22-gettext-runtime-gnulib-lib-localename-c.patch
The code that you are disabling does the following:
   * When the user has set their language preferences in the Windows Control
     Panel,
     and in Cygwin they do not set any of the environment variables LC_ALL, 
LC_*,
     LANG,
     and the program calls setlocale(LC_ALL,"") — which is what most
     internationalized programs do —,
     then localename.c would use the language preferences from the Windows
     panel.
     POSIX allows this.
Isn't that what the user wants? Why do you disable it?

Cygwin now translates the Windows locale (and tz) into default POSIX locale (and tz) which .profile then exports in the environment for external consumption using:

        export LANG=$(locale -uU)
and
        export TZ=$(/usr/bin/tzset)

e.g. for me:

        $ echo $LANG $TZ
        en_CA.UTF-8 America/Edmonton
        $ locale -uU
        en_GB.UTF-8

but I override giving:

        $ locale
        LANG=en_CA.UTF-8
        LC_CTYPE="en_CA.UTF-8"
        LC_NUMERIC="en_CA.UTF-8"
        LC_TIME="en_CA.UTF-8"
        LC_COLLATE="en_CA.UTF-8"
        LC_MONETARY="en_CA.UTF-8"
        LC_MESSAGES="en_CA.UTF-8"
        LC_ALL=


$ for o in s u i f; do for u in '' '-U' '-n'; do
        oo="-$o $u"; echo -n locale $oo$'\t'; locale $oo;
  done; done # system, user, input, regional format; UTF-8, non-unicode
locale -s       en_US
locale -s -U    en_US.UTF-8
locale -s -n    en_CA
locale -u       en_GB
locale -u -U    en_GB.UTF-8
locale -u -n    en_CA
locale -i       en_CA
locale -i -U    en_CA.UTF-8
locale -i -n    en_CA
locale -f       en_CA
locale -f -U    en_CA.UTF-8
locale -f -n    en_CA

For doc see:

https://cygwin.com/git/?p=newlib-cygwin.git;a=blob;f=winsup/utils/locale.cc

   * Support for per-thread locales.
     The unit tests gettext-tools/system-tests/intl-thread-[123] probably fail
     with your patches. No?

Yes and also plurals-... I will try rebuilding without this patch.
Often these are a result of either what is done in Fedora.spec recipes, used as a model for initial Cygwin cygport builds, or pragmatic changes to get things to build and/or run in a particular release.
These are often left alone as long as they run as there are few docs.

Any idea what the ll language code represented, can not find it anywhere, and why it might be changed to es - glibc variant?

   * Ignoring a dummy value of LANG, set in ~/.profile.
     Why should a user explicitly have to *remove* some statements that Cygwin
     installer has put there, in order to get internationalization working?

See above - it is automatically set and exported.

gettext-tests-cygwin.patch

These changes indicate some bugs, introduced in localename.c (above).

gettext-0.22-no-woe32dll-m4-woe32-dll-m4.patch
gettext-0.22-no-woe32dll-gettext-tools-configure-ac.patch

I use the reliable way of building shared libraries on Windows. See my writeup
at https://haible.de/bruno/woe32dll.html and the file gettext/m4/woe32-dll.m4 .

If you decide to activate another, less reliable, way of building Cygwin
binaries, that's your responsibility.

It appears that approach was droppind for 18.1 but no notes except comment about autoimport - perhaps that was dropped to allow control of visibility of symbols within the DLLs? Cygwin is *NOT* Windows, certainly since amd64/x86_64 arch builds were added, and the cygport build system uses autotools with libtool to build libraries using gcc --shared, with some naming tweaks e.g. cygintl-8.dll, in a standard manner on both arches, and avoids conflicts with native Windows Mingw64 and Msys2 builds, which are also supported by and under Cygwin, but both Cygwin and Mingw64 cross-builds are also supported under Fedora, which can not use any native Win32 approaches.

gettext-0.21.1-autopoint-V.patch

I decided to not enable this code, in 2002, because it is dangerous.

There appear to have been some issues with autopoint, gettextise, and libtool conflicting behaviour.

The documentation
https://www.gnu.org/software/gettext/manual/html_node/autopoint-Invocation.html
explains how the 'autopoint' program is meant to be used. I don't see the
point of adding an option to make it work differently.

I think there may be issues with other non-GNU upstreams (invisible-island.net) where their packages depend on custom frozen earlier versions of autotools components, and the cygport build maintainers wanted to avoid custom patches, as at one point they supported about 3k packages!
Also remember NTP required specific frozen earlier autotools versions.

gettext-0.21.1-cygwin-ftm.patch

It could be that this one is useful. Can you point me to the original report,
please?

https://cygwin.com/git/?p=git/cygwin-packages/gettext.git;a=commitdiff;h=51f84616d86fe906f1eeae7f298eb11a7fba633d

Some maintainers were and are RedHat volunteers who used Fedora (perhaps only at home), also as a reference, and seemed to be professionally involved with POSIX and feature test macros.

gettext-0.22-disable-libtextstyle.patch

No comment.
Adopted from Fedora:

        https://src.fedoraproject.org/rpms/gettext/tree/main

which now has the same patch updated, and from which also the Cygwin gettext-devel package includes msghack.{py,1}.

We also keep an eye on Debian and OpenSuSE for useful patches to apply.

--
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                -- Antoine de Saint-Exupéry



reply via email to

[Prev in Thread] Current Thread [Next in Thread]