python-utils-r1.eclass: Fix PYTHON_LIBS for py3.8+
authorMichał Górny <mgorny@gentoo.org>
Thu, 27 Feb 2020 17:56:55 +0000 (18:56 +0100)
committerMichał Górny <mgorny@gentoo.org>
Sun, 19 Apr 2020 16:46:59 +0000 (18:46 +0200)
Python 3.8+ provides two pkg-config files: python-3.8 for building
Python extensions and python-3.8-embed for embedding Python in other
programs.  The former no longer lists -lpython*, resulting in empty
PYTHON_LIBS.  Since our consumers are more likely to want it non-empty
if they already query it, switch to the latter file.

Closes: https://bugs.gentoo.org/718344
Signed-off-by: Michał Górny <mgorny@gentoo.org>
eclass/python-utils-r1.eclass

index c72dad7ae3615b4906c216fa6462c78c1d120aa8..e85aefda792a3027bdfc43fb27bf5bf1ce35e92b 100644 (file)
@@ -341,10 +341,14 @@ _python_export() {
                                local val
 
                                case "${impl}" in
-                                       python*)
-                                               # python-2.7, python-3.2, etc.
+                                       python2*|python3.6|python3.7*)
+                                               # python* up to 3.7
                                                val=$($(tc-getPKG_CONFIG) --libs ${impl/n/n-}) || die
                                                ;;
+                                       python*)
+                                               # python3.8+
+                                               val=$($(tc-getPKG_CONFIG) --libs ${impl/n/n-}-embed) || die
+                                               ;;
                                        *)
                                                die "${impl}: obtaining ${var} not supported"
                                                ;;