Gentoo Archives: gentoo-commits

From: "Arfrever Frehtes Taifersar Arahesis (arfrever)" <arfrever@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-lang/python: ChangeLog python-2.7.1-r1.ebuild
Date: Mon, 21 Feb 2011 22:17:08
Message-Id: 20110221221657.8AE3C20054@flycatcher.gentoo.org
1 arfrever 11/02/21 22:16:57
2
3 Modified: ChangeLog
4 Added: python-2.7.1-r1.ebuild
5 Log:
6 Fix incompatible API change in xmlrpclib.Transport.parse_response() (Gentoo bug #347465, Python issue #8194). Fix regression in unicodedata.normalize() (Python issue #10254). Don't skip test_ctypes tests on hardened/PAX (Gentoo bug #348745).
7
8 (Portage version: 2.2.0_alpha24_p17/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.518 dev-lang/python/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/ChangeLog?rev=1.518&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/ChangeLog?rev=1.518&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/ChangeLog?r1=1.517&r2=1.518
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v
20 retrieving revision 1.517
21 retrieving revision 1.518
22 diff -u -r1.517 -r1.518
23 --- ChangeLog 21 Feb 2011 22:13:45 -0000 1.517
24 +++ ChangeLog 21 Feb 2011 22:16:57 -0000 1.518
25 @@ -1,6 +1,15 @@
26 # ChangeLog for dev-lang/python
27 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.517 2011/02/21 22:13:45 arfrever Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.518 2011/02/21 22:16:57 arfrever Exp $
30 +
31 +*python-2.7.1-r1 (21 Feb 2011)
32 +
33 + 21 Feb 2011; Arfrever Frehtes Taifersar Arahesis <arfrever@g.o>
34 + -python-2.7.ebuild, -python-2.7.1.ebuild, +python-2.7.1-r1.ebuild:
35 + Fix incompatible API change in xmlrpclib.Transport.parse_response() (Gentoo
36 + bug #347465, Python issue #8194). Fix regression in unicodedata.normalize()
37 + (Python issue #10254). Don't skip test_ctypes tests on hardened/PAX (Gentoo
38 + bug #348745).
39
40 *python-2.6.6-r2 (21 Feb 2011)
41
42
43
44
45 1.1 dev-lang/python/python-2.7.1-r1.ebuild
46
47 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-2.7.1-r1.ebuild?rev=1.1&view=markup
48 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-2.7.1-r1.ebuild?rev=1.1&content-type=text/plain
49
50 Index: python-2.7.1-r1.ebuild
51 ===================================================================
52 # Copyright 1999-2011 Gentoo Foundation
53 # Distributed under the terms of the GNU General Public License v2
54 # $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.7.1-r1.ebuild,v 1.1 2011/02/21 22:16:57 arfrever Exp $
55
56 EAPI="2"
57 WANT_AUTOMAKE="none"
58
59 inherit autotools eutils flag-o-matic multilib python toolchain-funcs
60
61 if [[ "${PV}" == *_pre* ]]; then
62 inherit subversion
63
64 ESVN_PROJECT="python"
65 ESVN_REPO_URI="http://svn.python.org/projects/python/branches/release27-maint"
66 ESVN_REVISION=""
67 else
68 MY_PV="${PV%_p*}"
69 MY_P="Python-${MY_PV}"
70 fi
71
72 PATCHSET_REVISION="1"
73
74 DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language."
75 HOMEPAGE="http://www.python.org/"
76 if [[ "${PV}" == *_pre* ]]; then
77 SRC_URI=""
78 else
79 SRC_URI="http://www.python.org/ftp/python/${MY_PV}/${MY_P}.tar.bz2
80 mirror://gentoo/python-gentoo-patches-${MY_PV}$([[ "${PATCHSET_REVISION}" != "0" ]] && echo "-r${PATCHSET_REVISION}").tar.bz2"
81 fi
82
83 LICENSE="PSF-2.2"
84 SLOT="2.7"
85 PYTHON_ABI="${SLOT}"
86 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
87 IUSE="-berkdb build doc elibc_uclibc examples gdbm ipv6 +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml"
88
89 RDEPEND=">=app-admin/eselect-python-20091230
90 >=sys-libs/zlib-1.1.3
91 virtual/libffi
92 virtual/libintl
93 !build? (
94 berkdb? ( || (
95 sys-libs/db:4.8
96 sys-libs/db:4.7
97 sys-libs/db:4.6
98 sys-libs/db:4.5
99 sys-libs/db:4.4
100 sys-libs/db:4.3
101 sys-libs/db:4.2
102 ) )
103 gdbm? ( sys-libs/gdbm )
104 ncurses? (
105 >=sys-libs/ncurses-5.2
106 readline? ( >=sys-libs/readline-4.1 )
107 )
108 sqlite? ( >=dev-db/sqlite-3.3.8:3[extensions] )
109 ssl? ( dev-libs/openssl )
110 tk? ( >=dev-lang/tk-8.0 )
111 xml? ( >=dev-libs/expat-2 )
112 )
113 !!<sys-apps/portage-2.1.9"
114 DEPEND="${RDEPEND}
115 $([[ "${PV}" == *_pre* ]] && echo "=${CATEGORY}/${PN}-${PV%%.*}*")
116 dev-util/pkgconfig
117 $([[ "${PV}" =~ ^[[:digit:]]+\.[[:digit:]]+_pre ]] && echo "doc? ( dev-python/sphinx )")
118 !sys-devel/gcc[libffi]"
119 RDEPEND+=" !build? ( app-misc/mime-types )
120 $([[ "${PV}" =~ ^[[:digit:]]+\.[[:digit:]]+_pre ]] || echo "doc? ( dev-python/python-docs:${SLOT} )")"
121 PDEPEND="app-admin/python-updater"
122
123 PROVIDE="virtual/python"
124
125 if [[ "${PV}" != *_pre* ]]; then
126 S="${WORKDIR}/${MY_P}"
127 fi
128
129 pkg_setup() {
130 python_pkg_setup
131
132 if use berkdb; then
133 ewarn "\"bsddb\" module is out-of-date and no longer maintained inside dev-lang/python. It has"
134 ewarn "been additionally removed in Python 3. You should use external, still maintained \"bsddb3\""
135 ewarn "module provided by dev-python/bsddb3 which supports both Python 2 and Python 3."
136 fi
137 }
138
139 src_prepare() {
140 # Ensure that internal copies of expat, libffi and zlib are not used.
141 rm -fr Modules/expat
142 rm -fr Modules/_ctypes/libffi*
143 rm -fr Modules/zlib
144
145 if [[ "${PV}" =~ ^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+_pre ]]; then
146 if grep -Eq '#define PY_RELEASE_LEVEL[[:space:]]+PY_RELEASE_LEVEL_FINAL' Include/patchlevel.h; then
147 # Update micro version, release level and version string.
148 local micro_version="${PV%_pre*}"
149 micro_version="${micro_version##*.}"
150 local version_string="${PV%.*}.$((${micro_version} - 1))+"
151 sed \
152 -e "s/\(#define PY_MICRO_VERSION[[:space:]]\+\)[^[:space:]]\+/\1${micro_version}/" \
153 -e "s/\(#define PY_RELEASE_LEVEL[[:space:]]\+\)[^[:space:]]\+/\1PY_RELEASE_LEVEL_ALPHA/" \
154 -e "s/\(#define PY_VERSION[[:space:]]\+\"\)[^\"]\+\(\"\)/\1${version_string}\2/" \
155 -i Include/patchlevel.h || die "sed failed"
156 fi
157 fi
158
159 local excluded_patches
160 if ! tc-is-cross-compiler; then
161 excluded_patches="*_all_crosscompile.patch"
162 fi
163
164 local patchset_dir
165 if [[ "${PV}" == *_pre* ]]; then
166 patchset_dir="${FILESDIR}/${SLOT}-${PATCHSET_REVISION}"
167 else
168 patchset_dir="${WORKDIR}/${MY_PV}"
169 fi
170
171 EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" epatch "${patchset_dir}"
172
173 sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
174 Lib/distutils/command/install.py \
175 Lib/distutils/sysconfig.py \
176 Lib/site.py \
177 Lib/sysconfig.py \
178 Lib/test/test_site.py \
179 Makefile.pre.in \
180 Modules/Setup.dist \
181 Modules/getpath.c \
182 setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
183
184 if ! use wininst; then
185 # Remove Microsoft Windows executables.
186 rm Lib/distutils/command/wininst-*.exe
187 fi
188
189 # Support versions of Autoconf other than 2.65.
190 sed -e "/version_required(2\.65)/d" -i configure.in || die "sed failed"
191
192 if [[ "${PV}" == *_pre* ]]; then
193 sed -e "s/\(-DSVNVERSION=\).*\( -o\)/\1\\\\\"${ESVN_REVISION}\\\\\"\2/" -i Makefile.pre.in || die "sed failed"
194 fi
195
196 eautoreconf
197 }
198
199 src_configure() {
200 if use build; then
201 # Disable extraneous modules with extra dependencies.
202 export PYTHON_DISABLE_MODULES="dbm _bsddb gdbm _curses _curses_panel readline _sqlite3 _tkinter _elementtree pyexpat"
203 export PYTHON_DISABLE_SSL="1"
204 else
205 # dbm module can be linked against berkdb or gdbm.
206 # Defaults to gdbm when both are enabled, #204343.
207 local disable
208 use berkdb || use gdbm || disable+=" dbm"
209 use berkdb || disable+=" _bsddb"
210 use gdbm || disable+=" gdbm"
211 use ncurses || disable+=" _curses _curses_panel"
212 use readline || disable+=" readline"
213 use sqlite || disable+=" _sqlite3"
214 use ssl || export PYTHON_DISABLE_SSL="1"
215 use tk || disable+=" _tkinter"
216 use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
217 export PYTHON_DISABLE_MODULES="${disable}"
218
219 if ! use xml; then
220 ewarn "You have configured Python without XML support."
221 ewarn "This is NOT a recommended configuration as you"
222 ewarn "may face problems parsing any XML documents."
223 fi
224 fi
225
226 if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
227 einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
228 fi
229
230 if [[ "$(gcc-major-version)" -ge 4 ]]; then
231 append-flags -fwrapv
232 fi
233
234 filter-flags -malign-double
235
236 [[ "${ARCH}" == "alpha" ]] && append-flags -fPIC
237
238 # https://bugs.gentoo.org/show_bug.cgi?id=50309
239 if is-flagq -O3; then
240 is-flagq -fstack-protector-all && replace-flags -O3 -O2
241 use hardened && replace-flags -O3 -O2
242 fi
243
244 if tc-is-cross-compiler; then
245 OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \
246 ./configure --{build,host}=${CBUILD} || die "cross-configure failed"
247 emake python Parser/pgen || die "cross-make failed"
248 mv python hostpython
249 mv Parser/pgen Parser/hostpgen
250 make distclean
251 sed -i \
252 -e "/^HOSTPYTHON/s:=.*:=./hostpython:" \
253 -e "/^HOSTPGEN/s:=.*:=./Parser/hostpgen:" \
254 Makefile.pre.in || die "sed failed"
255 fi
256
257 # Export CXX so it ends up in /usr/lib/python2.X/config/Makefile.
258 tc-export CXX
259
260 # Set LDFLAGS so we link modules with -lpython2.7 correctly.
261 # Needed on FreeBSD unless Python 2.7 is already installed.
262 # Please query BSD team before removing this!
263 append-ldflags "-L."
264
265 local dbmliborder
266 if use gdbm; then
267 dbmliborder+="${dbmliborder:+:}gdbm"
268 fi
269 if use berkdb; then
270 dbmliborder+="${dbmliborder:+:}bdb"
271 fi
272
273 OPT="" econf \
274 --with-fpectl \
275 --enable-shared \
276 $(use_enable ipv6) \
277 $(use_with threads) \
278 $(use wide-unicode && echo "--enable-unicode=ucs4" || echo "--enable-unicode=ucs2") \
279 --infodir='${prefix}/share/info' \
280 --mandir='${prefix}/share/man' \
281 --with-dbmliborder="${dbmliborder}" \
282 --with-libc="" \
283 --enable-loadable-sqlite-extensions \
284 --with-system-expat \
285 --with-system-ffi
286 }
287
288 src_compile() {
289 emake EPYTHON="python${PV%%.*}" || die "emake failed"
290 }
291
292 src_test() {
293 # Tests will not work when cross compiling.
294 if tc-is-cross-compiler; then
295 elog "Disabling tests due to crosscompiling."
296 return
297 fi
298
299 # Byte compiling should be enabled here.
300 # Otherwise test_import fails.
301 python_enable_pyc
302
303 # Skip failing tests.
304 local skip_tests="distutils gdb minidom pyexpat sax"
305
306 for test in ${skip_tests}; do
307 mv "${S}/Lib/test/test_${test}.py" "${T}"
308 done
309
310 # Rerun failed tests in verbose mode (regrtest -w).
311 emake test EXTRATESTOPTS="-w" < /dev/tty
312 local result="$?"
313
314 for test in ${skip_tests}; do
315 mv "${T}/test_${test}.py" "${S}/Lib/test/test_${test}.py"
316 done
317
318 elog "The following tests have been skipped:"
319 for test in ${skip_tests}; do
320 elog "test_${test}.py"
321 done
322
323 elog "If you would like to run them, you may:"
324 elog "cd '${EPREFIX}$(python_get_libdir)/test'"
325 elog "and run the tests separately."
326
327 python_disable_pyc
328
329 if [[ "${result}" -ne 0 ]]; then
330 die "emake test failed"
331 fi
332 }
333
334 src_install() {
335 [[ -z "${ED}" ]] && ED="${D%/}${EPREFIX}/"
336
337 emake DESTDIR="${D}" altinstall maninstall || die "emake altinstall maninstall failed"
338 python_clean_installation_image -q
339
340 sed -e "s/\(LDFLAGS=\).*/\1/" -i "${ED}$(python_get_libdir)/config/Makefile" || die "sed failed"
341
342 mv "${ED}usr/bin/python${SLOT}-config" "${ED}usr/bin/python-config-${SLOT}"
343
344 # Fix collisions between different slots of Python.
345 mv "${ED}usr/bin/2to3" "${ED}usr/bin/2to3-${SLOT}"
346 mv "${ED}usr/bin/pydoc" "${ED}usr/bin/pydoc${SLOT}"
347 mv "${ED}usr/bin/idle" "${ED}usr/bin/idle${SLOT}"
348 rm -f "${ED}usr/bin/smtpd.py"
349
350 if use build; then
351 rm -fr "${ED}usr/bin/idle${SLOT}" "${ED}$(python_get_libdir)/"{bsddb,idlelib,lib-tk,sqlite3,test}
352 else
353 use elibc_uclibc && rm -fr "${ED}$(python_get_libdir)/"{bsddb/test,test}
354 use berkdb || rm -fr "${ED}$(python_get_libdir)/"{bsddb,test/test_bsddb*}
355 use sqlite || rm -fr "${ED}$(python_get_libdir)/"{sqlite3,test/test_sqlite*}
356 use tk || rm -fr "${ED}usr/bin/idle${SLOT}" "${ED}$(python_get_libdir)/"{idlelib,lib-tk}
357 fi
358
359 use threads || rm -fr "${ED}$(python_get_libdir)/multiprocessing"
360
361 prep_ml_includes $(python_get_includedir)
362
363 dodoc Misc/{ACKS,HISTORY,NEWS} || die "dodoc failed"
364
365 if use examples; then
366 insinto /usr/share/doc/${PF}/examples
367 doins -r "${S}/Tools" || die "doins failed"
368 fi
369
370 newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT} || die "newinitd failed"
371 newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} || die "newconfd failed"
372
373 # Do not install empty directory.
374 rmdir "${ED}$(python_get_libdir)/lib-old"
375 }
376
377 pkg_preinst() {
378 if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version "${CATEGORY}/${PN}:2.7"; then
379 python_updater_warning="1"
380 fi
381 }
382
383 eselect_python_update() {
384 [[ -z "${EROOT}" ]] && EROOT="${ROOT%/}${EPREFIX}/"
385
386 if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
387 eselect python update
388 fi
389
390 if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
391 eselect python update --python${PV%%.*}
392 fi
393 }
394
395 pkg_postinst() {
396 eselect_python_update
397
398 python_mod_optimize -f -x "/(site-packages|test|tests)/" $(python_get_libdir)
399
400 if [[ "${python_updater_warning}" == "1" ]]; then
401 ewarn
402 ewarn "\e[1;31m************************************************************************\e[0m"
403 ewarn
404 ewarn "You have just upgraded from an older version of Python."
405 ewarn "You should run 'python-updater \${options}' to rebuild Python modules."
406 ewarn
407 ewarn "\e[1;31m************************************************************************\e[0m"
408 ewarn
409 ebeep 12
410 fi
411 }
412
413 pkg_postrm() {
414 eselect_python_update
415
416 python_mod_cleanup $(python_get_libdir)
417 }