Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 618624

Summary: x11-libs/wxGTK-3.0.2.0-r301:3.0-gtk3 installs misnamed files of translations
Product: Gentoo Linux Reporter: Arfrever Frehtes Taifersar Arahesis <arfrever.fta>
Component: Current packagesAssignee: Gentoo wxWidgets project <wxwidgets>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=650118
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 618642    

Description Arfrever Frehtes Taifersar Arahesis 2017-05-16 08:25:21 UTC
x11-libs/wxGTK-3.0.2.0-r3:3 (GTK+ 2 version) installs files of translations with .mo suffix. Examples:
/usr/share/locale/fr/LC_MESSAGES/wxstd30.mo
/usr/share/locale/it/LC_MESSAGES/wxstd30.mo
/usr/share/locale/pl/LC_MESSAGES/wxstd30.mo


x11-libs/wxGTK-3.0.2.0-r301:3.0-gtk3 (GTK+ 3 version) installs files of translations without .mo suffix. Examples:
/usr/share/locale/fr/LC_MESSAGES/wxstd30-gtk3
/usr/share/locale/it/LC_MESSAGES/wxmsw30-gtk3
/usr/share/locale/it/LC_MESSAGES/wxstd30-gtk3
/usr/share/locale/pl/LC_MESSAGES/wxstd30-gtk3


Files without .mo suffix are obviously not used at run-time by libc functions such as gettext() and dgettext().


These broken names of files are caused by partially broken call to sed in ebuild:
    sed -i \
        -e "s:\(WX_RELEASE = \).*:\1${WXRELEASE}:"\
        -e "s:\(WX_RELEASE_NODOT = \).*:\1${WXRELEASE_NODOT}:"\
        -e "s:\(WX_VERSION = \).*:\1${WXVERSION}:"\
        -e "s:aclocal):aclocal/wxwin${WXRELEASE_NODOT}.m4):" \
->      -e "s:wxstd.mo:wxstd${WXRELEASE_NODOT}:" \
->      -e "s:wxmsw.mo:wxmsw${WXRELEASE_NODOT}:" \
        Makefile.in || die


When x11-libs/wxGTK:3 (GTK+ 2 version) is installed, then currently its translations would happen to by used at run-time by x11-libs/wxGTK:3.0-gtk3 (GTK+ 3 version), so problem would be hidden.


Run-time usage of files of translations renamed to e.g. wxstd30-gtk3.mo would require changing of domain name from "wxstd30" to "wxstd30-gtk3" in source code.


Files installed by x11-libs/wxGTK-3.0.2.0-r3:3 (GTK+ 2 version) and x11-libs/wxGTK-3.0.2.0-r301:3.0-gtk3 (GTK+ 3 version) are identical, so there is some waste of disk space.


I think that the optimal fix is to introduce x11-libs/wxGTK-common package which would install files of translations (and maybe some other files) and to make relevant slots of x11-libs/wxGTK depend on x11-libs/wxGTK-common.
Comment 1 kuzetsa CatSwarm (kuza for short) 2017-12-21 22:41:22 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #0)
> x11-libs/wxGTK-3.0.2.0-r3:3 (GTK+ 2 version) installs files of translations
> with .mo suffix. Examples:
> 
---
> 
> x11-libs/wxGTK-3.0.2.0-r301:3.0-gtk3 (GTK+ 3 version) installs files of
> 
---
> 
> Files without .mo suffix are obviously not used at run-time by libc
> functions such as gettext() and dgettext().
> 
---
> 
> When x11-libs/wxGTK:3 (GTK+ 2 version) is installed, then currently its
> translations would happen to by used at run-time by x11-libs/wxGTK:3.0-gtk3
> (GTK+ 3 version), so problem would be hidden.
> 
---
> 
> I think that the optimal fix is to introduce x11-libs/wxGTK-common package
> which would install files of translations (and maybe some other files) and
> to make relevant slots of x11-libs/wxGTK depend on x11-libs/wxGTK-common.

