1 |
mgorny 12/10/29 13:30:48 |
2 |
|
3 |
Modified: ChangeLog distutils-r1.eclass |
4 |
Log: |
5 |
Introduce an esetup.py wrapper function and mydistutilsargs=() for it. |
6 |
|
7 |
Revision Changes Path |
8 |
1.483 eclass/ChangeLog |
9 |
|
10 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.483&view=markup |
11 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.483&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.482&r2=1.483 |
13 |
|
14 |
Index: ChangeLog |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v |
17 |
retrieving revision 1.482 |
18 |
retrieving revision 1.483 |
19 |
diff -u -r1.482 -r1.483 |
20 |
--- ChangeLog 29 Oct 2012 11:27:30 -0000 1.482 |
21 |
+++ ChangeLog 29 Oct 2012 13:30:48 -0000 1.483 |
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.482 2012/10/29 11:27:30 mgorny Exp $ |
26 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.483 2012/10/29 13:30:48 mgorny Exp $ |
27 |
+ |
28 |
+ 29 Oct 2012; Michał Górny <mgorny@g.o> distutils-r1.eclass: |
29 |
+ Introduce an esetup.py wrapper function and mydistutilsargs=() for it. |
30 |
|
31 |
29 Oct 2012; Michał Górny <mgorny@g.o> python-r1.eclass: |
32 |
Enable python3.3 support. |
33 |
|
34 |
|
35 |
|
36 |
1.13 eclass/distutils-r1.eclass |
37 |
|
38 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils-r1.eclass?rev=1.13&view=markup |
39 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils-r1.eclass?rev=1.13&content-type=text/plain |
40 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils-r1.eclass?r1=1.12&r2=1.13 |
41 |
|
42 |
Index: distutils-r1.eclass |
43 |
=================================================================== |
44 |
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v |
45 |
retrieving revision 1.12 |
46 |
retrieving revision 1.13 |
47 |
diff -u -r1.12 -r1.13 |
48 |
--- distutils-r1.eclass 29 Oct 2012 09:54:50 -0000 1.12 |
49 |
+++ distutils-r1.eclass 29 Oct 2012 13:30:48 -0000 1.13 |
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/distutils-r1.eclass,v 1.12 2012/10/29 09:54:50 mgorny Exp $ |
54 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v 1.13 2012/10/29 13:30:48 mgorny Exp $ |
55 |
|
56 |
# @ECLASS: distutils-r1 |
57 |
# @MAINTAINER: |
58 |
@@ -105,6 +105,37 @@ |
59 |
# HTML_DOCS=( doc/html/ ) |
60 |
# @CODE |
61 |
|
62 |
+# @ECLASS-VARIABLE: mydistutilsargs |
63 |
+# @DEFAULT_UNSET |
64 |
+# @DESCRIPTION: |
65 |
+# An array containing options to be passed to setup.py. |
66 |
+# |
67 |
+# Example: |
68 |
+# @CODE |
69 |
+# python_configure_all() { |
70 |
+# mydistutilsargs=( --enable-my-hidden-option ) |
71 |
+# } |
72 |
+# @CODE |
73 |
+ |
74 |
+# @FUNCTION: esetup.py |
75 |
+# @USAGE: [<args>...] |
76 |
+# @DESCRIPTION: |
77 |
+# Run the setup.py using currently selected Python interpreter |
78 |
+# (if ${PYTHON} is set; fallback 'python' otherwise). The setup.py will |
79 |
+# be passed default command-line arguments, then ${mydistutilsargs[@]}, |
80 |
+# then any parameters passed to this command. |
81 |
+# |
82 |
+# This command dies on failure. |
83 |
+esetup.py() { |
84 |
+ debug-print-function ${FUNCNAME} "${@}" |
85 |
+ |
86 |
+ set -- "${PYTHON:-python}" setup.py \ |
87 |
+ "${mydistutilsargs[@]}" "${@}" |
88 |
+ |
89 |
+ echo "${@}" >&2 |
90 |
+ "${@}" || die |
91 |
+} |
92 |
+ |
93 |
# @FUNCTION: distutils-r1_python_prepare_all |
94 |
# @DESCRIPTION: |
95 |
# The default python_prepare_all(). It applies the patches from PATCHES |
96 |
@@ -147,15 +178,12 @@ |
97 |
# @FUNCTION: distutils-r1_python_compile |
98 |
# @USAGE: [additional-args...] |
99 |
# @DESCRIPTION: |
100 |
-# The default python_compile(). Runs 'setup.py build' using the correct |
101 |
-# Python implementation. Any parameters passed to this function will be |
102 |
-# passed to setup.py. |
103 |
+# The default python_compile(). Runs 'esetup.py build'. Any parameters |
104 |
+# passed to this function will be passed to setup.py. |
105 |
distutils-r1_python_compile() { |
106 |
debug-print-function ${FUNCNAME} "${@}" |
107 |
|
108 |
- set -- "${PYTHON}" setup.py build "${@}" |
109 |
- echo "${@}" |
110 |
- "${@}" || die |
111 |
+ esetup.py build "${@}" |
112 |
} |
113 |
|
114 |
# @FUNCTION: distutils-r1_python_test |
115 |
@@ -197,10 +225,9 @@ |
116 |
# @FUNCTION: distutils-r1_python_install |
117 |
# @USAGE: [additional-args...] |
118 |
# @DESCRIPTION: |
119 |
-# The default python_install(). Runs 'setup.py install' using |
120 |
-# the correct Python implementation, and appending the optimization |
121 |
-# flags. Then calls distutils-r1_rename_scripts. Any parameters passed |
122 |
-# to this function will be passed to setup.py. |
123 |
+# The default python_install(). Runs 'esetup.py install', appending |
124 |
+# the optimization flags. Then calls distutils-r1_rename_scripts. |
125 |
+# Any parameters passed to this function will be passed to setup.py. |
126 |
distutils-r1_python_install() { |
127 |
debug-print-function ${FUNCNAME} "${@}" |
128 |
|
129 |
@@ -216,9 +243,7 @@ |
130 |
|
131 |
unset PYTHONDONTWRITEBYTECODE |
132 |
|
133 |
- set -- "${PYTHON}" setup.py install "${flags[@]}" --root="${D}" "${@}" |
134 |
- echo "${@}" |
135 |
- "${@}" || die |
136 |
+ esetup.py install "${flags[@]}" --root="${D}" "${@}" |
137 |
|
138 |
distutils-r1_rename_scripts |
139 |
} |