Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: python@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 1/2] python-utils-r1.eclass: Fix PYTHON_LIBS for py3.8+
Date: Thu, 27 Feb 2020 18:01:06
Message-Id: 20200227180031.188270-1-mgorny@gentoo.org
1 Python 3.8+ provides two pkg-config files: python-3.8 for building
2 Python extensions and python-3.8-embed for embedding Python in other
3 programs. The former no longer lists -lpython*, resulting in empty
4 PYTHON_LIBS. Since our consumers are more likely to want it non-empty
5 if they already query it, switch to the latter file.
6
7 Signed-off-by: Michał Górny <mgorny@g.o>
8 ---
9 eclass/python-utils-r1.eclass | 8 ++++++--
10 1 file changed, 6 insertions(+), 2 deletions(-)
11
12 diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
13 index 91a32434dfaa..afa641fbb7ea 100644
14 --- a/eclass/python-utils-r1.eclass
15 +++ b/eclass/python-utils-r1.eclass
16 @@ -433,10 +433,14 @@ python_export() {
17 local val
18
19 case "${impl}" in
20 - python*)
21 - # python-2.7, python-3.2, etc.
22 + python2*|python3.6|python3.7*)
23 + # python* up to 3.7
24 val=$($(tc-getPKG_CONFIG) --libs ${impl/n/n-}) || die
25 ;;
26 + python*)
27 + # python3.8+
28 + val=$($(tc-getPKG_CONFIG) --libs ${impl/n/n-}-embed) || die
29 + ;;
30 *)
31 die "${impl}: obtaining ${var} not supported"
32 ;;
33 --
34 2.25.1

Replies