public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 1/2] python-utils-r1.eclass: Fix PYTHON_LIBS for py3.8+
@ 2020-02-27 18:00 Michał Górny
  2020-02-27 18:00 ` [gentoo-dev] [PATCH 2/2] eclass/tests/python-utils-r1.sh: Add tests for py3.8 Michał Górny
  0 siblings, 1 reply; 2+ messages in thread
From: Michał Górny @ 2020-02-27 18:00 UTC (permalink / raw
  To: gentoo-dev; +Cc: python, Michał Górny

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.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/python-utils-r1.eclass | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 91a32434dfaa..afa641fbb7ea 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -433,10 +433,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"
 						;;
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-dev] [PATCH 2/2] eclass/tests/python-utils-r1.sh: Add tests for py3.8
  2020-02-27 18:00 [gentoo-dev] [PATCH 1/2] python-utils-r1.eclass: Fix PYTHON_LIBS for py3.8+ Michał Górny
@ 2020-02-27 18:00 ` Michał Górny
  0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2020-02-27 18:00 UTC (permalink / raw
  To: gentoo-dev; +Cc: python, Michał Górny

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/tests/python-utils-r1.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index 4367890a08a1..ab072c6ce4e7 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -101,6 +101,20 @@ fi
 test_var PYTHON_PKG_DEP python3_7 '*dev-lang/python*:3.7'
 test_var PYTHON_SCRIPTDIR python3_7 /usr/lib/python-exec/python3.7
 
+test_var EPYTHON python3_8 python3.8
+test_var PYTHON python3_8 /usr/bin/python3.8
+if [[ -x /usr/bin/python3.8 ]]; then
+	abiflags=$(/usr/bin/python3.8 -c 'import sysconfig; print(sysconfig.get_config_var("ABIFLAGS"))')
+	test_var PYTHON_SITEDIR python3_8 "/usr/lib/python3.8/site-packages"
+	test_var PYTHON_INCLUDEDIR python3_8 "/usr/include/python3.8${abiflags}"
+	test_var PYTHON_LIBPATH python3_8 "/usr/lib*/libpython3.8${abiflags}$(get_libname)"
+	test_var PYTHON_CONFIG python3_8 "/usr/bin/python3.8${abiflags}-config"
+	test_var PYTHON_CFLAGS python3_8 "*-I/usr/include/python3.8*"
+	test_var PYTHON_LIBS python3_8 "*-lpython3.8*"
+fi
+test_var PYTHON_PKG_DEP python3_8 '*dev-lang/python*:3.8'
+test_var PYTHON_SCRIPTDIR python3_8 /usr/lib/python-exec/python3.8
+
 test_var EPYTHON jython2_7 jython2.7
 test_var PYTHON jython2_7 /usr/bin/jython2.7
 if [[ -x /usr/bin/jython2.7 ]]; then
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-27 18:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-27 18:00 [gentoo-dev] [PATCH 1/2] python-utils-r1.eclass: Fix PYTHON_LIBS for py3.8+ Michał Górny
2020-02-27 18:00 ` [gentoo-dev] [PATCH 2/2] eclass/tests/python-utils-r1.sh: Add tests for py3.8 Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox