Gentoo Archives: gentoo-user

From: Mike Gilbert <floppym@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] ebuild : how to check for python version
Date: Tue, 11 Aug 2020 14:35:47
Message-Id: CAJ0EP41Kgm8z6N3YLPQed3taor_kbywSBKHtWz3SZwahCf69cg@mail.gmail.com
In Reply to: Re: [gentoo-user] ebuild : how to check for python version by Helmut Jarausch
1 On Tue, Aug 11, 2020 at 9:38 AM Helmut Jarausch <jarausch@××××××.be> wrote:
2 >
3 > On 08/11/2020 03:08:16 PM, Mike Gilbert wrote:
4 > > On Sun, Aug 2, 2020 at 10:47 AM Helmut Jarausch
5 > > <_ j_ a_ r_ a_ u_ s_ c_ h_ @_ s_ k_ y_ n_ e_ t_ ._ b_ e> wrote:
6 > > Hi,
7 > > in an ebuild I have to apply a patch only if this package is
8 > > installed
9 > > for python3.9.
10 > > The ebuild should work for PYTHON_COMPAT=( python3_{8,9} )
11 > >
12 > > How can I check for Pythons version in src_prepare or similar
13 > > functions.
14 > >
15 > > Many thanks for a hint,
16 > > Helmut
17 > >
18 > > I would suggest creating a patch that can be applied unconditionally
19 > > instead.
20 > >
21 >
22 > That would imply different function definitions within an 'if / else'
23 > clause.
24 > I don't like this.
25 >
26
27 What will you do when someone wants/needs to install it for both
28 python3.8 and python3.9 simultaneously?
29
30 If you want to support both versions, it's better to have code that
31 actually works with both of them.