Gentoo Archives: gentoo-commits

From: "Ali Polatel (hawking)" <hawking@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-lang/python: ChangeLog python-2.5.1-r4.ebuild python-2.4.4-r7.ebuild
Date: Sun, 18 Nov 2007 22:43:39
Message-Id: E1ItsrV-0006SJ-EE@stork.gentoo.org
1 hawking 07/11/18 22:43:33
2
3 Modified: ChangeLog
4 Added: python-2.5.1-r4.ebuild python-2.4.4-r7.ebuild
5 Log:
6 revbump(s). don't install windows executables, bug 198021. updated patchset to fix implicit dependency on openssl, bug 198398.
7 (Portage version: 2.1.3.19)
8
9 Revision Changes Path
10 1.291 dev-lang/python/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/ChangeLog?rev=1.291&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/ChangeLog?rev=1.291&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/ChangeLog?r1=1.290&r2=1.291
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v
19 retrieving revision 1.290
20 retrieving revision 1.291
21 diff -u -r1.290 -r1.291
22 --- ChangeLog 27 Oct 2007 11:19:03 -0000 1.290
23 +++ ChangeLog 18 Nov 2007 22:43:32 -0000 1.291
24 @@ -1,6 +1,14 @@
25 # ChangeLog for dev-lang/python
26 # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.290 2007/10/27 11:19:03 dertobi123 Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.291 2007/11/18 22:43:32 hawking Exp $
29 +
30 +*python-2.5.1-r4 (18 Nov 2007)
31 +*python-2.4.4-r7 (18 Nov 2007)
32 +
33 + 18 Nov 2007; Ali Polatel <hawking@g.o> +python-2.4.4-r7.ebuild,
34 + +python-2.5.1-r4.ebuild:
35 + revbump(s). don't install windows executables, bug 198021. updated patchset
36 + to fix implicit dependency on openssl, bug 198398. fix quoting.
37
38 27 Oct 2007; Tobias Scherbaum <dertobi123@g.o>
39 python-2.3.6-r3.ebuild, python-2.4.4-r6.ebuild:
40
41
42
43 1.1 dev-lang/python/python-2.5.1-r4.ebuild
44
45 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/python-2.5.1-r4.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/python-2.5.1-r4.ebuild?rev=1.1&content-type=text/plain
47
48 Index: python-2.5.1-r4.ebuild
49 ===================================================================
50 # Copyright 1999-2007 Gentoo Foundation
51 # Distributed under the terms of the GNU General Public License v2
52 # $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.5.1-r4.ebuild,v 1.1 2007/11/18 22:43:32 hawking Exp $
53
54 # NOTE about python-portage interactions :
55 # - Do not add a pkg_setup() check for a certain version of portage
56 # in dev-lang/python. It _WILL_ stop people installing from
57 # Gentoo 1.4 images.
58
59 inherit eutils autotools flag-o-matic python multilib versionator toolchain-funcs alternatives libtool
60
61 # we need this so that we don't depends on python.eclass
62 PYVER_MAJOR=$(get_major_version)
63 PYVER_MINOR=$(get_version_component_range 2)
64 PYVER="${PYVER_MAJOR}.${PYVER_MINOR}"
65
66 MY_P="Python-${PV}"
67 S="${WORKDIR}/${MY_P}"
68
69 DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language."
70 HOMEPAGE="http://www.python.org/"
71 SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.bz2
72 mirror://gentoo/python-gentoo-patches-${PV}-r2.tar.bz2"
73
74 LICENSE="PSF-2.2"
75 SLOT="2.5"
76 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
77 IUSE="ncurses gdbm ssl readline tk berkdb bootstrap ipv6 build ucs2 sqlite doc nothreads examples elibc_uclibc"
78
79 # NOTE: dev-python/{elementtree,celementtree,pysqlite,ctypes,cjkcodecs}
80 # do not conflict with the ones in python proper. - liquidx
81
82 DEPEND=">=sys-libs/zlib-1.1.3
83 !build? (
84 sqlite? ( >=dev-db/sqlite-3 )
85 tk? ( >=dev-lang/tk-8.0 )
86 ncurses? ( >=sys-libs/ncurses-5.2
87 readline? ( >=sys-libs/readline-4.1 ) )
88 berkdb? ( >=sys-libs/db-3.1 )
89 gdbm? ( sys-libs/gdbm )
90 ssl? ( dev-libs/openssl )
91 doc? ( =dev-python/python-docs-${PV}* )
92 dev-libs/expat
93 )"
94
95 # NOTE: The dev-python/python-fchksum RDEPEND is needed so that this python
96 # provides the functionality expected from previous pythons.
97
98 # NOTE: python-fchksum is only a RDEPEND and not a DEPEND since we don't need
99 # it to compile python. We just need to ensure that when we install
100 # python, we definitely have fchksum support. - liquidx
101
102 # NOTE: changed RDEPEND to PDEPEND to resolve bug 88777. - kloeri
103 # NOTE: added blocker to enforce correct merge order for bug 88777. - zmedico
104
105 RDEPEND="${DEPEND} build? ( !dev-python/python-fchksum )"
106 PDEPEND="${DEPEND} !build? ( dev-python/python-fchksum ) app-admin/python-updater"
107 PROVIDE="virtual/python"
108
109 src_unpack() {
110 unpack ${A}
111 cd "${S}"
112
113 if tc-is-cross-compiler ; then
114 [[ $(python -V 2>&1) != "Python ${PV}" ]] && \
115 die "Crosscompiling requires the same host and build versions."
116 epatch "${FILESDIR}"/python-2.4.4-test-cross.patch
117 else
118 rm "${WORKDIR}/${PV}"/*_all_crosscompile.patch
119 fi
120
121 EPATCH_SUFFIX="patch" epatch "${WORKDIR}/${PV}"
122 sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
123 Lib/distutils/command/install.py \
124 Lib/distutils/sysconfig.py \
125 Lib/site.py \
126 Makefile.pre.in \
127 Modules/Setup.dist \
128 Modules/getpath.c \
129 setup.py || die
130
131 # fix os.utime() on hppa. utimes it not supported but unfortunately reported as working - gmsoft (22 May 04)
132 # PLEASE LEAVE THIS FIX FOR NEXT VERSIONS AS IT'S A CRITICAL FIX !!!
133 [ "${ARCH}" = "hppa" ] && sed -e 's/utimes //' -i "${S}"/configure
134
135 # remove microsoft windows executables
136 rm Lib/distutils/command/wininst-*.exe
137
138 eautoreconf
139 }
140
141 src_configure() {
142 # disable extraneous modules with extra dependencies
143 if use build; then
144 export PYTHON_DISABLE_MODULES="readline pyexpat dbm gdbm bsddb _curses _curses_panel _tkinter _sqlite3"
145 export PYTHON_DISABLE_SSL=1
146 else
147 use gdbm \
148 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} gdbm"
149 use berkdb \
150 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} dbm bsddb"
151 use readline \
152 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} readline"
153 use tk \
154 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _tkinter"
155 use ncurses \
156 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _curses _curses_panel"
157 use sqlite \
158 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _sqlite3"
159 use ssl \
160 || export PYTHON_DISABLE_SSL=1
161 export PYTHON_DISABLE_MODULES
162 echo $PYTHON_DISABLE_MODULES
163 fi
164 }
165
166 src_compile() {
167 filter-flags -malign-double
168
169 # Seems to no longer be necessary
170 #[ "${ARCH}" = "amd64" ] && append-flags -fPIC
171 [ "${ARCH}" = "alpha" ] && append-flags -fPIC
172
173 # http://bugs.gentoo.org/show_bug.cgi?id=50309
174 if is-flag -O3; then
175 is-flag -fstack-protector-all && replace-flags -O3 -O2
176 use hardened && replace-flags -O3 -O2
177 fi
178
179 export OPT="${CFLAGS}"
180
181 local myconf
182
183 # super-secret switch. don't use this unless you know what you're
184 # doing. enabling UCS2 support will break your existing python
185 # modules
186 use ucs2 \
187 && myconf="${myconf} --enable-unicode=ucs2" \
188 || myconf="${myconf} --enable-unicode=ucs4"
189
190 use nothreads \
191 && myconf="${myconf} --without-threads" \
192 || myconf="${myconf} --with-threads"
193
194 src_configure
195
196 if tc-is-cross-compiler ; then
197 OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \
198 ./configure || die "cross-configure failed"
199 emake python Parser/pgen || die "cross-make failed"
200 mv python hostpython
201 mv Parser/pgen Parser/hostpgen
202 make distclean
203 sed -i \
204 -e '/^HOSTPYTHON/s:=.*:=./hostpython:' \
205 -e '/^HOSTPGEN/s:=.*:=./Parser/hostpgen:' \
206 Makefile.pre.in || die
207 fi
208
209 # export CXX so it ends up in /usr/lib/python2.x/config/Makefile
210 tc-export CXX
211
212 # set LDFLAGS so we link modules with -lpython2.5 correctly.
213 # Needed on FreeBSD unless python2.5 is already installed.
214 # Please query BSD team before removing this!
215 append-ldflags "-L."
216
217 econf \
218 --with-fpectl \
219 --enable-shared \
220 `use_enable ipv6` \
221 --infodir='${prefix}'/share/info \
222 --mandir='${prefix}'/share/man \
223 --with-libc='' \
224 ${myconf} || die
225 emake || die "Parallel make failed"
226 }
227
228 src_install() {
229 dodir /usr
230 src_configure
231 make DESTDIR="${D}" altinstall maninstall || die
232
233 mv "${D}"/usr/bin/python${PYVER}-config "${D}"/usr/bin/python-config-${PYVER}
234
235 # Fix slotted collisions
236 mv "${D}"/usr/bin/pydoc "${D}"/usr/bin/pydoc${PYVER}
237 mv "${D}"/usr/bin/idle "${D}"/usr/bin/idle${PYVER}
238 mv "${D}"/usr/share/man/man1/python.1 \
239 "${D}"/usr/share/man/man1/python${PYVER}.1
240 rm -f "${D}"/usr/bin/smtpd.py
241
242 # While we're working on the config stuff... Let's fix the OPT var
243 # so that it doesn't have any opts listed in it. Prevents the problem
244 # with compiling things with conflicting opts later.
245 dosed -e 's:^OPT=.*:OPT=-DNDEBUG:' \
246 /usr/$(get_libdir)/python${PYVER}/config/Makefile
247
248 if use build ; then
249 rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/{test,encodings,email,lib-tk,bsddb/test}
250 else
251 use elibc_uclibc && rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/{test,bsddb/test}
252 use berkdb || rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/bsddb
253 use tk || rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/lib-tk
254 fi
255
256 prep_ml_includes usr/include/python${PYVER}
257
258 # The stuff below this line extends from 2.1, and should be deprecated
259 # in 2.3, or possibly can wait till 2.4
260
261 # seems like the build do not install Makefile.pre.in anymore
262 # it probably shouldn't - use DistUtils, people!
263 insinto /usr/$(get_libdir)/python${PYVER}/config
264 doins "${S}"/Makefile.pre.in
265
266 if use examples ; then
267 mkdir -p "${D}"/usr/share/doc/${P}/examples
268 cp -r "${S}"/Tools "${D}"/usr/share/doc/${P}/examples
269 fi
270 }
271
272 pkg_postrm() {
273 local mansuffix=$(ecompress --suffix)
274 python_makesym
275 alternatives_auto_makesym "/usr/bin/idle" "idle[0-9].[0-9]"
276 alternatives_auto_makesym "/usr/bin/pydoc" "pydoc[0-9].[0-9]"
277 alternatives_auto_makesym "/usr/bin/python-config" \
278 "python-config-[0-9].[0-9]"
279
280 alternatives_auto_makesym "/usr/share/man/man1/python.1${mansuffix}" \
281 "python[0-9].[0-9].1${mansuffix}"
282
283 python_mod_cleanup /usr/lib/python${PYVER}
284 [[ "$(get_libdir)" == "lib" ]] || \
285 python_mod_cleanup /usr/$(get_libdir)/python${PYVER}
286 }
287
288 pkg_postinst() {
289 local myroot
290 myroot=$(echo $ROOT | sed 's:/$::')
291 local mansuffix=$(ecompress --suffix)
292
293 python_makesym
294 alternatives_auto_makesym "/usr/bin/idle" "idle[0-9].[0-9]"
295 alternatives_auto_makesym "/usr/bin/pydoc" "pydoc[0-9].[0-9]"
296 alternatives_auto_makesym "/usr/bin/python-config" \
297 "python-config-[0-9].[0-9]"
298
299 alternatives_auto_makesym "/usr/share/man/man1/python.1${mansuffix}" \
300 "python[0-9].[0-9].1${mansuffix}"
301
302 python_mod_optimize
303 python_mod_optimize -x site-packages \
304 -x test ${myroot}/usr/lib/python${PYVER}
305 [[ "$(get_libdir)" == "lib" ]] || \
306 python_mod_optimize -x site-packages \
307 -x test ${myroot}/usr/$(get_libdir)/python${PYVER}
308
309 # workaround possible python-upgrade-breaks-portage situation
310 if [ ! -f ${myroot}/usr/lib/portage/pym/portage.py ]; then
311 if [ -f ${myroot}/usr/lib/python2.3/site-packages/portage.py ]; then
312 einfo "Working around possible python-portage upgrade breakage"
313 mkdir -p ${myroot}/usr/lib/portage/pym
314 cp ${myroot}/usr/lib/python2.4/site-packages/{portage,xpak,output,cvstree,getbinpkg,emergehelp,dispatch_conf}.py ${myroot}/usr/lib/portage/pym
315 python_mod_optimize ${myroot}/usr/lib/portage/pym
316 fi
317 fi
318
319 echo
320 ewarn
321 ewarn "If you have just upgraded from an older version of python you will"
322 ewarn "need to run:"
323 ewarn
324 ewarn "/usr/sbin/python-updater"
325 ewarn
326 ewarn "This will automatically rebuild all the python dependent modules"
327 ewarn "to run with python-${PYVER}."
328 ewarn
329 ewarn "Your original Python is still installed and can be accessed via"
330 ewarn "/usr/bin/python2.x."
331 ewarn
332 ebeep 5
333 }
334
335 src_test() {
336 # Tests won't work when cross compiling
337 if tc-is-cross-compiler ; then
338 elog "Disabling tests due to crosscompiling."
339 return
340 fi
341
342 # PYTHON_DONTCOMPILE=1 breaks test_import
343 unset PYTHON_DONTCOMPILE
344
345 #skip all tests that fail during emerge but pass without emerge:
346 #(See bug# 67970)
347 local skip_tests="distutils global mimetools minidom mmap posix pyexpat sax strptime subprocess syntax tcl time urllib urllib2 webbrowser xml_etree"
348
349 for test in ${skip_tests} ; do
350 mv "${S}"/Lib/test/test_${test}.py "${T}"
351 done
352
353 # rerun failed tests in verbose mode (regrtest -w)
354 EXTRATESTOPTS="-w" make test || die "make test failed"
355
356 for test in ${skip_tests} ; do
357 mv "${T}"/test_${test}.py "${S}"/Lib/test/test_${test}.py
358 done
359
360 elog "Portage skipped the following tests which aren't able to run from emerge:"
361 for test in ${skip_tests} ; do
362 elog "test_${test}.py"
363 done
364
365 elog "If you'd like to run them, you may:"
366 elog "cd /usr/lib/python${PYVER}/test"
367 elog "and run the tests separately."
368 }
369
370
371
372 1.1 dev-lang/python/python-2.4.4-r7.ebuild
373
374 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/python-2.4.4-r7.ebuild?rev=1.1&view=markup
375 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/python-2.4.4-r7.ebuild?rev=1.1&content-type=text/plain
376
377 Index: python-2.4.4-r7.ebuild
378 ===================================================================
379 # Copyright 1999-2007 Gentoo Foundation
380 # Distributed under the terms of the GNU General Public License v2
381 # $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.4.4-r7.ebuild,v 1.1 2007/11/18 22:43:32 hawking Exp $
382
383 # NOTE about python-portage interactions :
384 # - Do not add a pkg_setup() check for a certain version of portage
385 # in dev-lang/python. It _WILL_ stop people installing from
386 # Gentoo 1.4 images.
387
388 inherit autotools eutils flag-o-matic python multilib versionator toolchain-funcs alternatives
389
390 # we need this so that we don't depends on python.eclass
391 PYVER_MAJOR=$(get_major_version)
392 PYVER_MINOR=$(get_version_component_range 2)
393 PYVER="${PYVER_MAJOR}.${PYVER_MINOR}"
394
395 MY_P="Python-${PV}"
396 S="${WORKDIR}/${MY_P}"
397 DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language."
398 HOMEPAGE="http://www.python.org/"
399 SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.bz2
400 mirror://gentoo/python-gentoo-patches-${PV}-r4.tar.bz2"
401
402 LICENSE="PSF-2.2"
403 SLOT="2.4"
404 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
405 IUSE="ncurses gdbm ssl readline tk berkdb bootstrap ipv6 build ucs2 doc nocxx nothreads examples elibc_uclibc"
406
407 DEPEND=">=sys-libs/zlib-1.1.3
408 !dev-python/cjkcodecs
409 !build? (
410 tk? ( >=dev-lang/tk-8.0 )
411 ncurses? ( >=sys-libs/ncurses-5.2 readline? ( >=sys-libs/readline-4.1 ) )
412 berkdb? ( >=sys-libs/db-3.1 )
413 gdbm? ( sys-libs/gdbm )
414 ssl? ( dev-libs/openssl )
415 doc? ( =dev-python/python-docs-${PV}* )
416 dev-libs/expat
417 )"
418
419 # NOTE: The dev-python/python-fchksum RDEPEND is needed so that this python
420 # provides the functionality expected from previous pythons.
421
422 # NOTE: python-fchksum is only a RDEPEND and not a DEPEND since we don't need
423 # it to compile python. We just need to ensure that when we install
424 # python, we definitely have fchksum support. - liquidx
425
426 # NOTE: changed RDEPEND to PDEPEND to resolve bug 88777. - kloeri
427 # NOTE: added blocker to enforce correct merge order for bug 88777. - zmedico
428
429 RDEPEND="${DEPEND} build? ( !dev-python/python-fchksum !dev-python/pycrypto )"
430 PDEPEND="${DEPEND} !build? ( dev-python/python-fchksum ) app-admin/python-updater"
431
432 PROVIDE="virtual/python"
433
434 src_unpack() {
435 unpack ${A}
436 cd "${S}"
437
438 if tc-is-cross-compiler ; then
439 [[ $(python -V 2>&1) != "Python ${PV}" ]] && \
440 die "Crosscompiling requires the same host and build versions."
441 epatch "${FILESDIR}"/python-2.4.4-test-cross.patch
442 else
443 rm "${WORKDIR}/${PV}"/*_all_crosscompile.patch
444 fi
445
446 EPATCH_SUFFIX="patch" epatch "${WORKDIR}/${PV}"
447 sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
448 Lib/distutils/command/install.py \
449 Lib/distutils/sysconfig.py \
450 Lib/site.py \
451 Makefile.pre.in \
452 Modules/Setup.dist \
453 Modules/getpath.c \
454 setup.py || die
455
456 # fix os.utime() on hppa. utimes it not supported but unfortunately
457 # reported as working - gmsoft (22 May 04)
458 # PLEASE LEAVE THIS FIX FOR NEXT VERSIONS AS IT'S A CRITICAL FIX !!!
459 [ "${ARCH}" = "hppa" ] && sed -e 's/utimes //' -i "${S}"/configure
460
461 # remove microsoft windows executables
462 rm Lib/distutils/command/wininst-*.exe
463
464 eautoreconf
465 }
466
467 src_configure() {
468 # disable extraneous modules with extra dependencies
469 if use build; then
470 export PYTHON_DISABLE_MODULES="readline pyexpat dbm gdbm bsddb _curses _curses_panel _tkinter"
471 export PYTHON_DISABLE_SSL=1
472 else
473 use gdbm \
474 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} gdbm"
475 use berkdb \
476 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} dbm bsddb"
477 use readline \
478 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} readline"
479 use tk \
480 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _tkinter"
481 use ncurses \
482 || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _curses _curses_panel"
483 use ssl \
484 || export PYTHON_DISABLE_SSL=1
485 export PYTHON_DISABLE_MODULES
486 echo $PYTHON_DISABLE_MODULES
487 fi
488 }
489
490 src_compile() {
491 filter-flags -malign-double
492
493 # Seems to no longer be necessary
494 #[ "${ARCH}" = "amd64" ] && append-flags -fPIC
495 [ "${ARCH}" = "alpha" ] && append-flags -fPIC
496
497 # http://bugs.gentoo.org/show_bug.cgi?id=50309
498 if is-flag -O3; then
499 is-flag -fstack-protector-all && replace-flags -O3 -O2
500 use hardened && replace-flags -O3 -O2
501 fi
502
503 export OPT="${CFLAGS}"
504
505 local myconf
506 #if we are creating a new build image, we remove the dependency on g++
507 if use build && ! use bootstrap || use nocxx ; then
508 myconf="--with-cxx=no"
509 fi
510
511 # super-secret switch. don't use this unless you know what you're
512 # doing. enabling UCS2 support will break your existing python
513 # modules
514 use ucs2 \
515 && myconf="${myconf} --enable-unicode=ucs2" \
516 || myconf="${myconf} --enable-unicode=ucs4"
517
518 use nothreads \
519 && myconf="${myconf} --without-threads" \
520 || myconf="${myconf} --with-threads"
521
522 src_configure
523
524 if tc-is-cross-compiler ; then
525 OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \
526 ./configure --with-cxx=no || die "cross-configure failed"
527 emake python Parser/pgen || die "cross-make failed"
528 mv python hostpython
529 mv Parser/pgen Parser/hostpgen
530 make distclean
531 sed -i \
532 -e '/^HOSTPYTHON/s:=.*:=./hostpython:' \
533 -e '/^HOSTPGEN/s:=.*:=./Parser/hostpgen:' \
534 Makefile.pre.in || die
535 fi
536
537 # export CXX so it ends up in /usr/lib/python2.x/config/Makefile
538 tc-export CXX
539 # set LINKCC to prevent python from being linked to libstdc++.so
540 export LINKCC="\$(PURIFY) \$(CC)"
541 econf \
542 --with-fpectl \
543 --enable-shared \
544 `use_enable ipv6` \
545 --infodir='${prefix}'/share/info \
546 --mandir='${prefix}'/share/man \
547 --with-libc='' \
548 ${myconf} || die
549 emake || die "Parallel make failed"
550 }
551
552 src_install() {
553 dodir /usr
554 src_configure
555 make DESTDIR="${D}" altinstall maninstall || die
556
557 # install our own custom python-config
558 exeinto /usr/bin
559 newexe "${FILESDIR}"/python-config-${PYVER}-r1 python-config-${PYVER}
560
561 # Use correct libdir in python-config
562 dosed "s:/usr/lib/:/usr/$(get_libdir)/:" /usr/bin/python-config-${PYVER}
563
564 if use build ; then
565 rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/{test,encodings,email,lib-tk,bsddb/test}
566 else
567 use elibc_uclibc && rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/{test,bsddb/test}
568 use berkdb || rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/bsddb
569 use tk || rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/lib-tk
570 fi
571
572 # Fix slotted collisions
573 mv "${D}"/usr/bin/pydoc "${D}"/usr/bin/pydoc${PYVER}
574 mv "${D}"/usr/bin/idle "${D}"/usr/bin/idle${PYVER}
575 mv "${D}"/usr/share/man/man1/python.1 \
576 "${D}"/usr/share/man/man1/python${PYVER}.1
577 rm -f "${D}"/usr/bin/smtpd.py
578
579 prep_ml_includes usr/include/python${PYVER}
580
581 # The stuff below this line extends from 2.1, and should be deprecated
582 # in 2.3, or possibly can wait till 2.4
583
584 # seems like the build do not install Makefile.pre.in anymore
585 # it probably shouldn't - use DistUtils, people!
586 insinto /usr/$(get_libdir)/python${PYVER}/config
587 doins "${S}"/Makefile.pre.in
588
589 # While we're working on the config stuff... Let's fix the OPT var
590 # so that it doesn't have any opts listed in it. Prevents the problem
591 # with compiling things with conflicting opts later.
592 dosed -e 's:^OPT=.*:OPT=-DNDEBUG:' \
593 /usr/$(get_libdir)/python${PYVER}/config/Makefile
594
595 if use examples ; then
596 mkdir -p "${D}"/usr/share/doc/${P}/examples
597 cp -r "${S}"/Tools "${D}"/usr/share/doc/${P}/examples
598 fi
599 }
600
601 pkg_postrm() {
602 local mansuffix=$(ecompress --suffix)
603 python_makesym
604 alternatives_auto_makesym "/usr/bin/idle" "idle[0-9].[0-9]"
605 alternatives_auto_makesym "/usr/bin/pydoc" "pydoc[0-9].[0-9]"
606 alternatives_auto_makesym "/usr/bin/python-config" \
607 "python-config-[0-9].[0-9]"
608 alternatives_auto_makesym "/usr/share/man/man1/python.1${mansuffix}" \
609 "python[0-9].[0-9].1${mansuffix}"
610
611 python_mod_cleanup /usr/lib/python${PYVER}
612 [[ "$(get_libdir)" == "lib" ]] || \
613 python_mod_cleanup /usr/$(get_libdir)/python${PYVER}
614 }
615
616 pkg_postinst() {
617 local myroot
618 myroot=$(echo $ROOT | sed 's:/$::')
619 local mansuffix=$(ecompress --suffix)
620
621 python_makesym
622 alternatives_auto_makesym "/usr/bin/idle" "idle[0-9].[0-9]"
623 alternatives_auto_makesym "/usr/bin/pydoc" "pydoc[0-9].[0-9]"
624 alternatives_auto_makesym "/usr/bin/python-config" \
625 "python-config-[0-9].[0-9]"
626 alternatives_auto_makesym "/usr/share/man/man1/python.1${mansuffix}" \
627 "python[0-9].[0-9].1${mansuffix}"
628
629 python_mod_optimize
630 python_mod_optimize -x site-packages \
631 -x test ${myroot}/usr/lib/python${PYVER}
632 [[ "$(get_libdir)" == "lib" ]] || \
633 python_mod_optimize -x site-packages \
634 -x test ${myroot}/usr/$(get_libdir)/python${PYVER}
635
636 # workaround possible python-upgrade-breaks-portage situation
637 if [ ! -f ${myroot}/usr/lib/portage/pym/portage.py ]; then
638 if [ -f ${myroot}/usr/lib/python2.3/site-packages/portage.py ]; then
639 einfo "Working around possible python-portage upgrade breakage"
640 mkdir -p ${myroot}/usr/lib/portage/pym
641 cp ${myroot}/usr/lib/python2.4/site-packages/{portage,xpak,output,cvstree,getbinpkg,emergehelp,dispatch_conf}.py ${myroot}/usr/lib/portage/pym
642 python_mod_optimize ${myroot}/usr/lib/portage/pym
643 fi
644 fi
645
646 echo
647 ewarn
648 ewarn "If you have just upgraded from an older version of python you"
649 ewarn "will need to run:"
650 ewarn
651 ewarn "/usr/sbin/python-updater"
652 ewarn
653 ewarn "This will automatically rebuild all the python dependent modules"
654 ewarn "to run with python-${PYVER}."
655 ewarn
656 ewarn "Your original Python is still installed and can be accessed via"
657 ewarn "/usr/bin/python2.x."
658 ewarn
659 ebeep 5
660 }
661
662 src_test() {
663 # Tests won't work when cross compiling
664 if tc-is-cross-compiler ; then
665 elog "Disabling tests due to crosscompiling."
666 return
667 fi
668
669 # PYTHON_DONTCOMPILE=1 breaks test_import
670 unset PYTHON_DONTCOMPILE
671
672 #skip all tests that fail during emerge but pass without emerge:
673 #(See bug# 67970)
674 local skip_tests="cookielib distutils global hotshot mimetools minidom mmap posix sax strptime subprocess syntax tcl time urllib urllib2"
675
676 for test in ${skip_tests} ; do
677 mv "${S}"/Lib/test/test_${test}.py "${T}"
678 done
679
680 # rerun failed tests in verbose mode (regrtest -w)
681 EXTRATESTOPTS="-w" make test || die "make test failed"
682
683 for test in ${skip_tests} ; do
684 mv "${T}"/test_${test}.py "${S}"/Lib/test/test_${test}.py
685 done
686
687 elog "Portage skipped the following tests which aren't able to run from emerge:"
688 for test in ${skip_tests} ; do
689 elog "test_${test}.py"
690 done
691
692 elog "If you'd like to run them, you may:"
693 elog "cd /usr/lib/python${PYVER}/test"
694 elog "and run the tests separately."
695 }
696
697
698
699 --
700 gentoo-commits@g.o mailing list