---
 gx86/eclass/python-r1.eclass | 34 ++++++++++++++++++++++++++++++++--
 1 file changed, 32 insertions(+), 2 deletions(-)

diff --git a/gx86/eclass/python-r1.eclass b/gx86/eclass/python-r1.eclass
index 9ca0791..45ed0cb 100644
--- a/gx86/eclass/python-r1.eclass
+++ b/gx86/eclass/python-r1.eclass
@@ -36,6 +36,8 @@ case "${EAPI}" in
                ;;
 esac
 
+inherit multilib
+
 # @ECLASS-VARIABLE: _PYTHON_ALL_IMPLS
 # @INTERNAL
 # @DESCRIPTION:
@@ -198,6 +200,16 @@ _python_set_globals
 # python2.6
 # @CODE
 
+# @ECLASS-VARIABLE: PYTHON_SITEDIR
+# @DESCRIPTION:
+# The path to Python site-packages directory.
+#
+# Set and exported on request using python_export().
+#
+# Example value:
+# @CODE
+# @CODE
+
 # @FUNCTION: python_export
 # @USAGE: [<impl>] <variables>...
 # @DESCRIPTION:
@@ -209,8 +221,9 @@ _python_set_globals
 # or an EPYTHON one, e.g. python2.7). If no implementation passed,
 # the current one will be obtained from ${EPYTHON}.
 #
-# The variables which can be exported are: PYTHON, EPYTHON. They are
-# described more completely in the eclass variable documentation.
+# The variables which can be exported are: PYTHON, EPYTHON,
+# PYTHON_SITEDIR. They are described more completely in the eclass
+# variable documentation.
 python_export() {
        debug-print-function ${FUNCNAME} "${@}"
 
@@ -247,6 +260,23 @@ python_export() {
                                export PYTHON=${EPREFIX}/usr/bin/${impl}
                                debug-print "${FUNCNAME}: PYTHON = ${PYTHON}"
                                ;;
+                       PYTHON_SITEDIR)
+                               local dir
+                               case "${impl}" in
+                                       python*)
+                                               dir=/usr/$(get_libdir)/${impl}
+                                               ;;
+                                       jython*)
+                                               dir=/usr/share/${impl}/Lib
+                                               ;;
+                                       pypy*)
+                                               
dir=/usr/$(get_libdir)/${impl/-c/}
+                                               ;;
+                               esac
+
+                               export 
PYTHON_SITEDIR=${EPREFIX}${dir}/site-packages
+                               debug-print "${FUNCNAME}: PYTHON_SITEDIR = 
${PYTHON_SITEDIR}"
+                               ;;
                        *)
                                die "python_export: unknown variable ${var}"
                esac
-- 
1.7.12.4


Reply via email to