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 distutils-r1.eclass
Date: Fri, 27 Sep 2013 19:21:52
Message-Id: 20130927192143.B648F2004C@flycatcher.gentoo.org
1 mgorny 13/09/27 19:21:43
2
3 Modified: ChangeLog distutils-r1.eclass
4 Log:
5 Use pydistutils.cfg to set build-dirs instead of passing commands explicitly. This should reduce the amount of implicit behavior.
6
7 Revision Changes Path
8 1.994 eclass/ChangeLog
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.994&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.994&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.993&r2=1.994
13
14 Index: ChangeLog
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
17 retrieving revision 1.993
18 retrieving revision 1.994
19 diff -u -r1.993 -r1.994
20 --- ChangeLog 27 Sep 2013 19:19:57 -0000 1.993
21 +++ ChangeLog 27 Sep 2013 19:21:43 -0000 1.994
22 @@ -1,6 +1,10 @@
23 # ChangeLog for eclass directory
24 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.993 2013/09/27 19:19:57 mgorny Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.994 2013/09/27 19:21:43 mgorny Exp $
27 +
28 + 27 Sep 2013; Michał Górny <mgorny@g.o> distutils-r1.eclass:
29 + Use pydistutils.cfg to set build-dirs instead of passing commands explicitly.
30 + This should reduce the amount of implicit behavior.
31
32 27 Sep 2013; Michał Górny <mgorny@g.o> distutils-r1.eclass:
33 Make HOME per-implementation.
34
35
36
37 1.85 eclass/distutils-r1.eclass
38
39 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils-r1.eclass?rev=1.85&view=markup
40 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils-r1.eclass?rev=1.85&content-type=text/plain
41 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils-r1.eclass?r1=1.84&r2=1.85
42
43 Index: distutils-r1.eclass
44 ===================================================================
45 RCS file: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v
46 retrieving revision 1.84
47 retrieving revision 1.85
48 diff -u -r1.84 -r1.85
49 --- distutils-r1.eclass 27 Sep 2013 19:19:57 -0000 1.84
50 +++ distutils-r1.eclass 27 Sep 2013 19:21:43 -0000 1.85
51 @@ -1,6 +1,6 @@
52 # Copyright 1999-2013 Gentoo Foundation
53 # Distributed under the terms of the GNU General Public License v2
54 -# $Header: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v 1.84 2013/09/27 19:19:57 mgorny Exp $
55 +# $Header: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v 1.85 2013/09/27 19:21:43 mgorny Exp $
56
57 # @ECLASS: distutils-r1
58 # @MAINTAINER:
59 @@ -215,45 +215,13 @@
60 #
61 # setup.py will be passed the following, in order:
62 # 1. ${mydistutilsargs[@]}
63 -# 2. The 'build' command and standard build options including ${BUILD_DIR}
64 -# 3. Any additional arguments passed to the esetup.py function.
65 +# 2. additional arguments passed to the esetup.py function.
66 #
67 # This command dies on failure.
68 esetup.py() {
69 debug-print-function ${FUNCNAME} "${@}"
70
71 - local add_args=()
72 - if [[ ${BUILD_DIR} ]]; then
73 - add_args+=(
74 - build
75 - --build-base "${BUILD_DIR}"
76 -
77 - # using a single directory for them helps us export
78 - # ${PYTHONPATH} and ebuilds find the sources independently
79 - # of whether the package installs extensions or not
80 - #
81 - # note: due to some packages (wxpython) relying on separate
82 - # platlib & purelib dirs, we do not set --build-lib (which
83 - # can not be overriden with --build-*lib)
84 - --build-platlib "${BUILD_DIR}/lib"
85 - --build-purelib "${BUILD_DIR}/lib"
86 -
87 - # make the ebuild writer lives easier
88 - --build-scripts "${BUILD_DIR}/scripts"
89 - )
90 -
91 - # if setuptools is used, adjust egg_info path as well
92 - if "${PYTHON:-python}" setup.py --help egg_info &>/dev/null; then
93 - add_args+=(
94 - egg_info --egg-base "${BUILD_DIR}"
95 - )
96 - fi
97 - elif [[ ! ${DISTUTILS_IN_SOURCE_BUILD} ]]; then
98 - die 'Out-of-source build requested, yet BUILD_DIR unset.'
99 - fi
100 -
101 - set -- "${PYTHON:-python}" setup.py \
102 - "${mydistutilsargs[@]}" "${add_args[@]}" "${@}"
103 + set -- "${PYTHON:-python}" setup.py "${mydistutilsargs[@]}" "${@}"
104
105 echo "${@}" >&2
106 "${@}" || die
107 @@ -323,18 +291,6 @@
108 fi
109 }
110
111 -# @FUNCTION: _distutils-r1_copy_egg_info
112 -# @INTERNAL
113 -# @DESCRIPTION:
114 -# Copy egg-info files to the ${BUILD_DIR} (that's going to become
115 -# egg-base in esetup.py). This way, we respect whatever's in upstream
116 -# egg-info.
117 -_distutils-r1_copy_egg_info() {
118 - mkdir -p "${BUILD_DIR}" || die
119 - # stupid freebsd can't do 'cp -t ${BUILD_DIR} {} +'
120 - find -name '*.egg-info' -type d -exec cp -pr {} "${BUILD_DIR}"/ ';' || die
121 -}
122 -
123 # @FUNCTION: distutils-r1_python_prepare_all
124 # @DESCRIPTION:
125 # The default python_prepare_all(). It applies the patches from PATCHES
126 @@ -386,6 +342,46 @@
127 :
128 }
129
130 +# @FUNCTION: _distutils-r1_create_setup_cfg
131 +# @INTERNAL
132 +# @DESCRIPTION:
133 +# Create implementation-specific configuration file for distutils,
134 +# setting proper build-dir paths.
135 +_distutils-r1_create_setup_cfg() {
136 + cat >> "${HOME}"/.pydistutils.cfg <<-_EOF_ || die
137 + [build]
138 + build-base = ${BUILD_DIR}
139 +
140 + # using a single directory for them helps us export
141 + # ${PYTHONPATH} and ebuilds find the sources independently
142 + # of whether the package installs extensions or not
143 + #
144 + # note: due to some packages (wxpython) relying on separate
145 + # platlib & purelib dirs, we do not set --build-lib (which
146 + # can not be overriden with --build-*lib)
147 + build-platlib = %(build-base)s/lib
148 + build-purelib = %(build-base)s/lib
149 +
150 + # make the ebuild writer lives easier
151 + build-scripts = %(build-base)s/scripts
152 +
153 + [egg_info]
154 + egg-base = ${BUILD_DIR}
155 + _EOF_
156 +}
157 +
158 +# @FUNCTION: _distutils-r1_copy_egg_info
159 +# @INTERNAL
160 +# @DESCRIPTION:
161 +# Copy egg-info files to the ${BUILD_DIR} (that's going to become
162 +# egg-base in esetup.py). This way, we respect whatever's in upstream
163 +# egg-info.
164 +_distutils-r1_copy_egg_info() {
165 + mkdir -p "${BUILD_DIR}" || die
166 + # stupid freebsd can't do 'cp -t ${BUILD_DIR} {} +'
167 + find -name '*.egg-info' -type d -exec cp -pr {} "${BUILD_DIR}"/ ';' || die
168 +}
169 +
170 # @FUNCTION: distutils-r1_python_compile
171 # @USAGE: [additional-args...]
172 # @DESCRIPTION:
173 @@ -395,9 +391,10 @@
174 distutils-r1_python_compile() {
175 debug-print-function ${FUNCNAME} "${@}"
176
177 + _distutils-r1_create_setup_cfg
178 _distutils-r1_copy_egg_info
179
180 - esetup.py "${@}"
181 + esetup.py build "${@}"
182 }
183
184 # @FUNCTION: distutils-r1_python_test