| 1 | # Copyright 1999-2004 Gentoo Foundation |
1 | # Copyright 1999-2009 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.45 2008/01/23 22:19:04 hawking Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.68 2009/12/24 04:21:39 arfrever Exp $ |
|
|
4 | |
|
|
5 | # @ECLASS: distutils.eclass |
|
|
6 | # @MAINTAINER: |
|
|
7 | # <python@gentoo.org> |
| 4 | # |
8 | # |
| 5 | # Author: Jon Nelson <jnelson@gentoo.org> |
9 | # Original author: Jon Nelson <jnelson@gentoo.org> |
| 6 | # Current Maintainer: Alastair Tse <liquidx@gentoo.org> |
10 | # @BLURB: This eclass allows easier installation of distutils-based python modules |
| 7 | # |
11 | # @DESCRIPTION: |
| 8 | # The distutils eclass is designed to allow easier installation of |
12 | # The distutils eclass is designed to allow easier installation of |
| 9 | # distutils-based python modules and their incorporation into |
13 | # distutils-based python modules and their incorporation into |
| 10 | # the Gentoo Linux system. |
14 | # the Gentoo Linux system. |
| 11 | # |
|
|
| 12 | # - Features: |
|
|
| 13 | # distutils_src_compile() - does python setup.py build |
|
|
| 14 | # distutils_src_install() - does python setup.py install and install docs |
|
|
| 15 | # distutils_python_version() - sets PYVER/PYVER_MAJOR/PYVER_MINOR |
|
|
| 16 | # distutils_python_tkinter() - checks for tkinter support in python |
|
|
| 17 | # |
|
|
| 18 | # - Variables: |
|
|
| 19 | # PYTHON_SLOT_VERSION - for Zope support |
|
|
| 20 | # DOCS - additional DOCS |
|
|
| 21 | |
15 | |
| 22 | inherit python multilib eutils |
16 | inherit eutils multilib python |
| 23 | |
17 | |
| 24 | # This helps make it possible to add extensions to python slots. |
18 | case "${EAPI:-0}" in |
| 25 | # Normally only a -py21- ebuild would set PYTHON_SLOT_VERSION. |
19 | 0|1) |
| 26 | if [ "${PYTHON_SLOT_VERSION}" = "2.1" ] ; then |
20 | EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst pkg_postrm |
| 27 | DEPEND="=dev-lang/python-2.1*" |
21 | ;; |
|
|
22 | *) |
|
|
23 | EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install pkg_postinst pkg_postrm |
|
|
24 | ;; |
|
|
25 | esac |
|
|
26 | |
|
|
27 | if [[ -z "${DISTUTILS_DISABLE_PYTHON_DEPENDENCY}" ]]; then |
|
|
28 | DEPEND="virtual/python" |
|
|
29 | RDEPEND="${DEPEND}" |
|
|
30 | fi |
|
|
31 | |
|
|
32 | if has "${EAPI:-0}" 0 1 2; then |
| 28 | python="python2.1" |
33 | python="python" |
| 29 | elif [ "${PYTHON_SLOT_VERSION}" = "2.3" ] ; then |
|
|
| 30 | DEPEND="=dev-lang/python-2.3*" |
|
|
| 31 | python="python2.3" |
|
|
| 32 | else |
34 | else |
| 33 | DEPEND="virtual/python" |
35 | python="die" |
| 34 | python="python" |
|
|
| 35 | fi |
36 | fi |
| 36 | |
37 | |
|
|
38 | # @ECLASS-VARIABLE: DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES |
|
|
39 | # @DESCRIPTION: |
|
|
40 | # Set this to use separate source directories for each enabled version of Python. |
|
|
41 | |
|
|
42 | # @ECLASS-VARIABLE: DISTUTILS_GLOBAL_OPTIONS |
|
|
43 | # @DESCRIPTION: |
|
|
44 | # Global options passed to setup.py. |
|
|
45 | |
|
|
46 | # @ECLASS-VARIABLE: DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS |
|
|
47 | # @DESCRIPTION: |
|
|
48 | # Set this to disable renaming of Python scripts containing versioned shebangs |
|
|
49 | # and generation of wrapper scripts. |
|
|
50 | |
|
|
51 | # @ECLASS-VARIABLE: DOCS |
|
|
52 | # @DESCRIPTION: |
|
|
53 | # Additional DOCS |
|
|
54 | |
|
|
55 | _distutils_hook() { |
|
|
56 | if [[ "$#" -ne 1 ]]; then |
|
|
57 | die "${FUNCNAME}() requires 1 argument" |
|
|
58 | fi |
|
|
59 | if [[ "$(type -t "distutils_src_${EBUILD_PHASE}_$1_hook")" == "function" ]]; then |
|
|
60 | "distutils_src_${EBUILD_PHASE}_$1_hook" |
|
|
61 | fi |
|
|
62 | } |
|
|
63 | |
|
|
64 | # @FUNCTION: distutils_src_unpack |
|
|
65 | # @DESCRIPTION: |
|
|
66 | # The distutils src_unpack function, this function is exported. |
| 37 | distutils_src_unpack() { |
67 | distutils_src_unpack() { |
|
|
68 | if [[ "${EBUILD_PHASE}" != "unpack" ]]; then |
|
|
69 | die "${FUNCNAME}() can be used only in src_unpack() phase" |
|
|
70 | fi |
|
|
71 | |
| 38 | unpack ${A} |
72 | unpack ${A} |
| 39 | cd "${S}" |
73 | cd "${S}" |
| 40 | |
74 | |
| 41 | # remove ez_setup stuff to prevent packages |
75 | has "${EAPI:-0}" 0 1 && distutils_src_prepare |
| 42 | # from installing setuptools on their own |
76 | } |
|
|
77 | |
|
|
78 | # @FUNCTION: distutils_src_prepare |
|
|
79 | # @DESCRIPTION: |
|
|
80 | # The distutils src_prepare function, this function is exported. |
|
|
81 | distutils_src_prepare() { |
|
|
82 | if ! has "${EAPI:-0}" 0 1 && [[ "${EBUILD_PHASE}" != "prepare" ]]; then |
|
|
83 | die "${FUNCNAME}() can be used only in src_prepare() phase" |
|
|
84 | fi |
|
|
85 | |
|
|
86 | # Delete ez_setup files to prevent packages from installing |
|
|
87 | # Setuptools on their own. |
|
|
88 | local ez_setup_existence="0" |
|
|
89 | [[ -d ez_setup || -f ez_setup.py ]] && ez_setup_existence="1" |
| 43 | rm -rf ez_setup* |
90 | rm -fr ez_setup* |
|
|
91 | if [[ "${ez_setup_existence}" == "1" ]]; then |
| 44 | echo "def use_setuptools(*args, **kwargs): pass" > ez_setup.py |
92 | echo "def use_setuptools(*args, **kwargs): pass" > ez_setup.py |
| 45 | } |
93 | fi |
| 46 | |
94 | |
|
|
95 | # Delete distribute_setup files to prevent packages from installing |
|
|
96 | # Distribute on their own. |
|
|
97 | local distribute_setup_existence="0" |
|
|
98 | [[ -d distribute_setup || -f distribute_setup.py ]] && distribute_setup_existence="1" |
|
|
99 | rm -fr distribute_setup* |
|
|
100 | if [[ "${distribute_setup_existence}" == "1" ]]; then |
|
|
101 | echo "def use_setuptools(*args, **kwargs): pass" > distribute_setup.py |
|
|
102 | fi |
|
|
103 | |
|
|
104 | if [[ -n "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]]; then |
|
|
105 | python_copy_sources |
|
|
106 | fi |
|
|
107 | } |
|
|
108 | |
|
|
109 | # @FUNCTION: distutils_src_compile |
|
|
110 | # @DESCRIPTION: |
|
|
111 | # The distutils src_compile function, this function is exported. |
|
|
112 | # In newer EAPIs this function calls distutils_src_compile_pre_hook() and |
|
|
113 | # distutils_src_compile_post_hook(), if they are defined. |
| 47 | distutils_src_compile() { |
114 | distutils_src_compile() { |
| 48 | ${python} setup.py build "$@" || die "compilation failed" |
115 | if [[ "${EBUILD_PHASE}" != "compile" ]]; then |
| 49 | } |
116 | die "${FUNCNAME}() can be used only in src_compile() phase" |
|
|
117 | fi |
| 50 | |
118 | |
|
|
119 | if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then |
|
|
120 | if [[ -n "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]]; then |
|
|
121 | building() { |
|
|
122 | _distutils_hook pre |
|
|
123 | |
|
|
124 | echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" |
|
|
125 | "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || return "$?" |
|
|
126 | |
|
|
127 | _distutils_hook post |
|
|
128 | } |
|
|
129 | python_execute_function -s building "$@" |
|
|
130 | else |
|
|
131 | building() { |
|
|
132 | _distutils_hook pre |
|
|
133 | |
|
|
134 | echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" "$@" |
|
|
135 | "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" "$@" || return "$?" |
|
|
136 | |
|
|
137 | _distutils_hook post |
|
|
138 | } |
|
|
139 | python_execute_function building "$@" |
|
|
140 | fi |
|
|
141 | else |
|
|
142 | python_version |
|
|
143 | echo "$(PYTHON "${PYVER}")" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" |
|
|
144 | "$(PYTHON "${PYVER}")" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || die "Building failed" |
|
|
145 | fi |
|
|
146 | } |
|
|
147 | |
|
|
148 | # @FUNCTION: distutils_src_install |
|
|
149 | # @DESCRIPTION: |
|
|
150 | # The distutils src_install function, this function is exported. |
|
|
151 | # In newer EAPIs this function calls distutils_src_install_pre_hook() and |
|
|
152 | # distutils_src_install_post_hook(), if they are defined. |
|
|
153 | # It also installs the "standard docs" (CHANGELOG, Change*, KNOWN_BUGS, MAINTAINERS, |
|
|
154 | # PKG-INFO, CONTRIBUTORS, TODO, NEWS, MANIFEST*, README*, and AUTHORS) |
| 51 | distutils_src_install() { |
155 | distutils_src_install() { |
|
|
156 | if [[ "${EBUILD_PHASE}" != "install" ]]; then |
|
|
157 | die "${FUNCNAME}() can be used only in src_install() phase" |
|
|
158 | fi |
| 52 | |
159 | |
|
|
160 | local pylibdir |
|
|
161 | |
|
|
162 | # Mark the package to be rebuilt after a python upgrade. |
|
|
163 | python_need_rebuild |
|
|
164 | |
|
|
165 | if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then |
|
|
166 | if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge "4" ]]; then |
|
|
167 | declare -A wrapper_scripts=() |
|
|
168 | |
|
|
169 | rename_scripts_with_versioned_shebangs() { |
|
|
170 | if [[ -d "${D}usr/bin" ]]; then |
|
|
171 | cd "${D}usr/bin" |
|
|
172 | |
|
|
173 | local file |
|
|
174 | for file in *; do |
|
|
175 | if [[ -f "${file}" && ! "${file}" =~ [[:digit:]]+\.[[:digit:]]+$ && "$(head -n1 "${file}")" =~ ^'#!'.*python[[:digit:]]+\.[[:digit:]]+ ]]; then |
|
|
176 | mv "${file}" "${file}-${PYTHON_ABI}" || die "Renaming of '${file}' failed" |
|
|
177 | wrapper_scripts+=(["${D}usr/bin/${file}"]=) |
|
|
178 | fi |
|
|
179 | done |
|
|
180 | fi |
|
|
181 | } |
|
|
182 | fi |
|
|
183 | |
|
|
184 | if [[ -n "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]]; then |
|
|
185 | installation() { |
|
|
186 | _distutils_hook pre |
|
|
187 | |
| 53 | # need this for python-2.5 + setuptools in cases where |
188 | # need this for python-2.5 + setuptools in cases where |
| 54 | # a package uses distutils but does not install anything |
189 | # a package uses distutils but does not install anything |
| 55 | # in site-packages. (eg. dev-java/java-config-2.x) |
190 | # in site-packages. (eg. dev-java/java-config-2.x) |
| 56 | # - liquidx (14/08/2006) |
191 | # - liquidx (14/08/2006) |
| 57 | pylibdir="$(${python} -c 'from distutils.sysconfig import get_python_lib; print get_python_lib()')" |
192 | pylibdir="$("$(PYTHON)" -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')" |
| 58 | [ -n "${pylibdir}" ] && dodir "${pylibdir}" |
193 | [[ -n "${pylibdir}" ]] && dodir "${pylibdir}" |
| 59 | |
194 | |
| 60 | if has_version ">=dev-lang/python-2.3"; then |
195 | echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" |
| 61 | ${python} setup.py install --root=${D} --no-compile "$@" || die |
196 | "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || return "$?" |
|
|
197 | |
|
|
198 | if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge "4" ]]; then |
|
|
199 | rename_scripts_with_versioned_shebangs |
|
|
200 | fi |
|
|
201 | |
|
|
202 | _distutils_hook post |
|
|
203 | } |
|
|
204 | python_execute_function -s installation "$@" |
|
|
205 | else |
|
|
206 | installation() { |
|
|
207 | _distutils_hook pre |
|
|
208 | |
|
|
209 | # need this for python-2.5 + setuptools in cases where |
|
|
210 | # a package uses distutils but does not install anything |
|
|
211 | # in site-packages. (eg. dev-java/java-config-2.x) |
|
|
212 | # - liquidx (14/08/2006) |
|
|
213 | pylibdir="$("$(PYTHON)" -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')" |
|
|
214 | [[ -n "${pylibdir}" ]] && dodir "${pylibdir}" |
|
|
215 | |
|
|
216 | echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@" |
|
|
217 | "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@" || return "$?" |
|
|
218 | |
|
|
219 | if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge "4" ]]; then |
|
|
220 | rename_scripts_with_versioned_shebangs |
|
|
221 | fi |
|
|
222 | |
|
|
223 | _distutils_hook post |
|
|
224 | } |
|
|
225 | python_execute_function installation "$@" |
|
|
226 | fi |
|
|
227 | |
|
|
228 | if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${#wrapper_scripts[@]}" -ne "0" && "${BASH_VERSINFO[0]}" -ge "4" ]]; then |
|
|
229 | python_generate_wrapper_scripts "${!wrapper_scripts[@]}" |
|
|
230 | fi |
|
|
231 | unset wrapper_scripts |
| 62 | else |
232 | else |
| 63 | ${python} setup.py install --root=${D} "$@" || die |
233 | # need this for python-2.5 + setuptools in cases where |
| 64 | fi |
234 | # a package uses distutils but does not install anything |
|
|
235 | # in site-packages. (eg. dev-java/java-config-2.x) |
|
|
236 | # - liquidx (14/08/2006) |
|
|
237 | pylibdir="$("$(PYTHON "${PYVER}")" -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')" |
|
|
238 | [[ -n "${pylibdir}" ]] && dodir "${pylibdir}" |
| 65 | |
239 | |
| 66 | DDOCS="CHANGELOG KNOWN_BUGS MAINTAINERS PKG-INFO CONTRIBUTORS TODO NEWS" |
240 | echo "$(PYTHON "${PYVER}")" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" |
| 67 | DDOCS="${DDOCS} Change* MANIFEST* README* AUTHORS" |
241 | "$(PYTHON "${PYVER}")" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || die "Installation failed" |
|
|
242 | fi |
| 68 | |
243 | |
| 69 | for doc in ${DDOCS}; do |
244 | if [[ -e "${D}usr/local" ]]; then |
|
|
245 | die "Illegal installation into /usr/local" |
|
|
246 | fi |
|
|
247 | |
|
|
248 | local default_docs |
|
|
249 | default_docs="AUTHORS Change* CHANGELOG CONTRIBUTORS KNOWN_BUGS MAINTAINERS MANIFEST* NEWS PKG-INFO README* TODO" |
|
|
250 | |
|
|
251 | local doc |
|
|
252 | for doc in ${default_docs}; do |
| 70 | [ -s "$doc" ] && dodoc $doc |
253 | [[ -s "${doc}" ]] && dodoc "${doc}" |
| 71 | done |
254 | done |
| 72 | |
255 | |
| 73 | [ -n "${DOCS}" ] && dodoc ${DOCS} |
256 | if [[ -n "${DOCS}" ]]; then |
|
|
257 | dodoc ${DOCS} || die "dodoc failed" |
|
|
258 | fi |
| 74 | } |
259 | } |
| 75 | |
260 | |
| 76 | # generic pyc/pyo cleanup script. |
261 | # @FUNCTION: distutils_pkg_postinst |
|
|
262 | # @DESCRIPTION: |
|
|
263 | # This is a generic optimization, you should override it if your package |
|
|
264 | # installs modules in another directory. This function is exported. |
|
|
265 | distutils_pkg_postinst() { |
|
|
266 | if [[ "${EBUILD_PHASE}" != "postinst" ]]; then |
|
|
267 | die "${FUNCNAME}() can be used only in pkg_postinst() phase" |
|
|
268 | fi |
| 77 | |
269 | |
|
|
270 | local pylibdir pymod |
|
|
271 | if [[ -z "${PYTHON_MODNAME}" ]]; then |
|
|
272 | for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do |
|
|
273 | if [[ -d "${pylibdir}/site-packages/${PN}" ]]; then |
|
|
274 | PYTHON_MODNAME="${PN}" |
|
|
275 | fi |
|
|
276 | done |
|
|
277 | fi |
|
|
278 | |
|
|
279 | if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then |
|
|
280 | python_mod_optimize ${PYTHON_MODNAME} |
|
|
281 | else |
|
|
282 | for pymod in ${PYTHON_MODNAME}; do |
|
|
283 | python_mod_optimize "$(python_get_sitedir)/${pymod}" |
|
|
284 | done |
|
|
285 | fi |
|
|
286 | } |
|
|
287 | |
|
|
288 | # @FUNCTION: distutils_pkg_postrm |
|
|
289 | # @DESCRIPTION: |
|
|
290 | # Generic pyc/pyo cleanup script. This function is exported. |
| 78 | distutils_pkg_postrm() { |
291 | distutils_pkg_postrm() { |
| 79 | PYTHON_MODNAME=${PYTHON_MODNAME:-${PN}} |
292 | if [[ "${EBUILD_PHASE}" != "postrm" ]]; then |
|
|
293 | die "${FUNCNAME}() can be used only in pkg_postrm() phase" |
|
|
294 | fi |
| 80 | |
295 | |
| 81 | if has_version ">=dev-lang/python-2.3"; then |
296 | local pylibdir pymod |
| 82 | ebegin "Performing Python Module Cleanup .." |
297 | if [[ -z "${PYTHON_MODNAME}" ]]; then |
|
|
298 | for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do |
|
|
299 | if [[ -d "${pylibdir}/site-packages/${PN}" ]]; then |
|
|
300 | PYTHON_MODNAME="${PN}" |
|
|
301 | fi |
|
|
302 | done |
|
|
303 | fi |
|
|
304 | |
| 83 | if [ -n "${PYTHON_MODNAME}" ]; then |
305 | if [[ -n "${PYTHON_MODNAME}" ]]; then |
|
|
306 | if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then |
|
|
307 | python_mod_cleanup ${PYTHON_MODNAME} |
|
|
308 | else |
| 84 | for pymod in ${PYTHON_MODNAME}; do |
309 | for pymod in ${PYTHON_MODNAME}; do |
| 85 | for moddir in "`ls -d --color=none -1 ${ROOT}usr/$(get_libdir)/python*/site-packages/${pymod} 2> /dev/null`"; do |
310 | for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do |
| 86 | python_mod_cleanup ${moddir} |
311 | if [[ -d "${pylibdir}/site-packages/${pymod}" ]]; then |
|
|
312 | python_mod_cleanup "${pylibdir#${ROOT}}/site-packages/${pymod}" |
|
|
313 | fi |
| 87 | done |
314 | done |
| 88 | done |
315 | done |
|
|
316 | fi |
| 89 | else |
317 | else |
| 90 | python_mod_cleanup |
318 | python_mod_cleanup |
| 91 | fi |
319 | fi |
| 92 | eend 0 |
|
|
| 93 | fi |
|
|
| 94 | } |
320 | } |
| 95 | |
321 | |
| 96 | # this is a generic optimization, you should override it if your package |
322 | # @FUNCTION: distutils_python_version |
| 97 | # installs things in another directory |
323 | # @DESCRIPTION: |
| 98 | |
324 | # Calls python_version, so that you can use something like |
| 99 | distutils_pkg_postinst() { |
|
|
| 100 | PYTHON_MODNAME=${PYTHON_MODNAME:-${PN}} |
|
|
| 101 | |
|
|
| 102 | # strip trailing slash |
|
|
| 103 | myroot="${ROOT%/}" |
|
|
| 104 | |
|
|
| 105 | if has_version ">=dev-lang/python-2.3"; then |
|
|
| 106 | python_version |
|
|
| 107 | for pymod in ${PYTHON_MODNAME}; do |
|
|
| 108 | if [ -d "${myroot}/usr/$(get_libdir)/python${PYVER}/site-packages/${pymod}" ]; then |
|
|
| 109 | python_mod_optimize ${myroot}/usr/$(get_libdir)/python${PYVER}/site-packages/${pymod} |
|
|
| 110 | fi |
|
|
| 111 | done |
|
|
| 112 | fi |
|
|
| 113 | } |
|
|
| 114 | |
|
|
| 115 | # e.g. insinto ${ROOT}/usr/include/python${PYVER} |
325 | # e.g. insinto ${ROOT}/usr/include/python${PYVER} |
| 116 | |
|
|
| 117 | distutils_python_version() { |
326 | distutils_python_version() { |
|
|
327 | if ! has "${EAPI:-0}" 0 1 2; then |
|
|
328 | die "${FUNCNAME}() cannot be used in this EAPI" |
|
|
329 | fi |
|
|
330 | |
| 118 | python_version |
331 | python_version |
| 119 | } |
332 | } |
| 120 | |
333 | |
|
|
334 | # @FUNCTION: distutils_python_tkinter |
|
|
335 | # @DESCRIPTION: |
| 121 | # checks for if tkinter support is compiled into python |
336 | # Checks for if tkinter support is compiled into python |
| 122 | distutils_python_tkinter() { |
337 | distutils_python_tkinter() { |
|
|
338 | if ! has "${EAPI:-0}" 0 1 2; then |
|
|
339 | die "${FUNCNAME}() cannot be used in this EAPI" |
|
|
340 | fi |
|
|
341 | |
| 123 | python_tkinter_exists |
342 | python_tkinter_exists |
| 124 | } |
343 | } |
| 125 | |
|
|
| 126 | EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst pkg_postrm |
|
|