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] python-utils-r1.eclass: python_wrapper_setup, do not query PYTHON_CONFIG
Date: Fri, 21 Apr 2017 14:12:02
Message-Id: 20170421141143.21147-1-mgorny@gentoo.org
1 Use plain 'pythonX.Y-config' executable name in the python-config
2 wrapper instead of querying the complete PYTHON_CONFIG path from
3 python_export.
4
5 Constructing full PYTHON_CONFIG path requires querying ABIFLAGS which
6 requires the Python interpreter to be installed, which in turn
7 unnecessarily forces every ebuild using the eclass to carry a build-time
8 dependency on the Python interpreter.
9
10 All current versions of Python correctly install 'pythonX.Y-config'
11 symlink that points to the correct ABI-suffixed binary. It is therefore
12 unnecessary to use the full path.
13 ---
14 eclass/python-utils-r1.eclass | 6 ++----
15 1 file changed, 2 insertions(+), 4 deletions(-)
16
17 diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
18 index a67e378d3997..49a605b9e159 100644
19 --- a/eclass/python-utils-r1.eclass
20 +++ b/eclass/python-utils-r1.eclass
21 @@ -943,7 +943,7 @@ python_wrapper_setup() {
22 rm -f "${workdir}"/bin/2to3 || die
23 rm -f "${workdir}"/pkgconfig/python{,2,3}.pc || die
24
25 - local EPYTHON PYTHON PYTHON_CONFIG
26 + local EPYTHON PYTHON
27 python_export "${impl}" EPYTHON PYTHON
28
29 local pyver pyother
30 @@ -970,11 +970,9 @@ python_wrapper_setup() {
31
32 # CPython-specific
33 if [[ ${EPYTHON} == python* ]]; then
34 - python_export "${impl}" PYTHON_CONFIG
35 -
36 cat > "${workdir}/bin/python-config" <<-_EOF_ || die
37 #!/bin/sh
38 - exec "${PYTHON_CONFIG}" "\${@}"
39 + exec "${PYTHON}-config" "\${@}"
40 _EOF_
41 cp "${workdir}/bin/python-config" \
42 "${workdir}/bin/python${pyver}-config" || die
43 --
44 2.12.2

Replies