On Mon, 1 Feb 2021 22:14:31 -0800 (PST) Andriy Byelikov wrote:
AB> Okay, after tinkering around for a while here's the follow-up.
AB>
AB> Locale .mo files suffix issue:
AB> ------------------------------
AB>
AB> I have created a patch for the 3.1.4 release, but I'm not sure if this is
AB> all that needs to be done for programs to detect the .mo filles with the
AB> suffix.
I think the change to wxTranslations::AddStdCatalog() should indeed do it,
but we can't stop looking for wxstd.mo without suffix, as it still won't
have it on other systems. So the simplest (and also the slowest, but I'm
not sure if we really care about this) would be to try both versions, first
the one with the version suffix and then, if it failed, the one without it.
AB> What I did is to try to find all references to the "wxstd" catalog
AB> file and to add the release suffix, but I did not find any references to
AB> "wxmsw.mo" files.
There is just a single such file, for Italian, and it has just one
significant commit 4d931bcca0 (Translate '&Help' to '&' for italian Windows
only, 2005-08-12) adding just a single translation. I think we should just
get rid of it, it seemed like a good idea to allow for platform-specific
translations back then, but the fact that it has never been used again
since 15+ years seems to convincingly show that actually it wasn't.
AB> For the installation of these files, I modified the
AB> "wx.bkl" bakefile adding the release suffix to the catalog files the and
AB> regenerating the "Makefile.in". It made some more changes than what I
AB> expected (replacing "dll" with "lib" in some places)
You need to use the latest bakefile 0.2 version to regenerate these files.
But I can do it myself before merging.
AB> Here's the patch:
AB>
AB>
https://pastebin.com/FNK2ZtDq
Thanks! If possible, please create pull requests on GitHub, it's simpler
to discuss/annotate things there rather than on pastebin.
AB> I tried to test these changes by compiling the internat sample with the
AB> new patched package that I built with the 3.1.4 release as the source.
AB> I tried to run internat selecting the French locale and it seems to work.
AB> But that is only representative if it actually uses the "
wxstd-3.1.mo"
AB> file. If someone who knows better about how the "wxstd.mo" catalogs are
AB> used could test it it would be great.
Yes, it does load wxstd catalog:
https://github.com/wxWidgets/wxWidgets/blob/v3.1.4/samples/internat/internat.cpp#L263
AB> "wx-config" and "wxrc" issue:
AB> -----------------------------
AB>
AB> For "wx-config" and "wxrc" the simple solution is to add a "-3.1" suffix
AB> to the filenames.
AB>
AB> This is trivial for "wxrc" since it is agnostic of whether the build was
AB> configured with GTK 2 or 3, so it would simply be installed as "wxrc-3.1".
AB>
AB> For "wx-config" this is a bit more complicated since it is a link to
AB> "/usr/lib/wx/config/gtk3-unicode-3.1" or something similar, depending on
AB> the configuration it was built with. The contents of also differ depending
AB> on the configuration with which it was build.
AB>
AB> The Arch Linux packages currently offer either a GTK2 or GTK3
AB> configuration, installing as most things as possible (at least as I
AB> understand it).
AB>
AB> Here's the PKGBUILD script:
AB>
AB>
https://github.com/archlinux/svntogit-packages/blob/packages/wxgtk/trunk/PKGBUILD
AB>
AB> It links "wx-config" with the GTK2 "wx-config". This may actually be just
AB> Linux specific dilemma as on Windows and MacOS you would just have one
AB> "wxmsw" or "wxmac" flavor respectively and "wx-config" would links to one
AB> flavor. On Linux, on the other hand you have two GTK flavors. The person
AB> who wrote the script probably choose to link to GTK2 since it was more
AB> widely used at the time, and created a "wx-config-gtk3" link for a GTK3
AB> configuration, but perhaps nowadays the reverse would be more appropiate.
Yes, definitely. And normally the idea is, again, to have just a single
wx-config dispatching to multiple wx versions via its command line options,
i.e. you should be able to install both wxGTK2 and wxGTK3 (and even wxMSW
for cross-compiling) and then use "wx-config --toolkit=gtk2" or whatever to
select the toolkit you want.
The complication is that the last installed version becomes the default
one, which means that there is still a conflict. I don't know if there is a
similar mechanism in Arch, but in Debian, from the purely packaging
perspective, I'd install our "real" wx-config with a version suffix and use
the alternatives mechanism to select what the actual wx-config should point
it. AFAICS what you propose is not very far from this, so it looks good to
me and, anyhow, as you say, it's only something you need to do in Arch and
doesn't really require anything from us, which is even nicer :-)
AB> Other issues:
AB> -------------
AB>
AB> - /usr/local/share/aclocal/wxwin.m4
AB> - /usr/local/share/bakefile/presets/wx.bkl
AB> - /usr/local/share/bakefile/presets/wx_win32.bkl
AB> - /usr/local/share/bakefile/presets/wx_xrc.bkl
AB>
AB> I'm not really sure what these files are for. I think the bkl files are
AB> like bakefile templates to build applications and you mentioned that we
AB> can just stop installing them.
Yes, AFAIK nobody uses them (if anybody here does use them, please let me
know!).
AB> Is the same true for "wxwin.m4"?
No, this one is used by many projects using autoconf for detecting wx, it
definitely must be installed.
AB> Lastly, a recap of upsteam changes I'm proposing:
AB>
AB> - Fix the locale implementation to read and install with release suffix
AB> - Remove "wxwin.m4" and the presets bakefiles from the Makefile
AB> installation recipe
The locale patch looks almost good, I'll try to check if we can get rid
of msw/it.po completely (but I think we can), so the only thing to change
is to try loading both the versioned and unversioned catalog during the
run-time. We still need some solution for wxwin.m4 however.
Thanks a lot for looking at this and I hope we can make it work in time
for 3.1.5 release!