1 |
arfrever 10/02/04 18:31:45 |
2 |
|
3 |
Modified: distutils.eclass |
4 |
Log: |
5 |
Delete support for DISTUTILS_DISABLE_PYTHON_DEPENDENCY and check PYTHON_DEPEND. |
6 |
Support DISTUTILS_SRC_TEST and DISTUTILS_DISABLE_TEST_DEPENDENCY. |
7 |
Add distutils_src_test(). |
8 |
Simplify distutils_src_compile() and distutils_src_install() by extracting of differing code to _distutils_get_build_dir() and _distutils_get_PYTHONPATH(). |
9 |
Delete no longer needed code in distutils_src_install(). |
10 |
|
11 |
Revision Changes Path |
12 |
1.70 eclass/distutils.eclass |
13 |
|
14 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.70&view=markup |
15 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.70&content-type=text/plain |
16 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.69&r2=1.70 |
17 |
|
18 |
Index: distutils.eclass |
19 |
=================================================================== |
20 |
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v |
21 |
retrieving revision 1.69 |
22 |
retrieving revision 1.70 |
23 |
diff -u -r1.69 -r1.70 |
24 |
--- distutils.eclass 10 Jan 2010 17:24:32 -0000 1.69 |
25 |
+++ distutils.eclass 4 Feb 2010 18:31:44 -0000 1.70 |
26 |
@@ -1,19 +1,17 @@ |
27 |
-# Copyright 1999-2009 Gentoo Foundation |
28 |
+# Copyright 1999-2010 Gentoo Foundation |
29 |
# Distributed under the terms of the GNU General Public License v2 |
30 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.69 2010/01/10 17:24:32 arfrever Exp $ |
31 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.70 2010/02/04 18:31:44 arfrever Exp $ |
32 |
|
33 |
# @ECLASS: distutils.eclass |
34 |
# @MAINTAINER: |
35 |
-# <python@g.o> |
36 |
+# Gentoo Python Project <python@g.o> |
37 |
# |
38 |
# Original author: Jon Nelson <jnelson@g.o> |
39 |
-# @BLURB: This eclass allows easier installation of distutils-based python modules |
40 |
+# @BLURB: Eclass for packages with build systems using Distutils |
41 |
# @DESCRIPTION: |
42 |
-# The distutils eclass is designed to allow easier installation of |
43 |
-# distutils-based python modules and their incorporation into |
44 |
-# the Gentoo Linux system. |
45 |
+# The distutils eclass defines phase functions for packages with build systems using Distutils |
46 |
|
47 |
-inherit eutils multilib python |
48 |
+inherit multilib python |
49 |
|
50 |
case "${EAPI:-0}" in |
51 |
0|1) |
52 |
@@ -24,7 +22,7 @@ |
53 |
;; |
54 |
esac |
55 |
|
56 |
-if [[ -z "${DISTUTILS_DISABLE_PYTHON_DEPENDENCY}" ]]; then |
57 |
+if [[ -z "${PYTHON_DEPEND}" ]]; then |
58 |
DEPEND="virtual/python" |
59 |
RDEPEND="${DEPEND}" |
60 |
fi |
61 |
@@ -32,6 +30,7 @@ |
62 |
if has "${EAPI:-0}" 0 1 2; then |
63 |
python="python" |
64 |
else |
65 |
+ # Use "$(PYTHON)" or "$(PYTHON -A)" instead of "${python}". |
66 |
python="die" |
67 |
fi |
68 |
|
69 |
@@ -43,6 +42,42 @@ |
70 |
# @DESCRIPTION: |
71 |
# Global options passed to setup.py. |
72 |
|
73 |
+# @ECLASS-VARIABLE: DISTUTILS_SRC_TEST |
74 |
+# @DESCRIPTION: |
75 |
+# Type of test command used by distutils_src_test(). |
76 |
+# IUSE and DEPEND are automatically adjusted, unless DISTUTILS_DISABLE_TEST_DEPENDENCY is set. |
77 |
+# Valid values: |
78 |
+# setup.py |
79 |
+# nosetests |
80 |
+# py.test |
81 |
+# trial [arguments] |
82 |
+ |
83 |
+# @ECLASS-VARIABLE: DISTUTILS_DISABLE_TEST_DEPENDENCY |
84 |
+# @DESCRIPTION: |
85 |
+# Disable modification of IUSE and DEPEND caused by setting of DISTUTILS_SRC_TEST. |
86 |
+ |
87 |
+if [[ -n "${DISTUTILS_SRC_TEST}" && ! "${DISTUTILS_SRC_TEST}" =~ ^(setup\.py|nosetests|py\.test|trial(\ .*)?)$ ]]; then |
88 |
+ die "'DISTUTILS_SRC_TEST' variable has unsupported value '${DISTUTILS_SRC_TEST}'" |
89 |
+fi |
90 |
+ |
91 |
+if [[ -z "${DISTUTILS_DISABLE_TEST_DEPENDENCY}" ]]; then |
92 |
+ if [[ "${DISTUTILS_SRC_TEST}" == "nosetests" ]]; then |
93 |
+ IUSE="test" |
94 |
+ DEPEND+="${DEPEND:+ }test? ( dev-python/nose )" |
95 |
+ elif [[ "${DISTUTILS_SRC_TEST}" == "py.test" ]]; then |
96 |
+ IUSE="test" |
97 |
+ DEPEND+="${DEPEND:+ }test? ( dev-python/py )" |
98 |
+ # trial requires an argument, which is usually equal to "${PN}". |
99 |
+ elif [[ "${DISTUTILS_SRC_TEST}" =~ ^trial(\ .*)?$ ]]; then |
100 |
+ IUSE="test" |
101 |
+ DEPEND+="${DEPEND:+ }test? ( dev-python/twisted )" |
102 |
+ fi |
103 |
+fi |
104 |
+ |
105 |
+if [[ -n "${DISTUTILS_SRC_TEST}" ]]; then |
106 |
+ EXPORT_FUNCTIONS src_test |
107 |
+fi |
108 |
+ |
109 |
# @ECLASS-VARIABLE: DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS |
110 |
# @DESCRIPTION: |
111 |
# Set this to disable renaming of Python scripts containing versioned shebangs |
112 |
@@ -50,7 +85,23 @@ |
113 |
|
114 |
# @ECLASS-VARIABLE: DOCS |
115 |
# @DESCRIPTION: |
116 |
-# Additional DOCS |
117 |
+# Additional documentation files installed by distutils_src_install(). |
118 |
+ |
119 |
+_distutils_get_build_dir() { |
120 |
+ if [[ -n "${SUPPORT_PYTHON_ABIS}" && -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]]; then |
121 |
+ echo "build-${PYTHON_ABI}" |
122 |
+ else |
123 |
+ echo "build" |
124 |
+ fi |
125 |
+} |
126 |
+ |
127 |
+_distutils_get_PYTHONPATH() { |
128 |
+ if [[ -n "${SUPPORT_PYTHON_ABIS}" && -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]]; then |
129 |
+ ls -d build-${PYTHON_ABI}/lib* 2> /dev/null |
130 |
+ else |
131 |
+ ls -d build/lib* 2> /dev/null |
132 |
+ fi |
133 |
+} |
134 |
|
135 |
_distutils_hook() { |
136 |
if [[ "$#" -ne 1 ]]; then |
137 |
@@ -63,7 +114,7 @@ |
138 |
|
139 |
# @FUNCTION: distutils_src_unpack |
140 |
# @DESCRIPTION: |
141 |
-# The distutils src_unpack function, this function is exported. |
142 |
+# The distutils src_unpack function. This function is exported. |
143 |
distutils_src_unpack() { |
144 |
if [[ "${EBUILD_PHASE}" != "unpack" ]]; then |
145 |
die "${FUNCNAME}() can be used only in src_unpack() phase" |
146 |
@@ -77,14 +128,13 @@ |
147 |
|
148 |
# @FUNCTION: distutils_src_prepare |
149 |
# @DESCRIPTION: |
150 |
-# The distutils src_prepare function, this function is exported. |
151 |
+# The distutils src_prepare function. This function is exported. |
152 |
distutils_src_prepare() { |
153 |
if ! has "${EAPI:-0}" 0 1 && [[ "${EBUILD_PHASE}" != "prepare" ]]; then |
154 |
die "${FUNCNAME}() can be used only in src_prepare() phase" |
155 |
fi |
156 |
|
157 |
- # Delete ez_setup files to prevent packages from installing |
158 |
- # Setuptools on their own. |
159 |
+ # Delete ez_setup files to prevent packages from installing Setuptools on their own. |
160 |
local ez_setup_existence="0" |
161 |
[[ -d ez_setup || -f ez_setup.py ]] && ez_setup_existence="1" |
162 |
rm -fr ez_setup* |
163 |
@@ -92,8 +142,7 @@ |
164 |
echo "def use_setuptools(*args, **kwargs): pass" > ez_setup.py |
165 |
fi |
166 |
|
167 |
- # Delete distribute_setup files to prevent packages from installing |
168 |
- # Distribute on their own. |
169 |
+ # Delete distribute_setup files to prevent packages from installing Distribute on their own. |
170 |
local distribute_setup_existence="0" |
171 |
[[ -d distribute_setup || -f distribute_setup.py ]] && distribute_setup_existence="1" |
172 |
rm -fr distribute_setup* |
173 |
@@ -108,58 +157,78 @@ |
174 |
|
175 |
# @FUNCTION: distutils_src_compile |
176 |
# @DESCRIPTION: |
177 |
-# The distutils src_compile function, this function is exported. |
178 |
-# In newer EAPIs this function calls distutils_src_compile_pre_hook() and |
179 |
-# distutils_src_compile_post_hook(), if they are defined. |
180 |
+# The distutils src_compile function. This function is exported. |
181 |
+# In ebuilds of packages supporting installation for multiple versions of Python, this function |
182 |
+# calls distutils_src_compile_pre_hook() and distutils_src_compile_post_hook(), if they are defined. |
183 |
distutils_src_compile() { |
184 |
if [[ "${EBUILD_PHASE}" != "compile" ]]; then |
185 |
die "${FUNCNAME}() can be used only in src_compile() phase" |
186 |
fi |
187 |
|
188 |
- if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then |
189 |
- if [[ -n "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]]; then |
190 |
- building() { |
191 |
- _distutils_hook pre |
192 |
- |
193 |
- echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" |
194 |
- "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || return "$?" |
195 |
+ if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then |
196 |
+ distutils_building() { |
197 |
+ _distutils_hook pre |
198 |
+ |
199 |
+ echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "$(_distutils_get_build_dir)" "$@" |
200 |
+ "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "$(_distutils_get_build_dir)" "$@" || return "$?" |
201 |
+ |
202 |
+ _distutils_hook post |
203 |
+ } |
204 |
+ python_execute_function ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} distutils_building "$@" |
205 |
+ else |
206 |
+ echo "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" |
207 |
+ "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || die "Building failed" |
208 |
+ fi |
209 |
+} |
210 |
|
211 |
- _distutils_hook post |
212 |
+# @FUNCTION: distutils_src_test |
213 |
+# @DESCRIPTION: |
214 |
+# The distutils src_test function. This function is exported, when DISTUTILS_SRC_TEST variable is set. |
215 |
+distutils_src_test() { |
216 |
+ if [[ "${DISTUTILS_SRC_TEST}" == "setup.py" ]]; then |
217 |
+ if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then |
218 |
+ distutils_testing() { |
219 |
+ echo PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@" |
220 |
+ PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@" |
221 |
} |
222 |
- python_execute_function -s building "$@" |
223 |
+ python_execute_function ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} distutils_testing "$@" |
224 |
else |
225 |
- building() { |
226 |
- _distutils_hook pre |
227 |
- |
228 |
- echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" "$@" |
229 |
- "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" "$@" || return "$?" |
230 |
- |
231 |
- _distutils_hook post |
232 |
- } |
233 |
- python_execute_function building "$@" |
234 |
+ echo PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@" || die "Testing failed" |
235 |
+ PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@" || die "Testing failed" |
236 |
+ fi |
237 |
+ elif [[ "${DISTUTILS_SRC_TEST}" == "nosetests" ]]; then |
238 |
+ python_execute_nosetests -P '$(_distutils_get_PYTHONPATH)' ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} -- "$@" |
239 |
+ elif [[ "${DISTUTILS_SRC_TEST}" == "py.test" ]]; then |
240 |
+ python_execute_py.test -P '$(_distutils_get_PYTHONPATH)' ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} -- "$@" |
241 |
+ # trial requires an argument, which is usually equal to "${PN}". |
242 |
+ elif [[ "${DISTUTILS_SRC_TEST}" =~ ^trial(\ .*)?$ ]]; then |
243 |
+ local trial_arguments |
244 |
+ if [[ "${DISTUTILS_SRC_TEST}" == "trial "* ]]; then |
245 |
+ trial_arguments="${DISTUTILS_SRC_TEST#trial }" |
246 |
+ else |
247 |
+ trial_arguments="${PN}" |
248 |
fi |
249 |
+ |
250 |
+ python_execute_trial -P '$(_distutils_get_PYTHONPATH)' ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} -- ${trial_arguments} "$@" |
251 |
else |
252 |
- echo "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" |
253 |
- "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || die "Building failed" |
254 |
+ die "'DISTUTILS_SRC_TEST' variable has unsupported value '${DISTUTILS_SRC_TEST}'" |
255 |
fi |
256 |
} |
257 |
|
258 |
# @FUNCTION: distutils_src_install |
259 |
# @DESCRIPTION: |
260 |
-# The distutils src_install function, this function is exported. |
261 |
-# In newer EAPIs this function calls distutils_src_install_pre_hook() and |
262 |
-# distutils_src_install_post_hook(), if they are defined. |
263 |
-# It also installs the "standard docs" (CHANGELOG, Change*, KNOWN_BUGS, MAINTAINERS, |
264 |
-# PKG-INFO, CONTRIBUTORS, TODO, NEWS, MANIFEST*, README*, and AUTHORS) |
265 |
+# The distutils src_install function. This function is exported. |
266 |
+# In ebuilds of packages supporting installation for multiple versions of Python, this function |
267 |
+# calls distutils_src_install_pre_hook() and distutils_src_install_post_hook(), if they are defined. |
268 |
+# It also installs some standard documentation files (AUTHORS, Change*, CHANGELOG, CONTRIBUTORS, |
269 |
+# KNOWN_BUGS, MAINTAINERS, MANIFEST*, NEWS, PKG-INFO, README*, TODO). |
270 |
distutils_src_install() { |
271 |
if [[ "${EBUILD_PHASE}" != "install" ]]; then |
272 |
die "${FUNCNAME}() can be used only in src_install() phase" |
273 |
fi |
274 |
|
275 |
- local pylibdir |
276 |
- |
277 |
- if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then |
278 |
- if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge "4" ]]; then |
279 |
+ if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then |
280 |
+ if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge 4 ]]; then |
281 |
declare -A wrapper_scripts=() |
282 |
|
283 |
rename_scripts_with_versioned_shebangs() { |
284 |
@@ -177,51 +246,21 @@ |
285 |
} |
286 |
fi |
287 |
|
288 |
- if [[ -n "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]]; then |
289 |
- installation() { |
290 |
- _distutils_hook pre |
291 |
- |
292 |
- # need this for python-2.5 + setuptools in cases where |
293 |
- # a package uses distutils but does not install anything |
294 |
- # in site-packages. (eg. dev-java/java-config-2.x) |
295 |
- # - liquidx (14/08/2006) |
296 |
- pylibdir="$("$(PYTHON)" -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')" |
297 |
- [[ -n "${pylibdir}" ]] && dodir "${pylibdir}" |
298 |
+ distutils_installation() { |
299 |
+ _distutils_hook pre |
300 |
|
301 |
- echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" |
302 |
- "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || return "$?" |
303 |
+ echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --root="${D}" --no-compile "$@" |
304 |
+ "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --root="${D}" --no-compile "$@" || return "$?" |
305 |
|
306 |
- if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge "4" ]]; then |
307 |
- rename_scripts_with_versioned_shebangs |
308 |
- fi |
309 |
- |
310 |
- _distutils_hook post |
311 |
- } |
312 |
- python_execute_function -s installation "$@" |
313 |
- else |
314 |
- installation() { |
315 |
- _distutils_hook pre |
316 |
- |
317 |
- # need this for python-2.5 + setuptools in cases where |
318 |
- # a package uses distutils but does not install anything |
319 |
- # in site-packages. (eg. dev-java/java-config-2.x) |
320 |
- # - liquidx (14/08/2006) |
321 |
- pylibdir="$("$(PYTHON)" -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')" |
322 |
- [[ -n "${pylibdir}" ]] && dodir "${pylibdir}" |
323 |
- |
324 |
- echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@" |
325 |
- "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@" || return "$?" |
326 |
- |
327 |
- if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge "4" ]]; then |
328 |
- rename_scripts_with_versioned_shebangs |
329 |
- fi |
330 |
+ if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge 4 ]]; then |
331 |
+ rename_scripts_with_versioned_shebangs |
332 |
+ fi |
333 |
|
334 |
- _distutils_hook post |
335 |
- } |
336 |
- python_execute_function installation "$@" |
337 |
- fi |
338 |
+ _distutils_hook post |
339 |
+ } |
340 |
+ python_execute_function ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} distutils_installation "$@" |
341 |
|
342 |
- if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${#wrapper_scripts[@]}" -ne "0" && "${BASH_VERSINFO[0]}" -ge "4" ]]; then |
343 |
+ if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${#wrapper_scripts[@]}" -ne 0 && "${BASH_VERSINFO[0]}" -ge 4 ]]; then |
344 |
python_generate_wrapper_scripts "${!wrapper_scripts[@]}" |
345 |
fi |
346 |
unset wrapper_scripts |
347 |
@@ -229,13 +268,6 @@ |
348 |
# Mark the package to be rebuilt after a Python upgrade. |
349 |
python_need_rebuild |
350 |
|
351 |
- # need this for python-2.5 + setuptools in cases where |
352 |
- # a package uses distutils but does not install anything |
353 |
- # in site-packages. (eg. dev-java/java-config-2.x) |
354 |
- # - liquidx (14/08/2006) |
355 |
- pylibdir="$("$(PYTHON -A)" -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')" |
356 |
- [[ -n "${pylibdir}" ]] && dodir "${pylibdir}" |
357 |
- |
358 |
echo "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" |
359 |
"$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || die "Installation failed" |
360 |
fi |
361 |
@@ -259,8 +291,10 @@ |
362 |
|
363 |
# @FUNCTION: distutils_pkg_postinst |
364 |
# @DESCRIPTION: |
365 |
-# This is a generic optimization, you should override it if your package |
366 |
-# installs modules in another directory. This function is exported. |
367 |
+# The distutils pkg_postinst function. This function is exported. |
368 |
+# When PYTHON_MODNAME variable is set, then this function calls python_mod_optimize() with modules |
369 |
+# specified in PYTHON_MODNAME variable. Otherwise it calls python_mod_optimize() with module, whose |
370 |
+# name is equal to name of current package, if this module exists. |
371 |
distutils_pkg_postinst() { |
372 |
if [[ "${EBUILD_PHASE}" != "postinst" ]]; then |
373 |
die "${FUNCNAME}() can be used only in pkg_postinst() phase" |
374 |
@@ -286,7 +320,10 @@ |
375 |
|
376 |
# @FUNCTION: distutils_pkg_postrm |
377 |
# @DESCRIPTION: |
378 |
-# Generic pyc/pyo cleanup script. This function is exported. |
379 |
+# The distutils pkg_postrm function. This function is exported. |
380 |
+# When PYTHON_MODNAME variable is set, then this function calls python_mod_cleanup() with modules |
381 |
+# specified in PYTHON_MODNAME variable. Otherwise it calls python_mod_cleanup() with module, whose |
382 |
+# name is equal to name of current package, if this module exists. |
383 |
distutils_pkg_postrm() { |
384 |
if [[ "${EBUILD_PHASE}" != "postrm" ]]; then |
385 |
die "${FUNCNAME}() can be used only in pkg_postrm() phase" |
386 |
@@ -320,10 +357,10 @@ |
387 |
|
388 |
# @FUNCTION: distutils_python_version |
389 |
# @DESCRIPTION: |
390 |
-# Calls python_version, so that you can use something like |
391 |
-# e.g. insinto $(python_get_includedir) |
392 |
+# Deprecated wrapper function for deprecated python_version(). |
393 |
distutils_python_version() { |
394 |
if ! has "${EAPI:-0}" 0 1 2; then |
395 |
+ eerror "Use PYTHON() and/or python_get_*() instead of ${FUNCNAME}()." |
396 |
die "${FUNCNAME}() cannot be used in this EAPI" |
397 |
fi |
398 |
|
399 |
@@ -332,9 +369,10 @@ |
400 |
|
401 |
# @FUNCTION: distutils_python_tkinter |
402 |
# @DESCRIPTION: |
403 |
-# Checks for if tkinter support is compiled into python |
404 |
+# Deprecated wrapper function for python_tkinter_exists(). |
405 |
distutils_python_tkinter() { |
406 |
if ! has "${EAPI:-0}" 0 1 2; then |
407 |
+ eerror "Use python_tkinter_exists() instead of ${FUNCNAME}()." |
408 |
die "${FUNCNAME}() cannot be used in this EAPI" |
409 |
fi |