Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 581382 - kde5.eclass: expects LINGUAS to be an environment variable
Summary: kde5.eclass: expects LINGUAS to be an environment variable
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] KDE (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-27 16:58 UTC by Thomas Berger
Modified: 2016-05-20 19:49 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
example patch to use linguas (kde5-linguas.patch,1.90 KB, patch)
2016-04-27 17:02 UTC, Thomas Berger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Berger 2016-04-27 16:58:45 UTC
The kde5.eclass itertates over all subfolders of "po/" in the source tree and deletes all translations not found in the variable ${LINGUAS}.

According to the spec for EAPI6 ( or any other EAPI ), this variable is not provided to the ebuild or eclass. It is a USE_EXPAND variable and should be used only this way.

Paludis does not set this variable and forbids to set USE_EXPAND variables as environment variable. 

Reproducible: Always

Steps to Reproduce:
1. install any kde5.eclass based package with paludis/cave
Actual Results:  
no translations are installed even if LINGUAS is set in the global use.conf

Expected Results:  
the translations for the configured linguas should be installed
Comment 1 Michael Palimaka (kensington) gentoo-dev 2016-04-27 17:01:45 UTC
(In reply to Thomas Berger from comment #0)
> According to the spec for EAPI6 ( or any other EAPI ), this variable is not
> provided to the ebuild or eclass. It is a USE_EXPAND variable and should be
> used only this way.

Which section of the spec says this?
Comment 2 Thomas Berger 2016-04-27 17:02:42 UTC
Created attachment 432284 [details, diff]
example patch to use linguas

I attached a hacky patch to use the USE_EXPAND useflags for LINGUAS. As not all packages have translations and the provided linguas must not match for all packages this should be handled with a seperate eclass.
Comment 3 Thomas Berger 2016-04-27 17:03:47 UTC
(In reply to Michael Palimaka (kensington) from comment #1)
> (In reply to Thomas Berger from comment #0)
> > According to the spec for EAPI6 ( or any other EAPI ), this variable is not
> > provided to the ebuild or eclass. It is a USE_EXPAND variable and should be
> > used only this way.
> 
> Which section of the spec says this?

Chapter 11
The Ebuild Environment

11.1 Defined Variables

https://projects.gentoo.org/pms/6/pms.html#x1-11800011.1
Comment 4 Michael Palimaka (kensington) gentoo-dev 2016-04-27 17:07:12 UTC
(In reply to Thomas Berger from comment #3)
> (In reply to Michael Palimaka (kensington) from comment #1)
> > (In reply to Thomas Berger from comment #0)
> > > According to the spec for EAPI6 ( or any other EAPI ), this variable is not
> > > provided to the ebuild or eclass. It is a USE_EXPAND variable and should be
> > > used only this way.
> > 
> > Which section of the spec says this?
> 
> Chapter 11
> The Ebuild Environment
> 
> 11.1 Defined Variables
> 
> https://projects.gentoo.org/pms/6/pms.html#x1-11800011.1

That only lists variables that must be defined by the package manager. It doesn't say we can't operate on other environment variables, and indeed I believe many autotools packages behave in the same way that is happening here.
Comment 5 Thomas Berger 2016-04-27 17:13:22 UTC
(In reply to Michael Palimaka (kensington) from comment #4)
> That only lists variables that must be defined by the package manager. It
> doesn't say we can't operate on other environment variables, and indeed I
> believe many autotools packages behave in the same way that is happening
> here.

LINGUAS is not defined in the "make.defaults" file of the most profiles. If a package manger is written according to the specs LINGUAS must be exported in the "embedded" profile, but there is no requirement in the specs for others.

Except where otherwise noted, all variables set in the active profiles’ make.defaults files must be exported to the ebuild environment."

The variable MAY be there. Either the spec or the ebuilds/eclasses need to be fixed.
Comment 6 Mike Gilbert gentoo-dev 2016-04-27 17:35:42 UTC
(In reply to Michael Palimaka (kensington) from comment #4)
> I believe many autotools packages behave in the same way that is happening
> here.

Packages that use the gettext autotools macros (/usr/share/aclocal/po.m4) behave slightly differently than kde5.eclass:

If LINGUAS is set in the environment, it acts as a filter on which translations get installed.

If LINUGAS is unset, all translations are installed.

I think the practical result is that paludis ends up installing all translations for autotools projects, whereas portage would export LINUGUAS and only install a subset.

Anyway, it would definitely be good to clarify what the PM behavior should be here.
Comment 7 Michael Palimaka (kensington) gentoo-dev 2016-04-27 18:15:22 UTC
(In reply to Thomas Berger from comment #5)
> (In reply to Michael Palimaka (kensington) from comment #4)
> > That only lists variables that must be defined by the package manager. It
> > doesn't say we can't operate on other environment variables, and indeed I
> > believe many autotools packages behave in the same way that is happening
> > here.
> 
> LINGUAS is not defined in the "make.defaults" file of the most profiles. If
> a package manger is written according to the specs LINGUAS must be exported
> in the "embedded" profile, but there is no requirement in the specs for
> others.
> 
> Except where otherwise noted, all variables set in the active profiles’
> make.defaults files must be exported to the ebuild environment."
> 
> The variable MAY be there. Either the spec or the ebuilds/eclasses need to
> be fixed.

As I said previously, I am not aware of any section of PMS that restricts us from performing some operation based on the contents of an arbitrary variable. 11.1 provides a list of what *must* be defined, not a restriction on what we can use.
Comment 8 Michael Palimaka (kensington) gentoo-dev 2016-04-27 18:18:07 UTC
(In reply to Mike Gilbert from comment #6)
> (In reply to Michael Palimaka (kensington) from comment #4)
> > I believe many autotools packages behave in the same way that is happening
> > here.
> 
> Packages that use the gettext autotools macros (/usr/share/aclocal/po.m4)
> behave slightly differently than kde5.eclass:
> 
> If LINGUAS is set in the environment, it acts as a filter on which
> translations get installed.
> 
> If LINUGAS is unset, all translations are installed.

We can tweak kde5.eclass to behave this way.
Comment 9 Michael Palimaka (kensington) gentoo-dev 2016-04-27 18:50:57 UTC
Pushed a fix to the overlay to install all translations when LINGUAS is undefined.

https://gitweb.gentoo.org/proj/kde.git/commit/?id=0510e917c31b3097087f08d4932c8347ee1efaf9
Comment 10 Thomas Berger 2016-04-28 10:16:52 UTC
(In reply to Michael Palimaka (kensington) from comment #7)
> As I said previously, I am not aware of any section of PMS that restricts us
> from performing some operation based on the contents of an arbitrary
> variable. 11.1 provides a list of what *must* be defined, not a restriction
> on what we can use.

You can use every variable you want. But you could not expect that every package manager provides this variable.
Comment 11 Thomas Berger 2016-05-03 15:32:39 UTC
See also, my bugreport at the paludis project:

http://paludis.exherbo.org/trac/ticket/1343#comment:1
Comment 12 Johannes Huber (RETIRED) gentoo-dev 2016-05-05 19:08:17 UTC
(In reply to Thomas Berger from comment #11)
> See also, my bugreport at the paludis project:
> 
> http://paludis.exherbo.org/trac/ticket/1343#comment:1

exherbo...
Comment 13 Thomas Berger 2016-05-06 07:58:47 UTC
(In reply to Johannes Huber from comment #12)
> exherbo...

As clarified in bug 582140 the behavior of the eclass is a QA violation and does only work because of a bug in portage.
Comment 14 Johannes Huber (RETIRED) gentoo-dev 2016-05-20 19:49:44 UTC
Thanks. I have pushed the patch from Michael.

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