Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH python-r1 2/8] Add getter-style wrappers for python_export().
Date: Sat, 27 Oct 2012 11:04:57
Message-Id: 1351335771-3618-2-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH python-r1 1/8] python_export: support obtaining site-packages directory. by "Michał Górny"
1 ---
2 gx86/eclass/python-r1.eclass | 46 ++++++++++++++++++++++++++++++++++++++++++++
3 1 file changed, 46 insertions(+)
4
5 diff --git a/gx86/eclass/python-r1.eclass b/gx86/eclass/python-r1.eclass
6 index 45ed0cb..b059a3b 100644
7 --- a/gx86/eclass/python-r1.eclass
8 +++ b/gx86/eclass/python-r1.eclass
9 @@ -283,6 +283,52 @@ python_export() {
10 done
11 }
12
13 +# @FUNCTION: python_get_PYTHON
14 +# @USAGE: [<impl>]
15 +# @DESCRIPTION:
16 +# Obtain and print the path to the Python interpreter for the given
17 +# implementation. If no implementation is provided, ${EPYTHON} will
18 +# be used.
19 +#
20 +# If you just need to have PYTHON set (and exported), then it is better
21 +# to use python_export() directly instead.
22 +python_get_PYTHON() {
23 + debug-print-function ${FUNCNAME} "${@}"
24 +
25 + python_export "${@}" PYTHON
26 + echo "${PYTHON}"
27 +}
28 +
29 +# @FUNCTION: python_get_EPYTHON
30 +# @USAGE: <impl>
31 +# @DESCRIPTION:
32 +# Obtain and print the EPYTHON value for the given implementation.
33 +#
34 +# If you just need to have EPYTHON set (and exported), then it is better
35 +# to use python_export() directly instead.
36 +python_get_EPYTHON() {
37 + debug-print-function ${FUNCNAME} "${@}"
38 +
39 + python_export "${@}" EPYTHON
40 + echo "${EPYTHON}"
41 +}
42 +
43 +# @FUNCTION: python_get_sitedir
44 +# @USAGE: [<impl>]
45 +# @DESCRIPTION:
46 +# Obtain and print the 'site-packages' path for the given
47 +# implementation. If no implementation is provided, ${EPYTHON} will
48 +# be used.
49 +#
50 +# If you just need to have PYTHON_SITEDIR set (and exported), then it is
51 +# better to use python_export() directly instead.
52 +python_get_sitedir() {
53 + debug-print-function ${FUNCNAME} "${@}"
54 +
55 + python_export "${@}" PYTHON_SITEDIR
56 + echo "${PYTHON_SITEDIR}"
57 +}
58 +
59 # @FUNCTION: python_copy_sources
60 # @DESCRIPTION:
61 # Create a single copy of the package sources (${S}) for each enabled
62 --
63 1.7.12.4