Gentoo Archives: gentoo-commits

From: "Michal Gorny (mgorny)" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog python-utils-r1.eclass
Date: Thu, 27 Dec 2012 22:57:04
Message-Id: 20121227225653.44A7B2171D@flycatcher.gentoo.org
1 mgorny 12/12/27 22:56:53
2
3 Modified: ChangeLog python-utils-r1.eclass
4 Log:
5 Introduce functions to get the includedir for Python.
6
7 Revision Changes Path
8 1.578 eclass/ChangeLog
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.578&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.578&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.577&r2=1.578
13
14 Index: ChangeLog
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
17 retrieving revision 1.577
18 retrieving revision 1.578
19 diff -u -r1.577 -r1.578
20 --- ChangeLog 27 Dec 2012 22:56:21 -0000 1.577
21 +++ ChangeLog 27 Dec 2012 22:56:53 -0000 1.578
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.577 2012/12/27 22:56:21 mgorny Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.578 2012/12/27 22:56:53 mgorny Exp $
27 +
28 + 27 Dec 2012; Michał Górny <mgorny@g.o> python-utils-r1.eclass:
29 + Introduce functions to get the includedir for Python.
30
31 27 Dec 2012; Michał Górny <mgorny@g.o> python-r1.eclass:
32 Introduce python_gen_usedep() and python_gen_flags() to make writing complex
33
34
35
36 1.10 eclass/python-utils-r1.eclass
37
38 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-utils-r1.eclass?rev=1.10&view=markup
39 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-utils-r1.eclass?rev=1.10&content-type=text/plain
40 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-utils-r1.eclass?r1=1.9&r2=1.10
41
42 Index: python-utils-r1.eclass
43 ===================================================================
44 RCS file: /var/cvsroot/gentoo-x86/eclass/python-utils-r1.eclass,v
45 retrieving revision 1.9
46 retrieving revision 1.10
47 diff -u -r1.9 -r1.10
48 --- python-utils-r1.eclass 20 Dec 2012 23:35:17 -0000 1.9
49 +++ python-utils-r1.eclass 27 Dec 2012 22:56:53 -0000 1.10
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-utils-r1.eclass,v 1.9 2012/12/20 23:35:17 mgorny Exp $
54 +# $Header: /var/cvsroot/gentoo-x86/eclass/python-utils-r1.eclass,v 1.10 2012/12/27 22:56:53 mgorny Exp $
55
56 # @ECLASS: python-utils-r1
57 # @MAINTAINER:
58 @@ -83,6 +83,17 @@
59 # /usr/lib64/python2.6/site-packages
60 # @CODE
61
62 +# @ECLASS-VARIABLE: PYTHON_INCLUDEDIR
63 +# @DESCRIPTION:
64 +# The path to Python include directory.
65 +#
66 +# Set and exported on request using python_export().
67 +#
68 +# Example value:
69 +# @CODE
70 +# /usr/include/python2.6
71 +# @CODE
72 +
73 # @ECLASS-VARIABLE: PYTHON_PKG_DEP
74 # @DESCRIPTION:
75 # The complete dependency on a particular Python package as a string.
76 @@ -161,6 +172,23 @@
77 export PYTHON_SITEDIR=${EPREFIX}${dir}/site-packages
78 debug-print "${FUNCNAME}: PYTHON_SITEDIR = ${PYTHON_SITEDIR}"
79 ;;
80 + PYTHON_INCLUDEDIR)
81 + local dir
82 + case "${impl}" in
83 + python*)
84 + dir=/usr/include/${impl}
85 + ;;
86 + jython*)
87 + dir=/usr/share/${impl}/Include
88 + ;;
89 + pypy*)
90 + dir=/usr/$(get_libdir)/${impl/-c/}/include
91 + ;;
92 + esac
93 +
94 + export PYTHON_INCLUDEDIR=${EPREFIX}${dir}
95 + debug-print "${FUNCNAME}: PYTHON_INCLUDEDIR = ${PYTHON_INCLUDEDIR}"
96 + ;;
97 PYTHON_PKG_DEP)
98 local d
99 case ${impl} in
100 @@ -237,6 +265,21 @@
101 echo "${PYTHON_SITEDIR}"
102 }
103
104 +# @FUNCTION: python_get_includedir
105 +# @USAGE: [<impl>]
106 +# @DESCRIPTION:
107 +# Obtain and print the include path for the given implementation. If no
108 +# implementation is provided, ${EPYTHON} will be used.
109 +#
110 +# If you just need to have PYTHON_INCLUDEDIR set (and exported), then it
111 +# is better to use python_export() directly instead.
112 +python_get_includedir() {
113 + debug-print-function ${FUNCNAME} "${@}"
114 +
115 + python_export "${@}" PYTHON_INCLUDEDIR
116 + echo "${PYTHON_INCLUDEDIR}"
117 +}
118 +
119 # @FUNCTION: _python_rewrite_shebang
120 # @INTERNAL
121 # @USAGE: [<EPYTHON>] <path>...