The still-in-progress 3.0.3.1 bump still has this flaw too.

I agree, partly: if the gtk2 / gtk3 version are both able to use the
same version of (correctly named) .mo translations, it could work.

I have a personal aversion to debugging complicated inline sed
expressions, but fixing that mess would NOT require a new package.

I haven't looked into what would be required for your suggested fix:
x11-libs/wxGTK-common (which doesn't exist yet)

I don't know how optimal either fix would be.

Your documentation of this bug is good. Thanks for the report.
Comment 2 Mart Raudsepp gentoo-dev 2018-01-04 03:07:03 UTC
It tries to load wxstd.mo right now, as translations.cpp patch is missing too (for SLOT=3.0 found inside the *collision.patch). I don't think a wx-common for this is needed, as those worrying about space, would be using localepurge or something already. Then the double space cost is only for their kept languages.
Basically the extra maintenance overhead and wrangling bakefile based build system to play nice with a split package isn't really worth it. Ideally we'll settle on one slot soon anyways (well, until 3.2-gtk4 slot comes along or something).

Fixes to properly install and use wxstd30-gtk30.mo will be pushed soon, after I test a huge patchset with unreleased backports, and all the other fixes I'm doing. Hopefully within 20h now finally.
Comment 3 Larry the Git Cow gentoo-dev 2018-01-04 17:18:40 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ca64147aee7b81492dcf304a919938630672b0d5

commit ca64147aee7b81492dcf304a919938630672b0d5
Author:     Mart Raudsepp <leio@gentoo.org>
AuthorDate: 2018-01-04 03:07:57 +0000
Commit:     Mart Raudsepp <leio@gentoo.org>
CommitDate: 2018-01-04 17:18:10 +0000

    x11-libs/wxGTK: fix translation installation and usage for SLOT=3.0-gtk3
    
    Properly sed the .mo versioning and patch wxTranslations::AddStdCatalog
    to use the slotted translation domain.
    
    Closes: https://bugs.gentoo.org/618624
    Package-Manager: Portage-2.3.19, Repoman-2.3.6

 .../wxGTK/files/wxGTK-3.0-gtk3-translation-domain.patch     | 13 +++++++++++++
 x11-libs/wxGTK/wxGTK-3.0.3-r300.ebuild                      |  8 ++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)
Comment 4 Arfrever Frehtes Taifersar Arahesis 2018-03-10 02:28:28 UTC
wxGTK-3.0-gtk3-translation-domain.patch sets wxstd30-gtk3 domain which handles wxstd30-gtk3.mo files, but there is still one wxmsw30-gtk3.mo file installed only for Italian locale:
/usr/share/locale/it/LC_MESSAGES/wxmsw30-gtk3.mo

This file contains only 1 seemingly useless message, so maybe this file should not be installed at all:


$ msgunfmt /usr/share/locale/it/LC_MESSAGES/wxmsw30-gtk3.mo
msgid ""
msgstr ""
"Project-Id-Version: wxWidgets 3.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2006-10-29 14:59+0100\n"
"PO-Revision-Date: 2005-08-12 14:23:42+0100\n"
"Last-Translator: Mike Wetherell <mike.wetherell@ntlworld.com>\n"
"Language-Team: wxWidgets translators <wx-translators@lists.wxwidgets.org>\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"

msgid "&Help"
msgstr "&?"
Comment 5 Mart Raudsepp gentoo-dev 2018-03-10 08:20:56 UTC
please file a new bug instead, the one described here originally is fixed
Comment 6 Mart Raudsepp gentoo-dev 2018-03-10 08:23:19 UTC
That file is already removed in SLOT=3.0 I think, and the removal had gotten lost for SLOT=3.0-gtk3. But yeah, file a new bug and there's a 3.0.4 bump to do, which could include some changes after checking upstream build system isn't fixed about it.