public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH python-r1 1/8] python_export: support obtaining site-packages directory.
@ 2012-10-27 11:02 Michał Górny
  2012-10-27 11:02 ` [gentoo-dev] [PATCH python-r1 2/8] Add getter-style wrappers for python_export() Michał Górny
                   ` (7 more replies)
  0 siblings, 8 replies; 16+ messages in thread
From: Michał Górny @ 2012-10-27 11:02 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

---
 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



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

end of thread, other threads:[~2012-10-29 16:14 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-27 11:02 [gentoo-dev] [PATCH python-r1 1/8] python_export: support obtaining site-packages directory Michał Górny
2012-10-27 11:02 ` [gentoo-dev] [PATCH python-r1 2/8] Add getter-style wrappers for python_export() Michał Górny
2012-10-27 11:02 ` [gentoo-dev] [PATCH python-r1 3/8] Add python_export_best() to obtain best impl info Michał Górny
2012-10-27 11:02 ` [gentoo-dev] [PATCH python-r1 4/8] Introduce functions to replicate Python scripts Michał Górny
2012-10-27 13:27   ` Reinis Danne
2012-10-27 14:08     ` Michał Górny
2012-10-27 14:31       ` Reinis Danne
2012-10-27 11:02 ` [gentoo-dev] [PATCH python-r1 5/8] Convert x11-misc/redshift to python-r1 (example) Michał Górny
2012-10-29 15:25   ` Ian Stakenvicius
2012-10-29 15:42     ` Michał Górny
2012-10-29 15:47       ` Ian Stakenvicius
2012-10-29 16:14         ` Michał Górny
2012-10-27 11:02 ` [gentoo-dev] [PATCH python-r1 6/8] Reuse _python_ln_rel in distutils-r1 Michał Górny
2012-10-27 11:02 ` [gentoo-dev] [PATCH python-r1 7/8] Use python_export_best() " Michał Górny
2012-10-27 11:02 ` [gentoo-dev] [PATCH python-r1 8/8] Use find instead of hard-coded path list when looking for scripts Michał Górny
2012-10-27 14:16 ` [gentoo-dev] [PATCH python-r1] Depend on python-exec in python-r1 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