1 |
mgorny 12/10/29 09:22:13 |
2 |
|
3 |
Modified: ChangeLog python-r1.eclass |
4 |
Log: |
5 |
Add support for obtaining Python site-packages directory. |
6 |
|
7 |
Revision Changes Path |
8 |
1.474 eclass/ChangeLog |
9 |
|
10 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.474&view=markup |
11 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.474&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.473&r2=1.474 |
13 |
|
14 |
Index: ChangeLog |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v |
17 |
retrieving revision 1.473 |
18 |
retrieving revision 1.474 |
19 |
diff -u -r1.473 -r1.474 |
20 |
--- ChangeLog 28 Oct 2012 09:43:49 -0000 1.473 |
21 |
+++ ChangeLog 29 Oct 2012 09:22:13 -0000 1.474 |
22 |
@@ -1,6 +1,9 @@ |
23 |
# ChangeLog for eclass directory |
24 |
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 |
25 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.473 2012/10/28 09:43:49 pacho Exp $ |
26 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.474 2012/10/29 09:22:13 mgorny Exp $ |
27 |
+ |
28 |
+ 29 Oct 2012; Michał Górny <mgorny@g.o> python-r1.eclass: |
29 |
+ Add support for obtaining Python site-packages directory. |
30 |
|
31 |
28 Oct 2012; Pacho Ramos <pacho@g.o> emul-linux-x86.eclass: |
32 |
Do not hardcode lib32, bug #429726 by SpanKY. |
33 |
|
34 |
|
35 |
|
36 |
1.8 eclass/python-r1.eclass |
37 |
|
38 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-r1.eclass?rev=1.8&view=markup |
39 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-r1.eclass?rev=1.8&content-type=text/plain |
40 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-r1.eclass?r1=1.7&r2=1.8 |
41 |
|
42 |
Index: python-r1.eclass |
43 |
=================================================================== |
44 |
RCS file: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v |
45 |
retrieving revision 1.7 |
46 |
retrieving revision 1.8 |
47 |
diff -u -r1.7 -r1.8 |
48 |
--- python-r1.eclass 27 Oct 2012 01:14:38 -0000 1.7 |
49 |
+++ python-r1.eclass 29 Oct 2012 09:22:13 -0000 1.8 |
50 |
@@ -1,6 +1,6 @@ |
51 |
# Copyright 1999-2012 Gentoo Foundation |
52 |
# Distributed under the terms of the GNU General Public License v2 |
53 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v 1.7 2012/10/27 01:14:38 floppym Exp $ |
54 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v 1.8 2012/10/29 09:22:13 mgorny Exp $ |
55 |
|
56 |
# @ECLASS: python-r1 |
57 |
# @MAINTAINER: |
58 |
@@ -36,6 +36,8 @@ |
59 |
;; |
60 |
esac |
61 |
|
62 |
+inherit multilib |
63 |
+ |
64 |
# @ECLASS-VARIABLE: _PYTHON_ALL_IMPLS |
65 |
# @INTERNAL |
66 |
# @DESCRIPTION: |
67 |
@@ -198,6 +200,16 @@ |
68 |
# python2.6 |
69 |
# @CODE |
70 |
|
71 |
+# @ECLASS-VARIABLE: PYTHON_SITEDIR |
72 |
+# @DESCRIPTION: |
73 |
+# The path to Python site-packages directory. |
74 |
+# |
75 |
+# Set and exported on request using python_export(). |
76 |
+# |
77 |
+# Example value: |
78 |
+# @CODE |
79 |
+# @CODE |
80 |
+ |
81 |
# @FUNCTION: python_export |
82 |
# @USAGE: [<impl>] <variables>... |
83 |
# @DESCRIPTION: |
84 |
@@ -209,8 +221,9 @@ |
85 |
# or an EPYTHON one, e.g. python2.7). If no implementation passed, |
86 |
# the current one will be obtained from ${EPYTHON}. |
87 |
# |
88 |
-# The variables which can be exported are: PYTHON, EPYTHON. They are |
89 |
-# described more completely in the eclass variable documentation. |
90 |
+# The variables which can be exported are: PYTHON, EPYTHON, |
91 |
+# PYTHON_SITEDIR. They are described more completely in the eclass |
92 |
+# variable documentation. |
93 |
python_export() { |
94 |
debug-print-function ${FUNCNAME} "${@}" |
95 |
|
96 |
@@ -247,6 +260,23 @@ |
97 |
export PYTHON=${EPREFIX}/usr/bin/${impl} |
98 |
debug-print "${FUNCNAME}: PYTHON = ${PYTHON}" |
99 |
;; |
100 |
+ PYTHON_SITEDIR) |
101 |
+ local dir |
102 |
+ case "${impl}" in |
103 |
+ python*) |
104 |
+ dir=/usr/$(get_libdir)/${impl} |
105 |
+ ;; |
106 |
+ jython*) |
107 |
+ dir=/usr/share/${impl}/Lib |
108 |
+ ;; |
109 |
+ pypy*) |
110 |
+ dir=/usr/$(get_libdir)/${impl/-c/} |
111 |
+ ;; |
112 |
+ esac |
113 |
+ |
114 |
+ export PYTHON_SITEDIR=${EPREFIX}${dir}/site-packages |
115 |
+ debug-print "${FUNCNAME}: PYTHON_SITEDIR = ${PYTHON_SITEDIR}" |
116 |
+ ;; |
117 |
*) |
118 |
die "python_export: unknown variable ${var}" |
119 |
esac |