Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 712792 - x11-misc/xkeyboard-config: use python-any-r1
Summary: x11-misc/xkeyboard-config: use python-any-r1
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-16 08:47 UTC by Benda Xu
Modified: 2020-03-19 22:30 UTC (History)
0 users

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


Attachments
xkeyboard-config.patch (xkeyboard-config.patch,2.97 KB, patch)
2020-03-16 08:49 UTC, Benda Xu
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benda Xu gentoo-dev 2020-03-16 08:47:05 UTC
In Gentoo Prefix, the host may not have python3 installed.  Use
python-any-r1 to ensure python is installed and patch the shebangs of
the python scripts.

Reproducible: Always
Comment 1 Benda Xu gentoo-dev 2020-03-16 08:49:56 UTC
Created attachment 620102 [details, diff]
xkeyboard-config.patch

Hi X11 Team, I intend to commit the attached patch, mainly for Gentoo Prefix.  The build system uses python in several of its helper scripts, therefore python-any-r1 is inherited.  What do you think?
Comment 2 Matt Turner gentoo-dev 2020-03-16 17:48:36 UTC
Thanks!

Please add python 3.7 and 3.8 to PYTHON_COMPAT.

I don't see any other packages in tree that seem to be doing this sort of replacement of /usr/bin/env ... with ${EPYTHON}. Why is this necessary for xkeyboard-config?
Comment 3 Matt Turner gentoo-dev 2020-03-16 17:50:08 UTC
(In reply to Matt Turner from comment #2)
> I don't see any other packages in tree that seem to be doing this sort of
> replacement of /usr/bin/env ... with ${EPYTHON}. Why is this necessary for
> xkeyboard-config?

To be clear: I want to understand this before the patch is committed.
Comment 4 Benda Xu gentoo-dev 2020-03-16 23:57:45 UTC
(In reply to Matt Turner from comment #2)
> Thanks!
> 
> Please add python 3.7 and 3.8 to PYTHON_COMPAT.

Sure.

> I don't see any other packages in tree that seem to be doing this sort of
> replacement of /usr/bin/env ... with ${EPYTHON}. Why is this necessary for
> xkeyboard-config?

On a Prefix for example (EPREFIX=/opt/gentoo), it is possible that the host does not have /usr/bin/python3.  We need to let .py scripts to point to /opt/gentoo/usr/bin/python3.  `/usr/bin/env ${EPYTHON}` alternatively does the same thing.
Comment 5 Matt Turner gentoo-dev 2020-03-17 03:24:42 UTC
Sure, that makes sense. But why don't I see a bunch of existing cases of this in the tree?
Comment 6 Benda Xu gentoo-dev 2020-03-17 04:29:09 UTC
(In reply to Matt Turner from comment #5)
> Sure, that makes sense. But why don't I see a bunch of existing cases of
> this in the tree?

I am not sure.  Probably because almost all host have Python 3 installed.
Comment 7 Larry the Git Cow gentoo-dev 2020-03-17 07:22:15 UTC
The bug has been referenced in the following commit(s):

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

commit 9ab49193d9e8645eeaa98aa14b5ecd79084bc964
Author:     Matt Turner <mattst88@gentoo.org>
AuthorDate: 2020-03-17 07:19:02 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2020-03-17 07:21:53 +0000

    x11-misc/xkeyboard-config: Fix shebang
    
    Bug: https://bugs.gentoo.org/712792
    Signed-off-by: Matt Turner <mattst88@gentoo.org>

 ...xkeyboard-config-2.29-fix-python3-support.patch | 34 ++++++++++++++++++++++
 .../xkeyboard-config/xkeyboard-config-2.29.ebuild  |  4 +++
 2 files changed, 38 insertions(+)
Comment 8 Matt Turner gentoo-dev 2020-03-17 07:23:55 UTC
Arfrever helped identify the likely cause of your problem: a /usr/bin/python3 shebang (whereas the other python script had /usr/bin/env python3).

I expect the patch I committed (from upstream) fixes the problem for you. Can you confirm?
Comment 9 Matt Turner gentoo-dev 2020-03-17 07:33:37 UTC
By the way, your patch didn't apply. Not sure how you generated it. Use git format-patch next time.

Also, it should have BDEPEND="${PYTHON_DEPS}". I wouldn't bother revbumping 2.29.
Comment 10 Benda Xu gentoo-dev 2020-03-17 08:18:35 UTC
(In reply to Larry the Git Cow from comment #7)
> The bug has been referenced in the following commit(s):
> 
> https://gitweb.gentoo.org/repo/gentoo.git/commit/
> ?id=9ab49193d9e8645eeaa98aa14b5ecd79084bc964
> 
> commit 9ab49193d9e8645eeaa98aa14b5ecd79084bc964
> Author:     Matt Turner <mattst88@gentoo.org>
> AuthorDate: 2020-03-17 07:19:02 +0000
> Commit:     Matt Turner <mattst88@gentoo.org>
> CommitDate: 2020-03-17 07:21:53 +0000
> 
>     x11-misc/xkeyboard-config: Fix shebang
>     
>     Bug: https://bugs.gentoo.org/712792
>     Signed-off-by: Matt Turner <mattst88@gentoo.org>
> 
>  ...xkeyboard-config-2.29-fix-python3-support.patch | 34
> ++++++++++++++++++++++
>  .../xkeyboard-config/xkeyboard-config-2.29.ebuild  |  4 +++
>  2 files changed, 38 insertions(+)

I think that will definitely fix this bug!  Thanks.
Comment 11 Benda Xu gentoo-dev 2020-03-17 08:22:11 UTC
(In reply to Matt Turner from comment #9)
> By the way, your patch didn't apply. Not sure how you generated it. Use git
> format-patch next time.

I used `git show > x.patch`. Maybe my tree is not new enough.

> 
> Also, it should have BDEPEND="${PYTHON_DEPS}". I wouldn't bother revbumping
> 2.29.

I used python-any-r1 just for the sake of correctness, as quoting from the eclass inline doc: "A minimal eclass for packages which need any Python interpreter installed without a need for explicit choice and invariability". 

But as long as it compiles with the shabeng fix, it is of low priority.
Comment 12 Larry the Git Cow gentoo-dev 2020-03-19 22:30:52 UTC
The bug has been closed via the following commit(s):

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

commit 9500cb315bbe6705f796aa7454d76e0eef020002
Author:     Benda Xu <heroxbd@gentoo.org>
AuthorDate: 2020-03-19 22:13:03 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2020-03-19 22:30:43 +0000

    x11-misc/xkeyboard-config: Use python-any-r1
    
    Closes: https://bugs.gentoo.org/712792
    Signed-off-by: Benda Xu <heroxbd@gentoo.org>
    Signed-off-by: Matt Turner <mattst88@gentoo.org>

 x11-misc/xkeyboard-config/xkeyboard-config-2.29.ebuild | 7 +++++++
 x11-misc/xkeyboard-config/xkeyboard-config-9999.ebuild | 7 +++++++
 2 files changed, 14 insertions(+)