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.2-r5.ebuild python-2.4.4-r10.ebuild python-2.3.6-r5.ebuild python-2.4.4-r12.ebuild python-2.3.6-r4.ebuild python-2.5.2-r1.ebuild python-2.4.4-r11.ebuild python-2.5.2-r4.ebuild python-2.5.2-r3.ebuild python-2.4.4-r9.ebuild python-2.5.2-r2.ebuild
Date: Tue, 24 Jun 2008 13:54:09
Message-Id: E1KB8yA-0004fv-UT@stork.gentoo.org
1 hawking 08/06/24 13:54:02
2
3 Modified: ChangeLog
4 Added: python-2.5.2-r5.ebuild
5 Removed: python-2.4.4-r10.ebuild python-2.3.6-r5.ebuild
6 python-2.4.4-r12.ebuild python-2.3.6-r4.ebuild
7 python-2.5.2-r1.ebuild python-2.4.4-r11.ebuild
8 python-2.5.2-r4.ebuild python-2.5.2-r3.ebuild
9 python-2.4.4-r9.ebuild python-2.5.2-r2.ebuild
10 Log:
11 Revbump. Append -fwrapv to CFLAGS if we're using gcc-4, #228905. Updated patchset to fix memory issues with unicode objects, #228905. Drop old.
12 (Portage version: 2.2_rc1/cvs/Linux 2.6.25-gentoo-r1 x86_64)
13
14 Revision Changes Path
15 1.325 dev-lang/python/ChangeLog
16
17 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/ChangeLog?rev=1.325&view=markup
18 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/ChangeLog?rev=1.325&content-type=text/plain
19 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/ChangeLog?r1=1.324&r2=1.325
20
21 Index: ChangeLog
22 ===================================================================
23 RCS file: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v
24 retrieving revision 1.324
25 retrieving revision 1.325
26 diff -u -r1.324 -r1.325
27 --- ChangeLog 20 Jun 2008 15:13:49 -0000 1.324
28 +++ ChangeLog 24 Jun 2008 13:54:02 -0000 1.325
29 @@ -1,6 +1,17 @@
30 # ChangeLog for dev-lang/python
31 # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
32 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.324 2008/06/20 15:13:49 hawking Exp $
33 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.325 2008/06/24 13:54:02 hawking Exp $
34 +
35 +*python-2.5.2-r5 (24 Jun 2008)
36 +
37 + 24 Jun 2008; Ali Polatel <hawking@g.o> -python-2.3.6-r4.ebuild,
38 + -python-2.3.6-r5.ebuild, -python-2.4.4-r9.ebuild,
39 + -python-2.4.4-r10.ebuild, -python-2.4.4-r11.ebuild,
40 + -python-2.4.4-r12.ebuild, -python-2.5.2-r1.ebuild,
41 + -python-2.5.2-r2.ebuild, -python-2.5.2-r3.ebuild, -python-2.5.2-r4.ebuild,
42 + +python-2.5.2-r5.ebuild:
43 + Revbump. Append -fwrapv to CFLAGS if we're using gcc-4, #228905. Updated
44 + patchset to fix memory issues with unicode objects, #228905. Drop old.
45
46 20 Jun 2008; Ali Polatel <hawking@g.o> python-2.5.2-r4.ebuild:
47 Fix bsddb dependency, bug 223133. Cosmetics
48
49
50
51 1.1 dev-lang/python/python-2.5.2-r5.ebuild
52
53 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/python-2.5.2-r5.ebuild?rev=1.1&view=markup
54 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/python-2.5.2-r5.ebuild?rev=1.1&content-type=text/plain
55
56 Index: python-2.5.2-r5.ebuild
57 ===================================================================
58 # Copyright 1999-2008 Gentoo Foundation
59 # Distributed under the terms of the GNU General Public License v2
60 # $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.5.2-r5.ebuild,v 1.1 2008/06/24 13:54:02 hawking Exp $
61
62 # NOTE about python-portage interactions :
63 # - Do not add a pkg_setup() check for a certain version of portage
64 # in dev-lang/python. It _WILL_ stop people installing from
65 # Gentoo 1.4 images.
66
67 EAPI=1
68
69 inherit eutils autotools flag-o-matic python multilib versionator toolchain-funcs alternatives libtool
70
71 # we need this so that we don't depends on python.eclass
72 PYVER_MAJOR=$(get_major_version)
73 PYVER_MINOR=$(get_version_component_range 2)
74 PYVER="${PYVER_MAJOR}.${PYVER_MINOR}"
75
76 MY_P="Python-${PV}"
77 S="${WORKDIR}/${MY_P}"
78
79 DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language."
80 HOMEPAGE="http://www.python.org/"
81 SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.bz2
82 mirror://gentoo/python-gentoo-patches-${PV}-r5.tar.bz2"
83
84 LICENSE="PSF-2.2"
85 SLOT="2.5"
86 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
87 IUSE="ncurses gdbm ssl readline tk berkdb bootstrap ipv6 build ucs2 sqlite doc +threads examples elibc_uclibc wininst"
88
89 # NOTE: dev-python/{elementtree,celementtree,pysqlite,ctypes,cjkcodecs}
90 # do not conflict with the ones in python proper. - liquidx
91
92 DEPEND=">=sys-libs/zlib-1.1.3
93 !build? (
94 sqlite? ( >=dev-db/sqlite-3 )
95 tk? ( >=dev-lang/tk-8.0 )
96 ncurses? ( >=sys-libs/ncurses-5.2
97 readline? ( >=sys-libs/readline-4.1 ) )
98 berkdb? ( || ( sys-libs/db:4.5 sys-libs/db:4.4 sys-libs/db:4.3
99 sys-libs/db:4.2 ) )
100 gdbm? ( sys-libs/gdbm )
101 ssl? ( dev-libs/openssl )
102 doc? ( dev-python/python-docs:2.5 )
103 dev-libs/expat
104 )"
105
106 # NOTE: changed RDEPEND to PDEPEND to resolve bug 88777. - kloeri
107 # NOTE: added blocker to enforce correct merge order for bug 88777. - zmedico
108
109 PDEPEND="${DEPEND} app-admin/python-updater"
110 PROVIDE="virtual/python"
111
112 src_unpack() {
113 unpack ${A}
114 cd "${S}"
115
116 if tc-is-cross-compiler ; then
117 [[ $(python -V 2>&1) != "Python ${PV}" ]] && \
118 die "Crosscompiling requires the same host and build versions."
119 epatch "${FILESDIR}"/python-2.4.4-test-cross.patch
120 else
121 rm "${WORKDIR}/${PV}"/*_all_crosscompile.patch
122 fi
123
124 EPATCH_SUFFIX="patch" epatch "${WORKDIR}/${PV}"
125 sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
126 Lib/distutils/command/install.py \
127 Lib/distutils/sysconfig.py \
128 Lib/site.py \
129 Makefile.pre.in \
130 Modules/Setup.dist \
131 Modules/getpath.c \
132 setup.py || die
133
134 # fix os.utime() on hppa. utimes it not supported but unfortunately reported as working - gmsoft (22 May 04)
135 # PLEASE LEAVE THIS FIX FOR NEXT VERSIONS AS IT'S A CRITICAL FIX !!!
136 [ "${ARCH}" = "hppa" ] && sed -e 's/utimes //' -i "${S}"/configure
137
138 if ! use wininst; then
139 # remove microsoft windows executables
140 rm Lib/distutils/command/wininst-*.exe
141 fi
142
143 eautoreconf
144 }
145
146 src_configure() {
147 # disable extraneous modules with extra dependencies
148 if use build; then
149 export PYTHON_DISABLE_MODULES="readline pyexpat dbm gdbm bsddb _curses _curses_panel _tkinter _sqlite3"
150 export PYTHON_DISABLE_SSL=1
151 else
152 # dbm module can link to berkdb or gdbm
153 # defaults to gdbm when both are enabled, #204343
154 local disable
155 use berkdb || use gdbm || disable="${disable} dbm"
156 use berkdb || disable="${disable} bsddb"
157 use gdbm || disable="${disable} gdbm"
158 use ncurses || disable="${disable} _curses _curses_panel"
159 use readline || disable="${disable} readline"
160 use sqlite || disable="${disable} sqlite3"
161 use ssl || export PYTHON_DISABLE_SSL=1
162 use tk || disable="${disable} _tkinter"
163 export PYTHON_DISABLE_MODULES="${disable}"
164 fi
165 einfo "Disabled modules: $PYTHON_DISABLE_MODULES"
166 }
167
168 src_compile() {
169 filter-flags -malign-double
170
171 # Seems to no longer be necessary
172 #[ "${ARCH}" = "amd64" ] && append-flags -fPIC
173 [ "${ARCH}" = "alpha" ] && append-flags -fPIC
174
175 # http://bugs.gentoo.org/show_bug.cgi?id=50309
176 if is-flag -O3; then
177 is-flag -fstack-protector-all && replace-flags -O3 -O2
178 use hardened && replace-flags -O3 -O2
179 fi
180
181 # See #228905
182 if [[ $(gcc-major-version) -ge 4 ]]; then
183 append-flags -fwrapv
184 fi
185
186 export OPT="${CFLAGS}"
187
188 local myconf
189
190 # super-secret switch. don't use this unless you know what you're
191 # doing. enabling UCS2 support will break your existing python
192 # modules
193 use ucs2 \
194 && myconf="${myconf} --enable-unicode=ucs2" \
195 || myconf="${myconf} --enable-unicode=ucs4"
196
197 use threads \
198 && myconf="${myconf} --with-threads" \
199 || myconf="${myconf} --without-threads"
200
201 src_configure
202
203 if tc-is-cross-compiler ; then
204 OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \
205 ./configure || die "cross-configure failed"
206 emake python Parser/pgen || die "cross-make failed"
207 mv python hostpython
208 mv Parser/pgen Parser/hostpgen
209 make distclean
210 sed -i \
211 -e '/^HOSTPYTHON/s:=.*:=./hostpython:' \
212 -e '/^HOSTPGEN/s:=.*:=./Parser/hostpgen:' \
213 Makefile.pre.in || die
214 fi
215
216 # export CXX so it ends up in /usr/lib/python2.x/config/Makefile
217 tc-export CXX
218
219 # set LDFLAGS so we link modules with -lpython2.5 correctly.
220 # Needed on FreeBSD unless python2.5 is already installed.
221 # Please query BSD team before removing this!
222 append-ldflags "-L."
223
224 econf \
225 --with-fpectl \
226 --enable-shared \
227 `use_enable ipv6` \
228 --infodir='${prefix}'/share/info \
229 --mandir='${prefix}'/share/man \
230 --with-libc='' \
231 ${myconf} || die
232 emake || die "Parallel make failed"
233 }
234
235 src_install() {
236 dodir /usr
237 src_configure
238 make DESTDIR="${D}" altinstall maninstall || die
239
240 mv "${D}"/usr/bin/python${PYVER}-config "${D}"/usr/bin/python-config-${PYVER}
241
242 # Fix slotted collisions
243 mv "${D}"/usr/bin/pydoc "${D}"/usr/bin/pydoc${PYVER}
244 mv "${D}"/usr/bin/idle "${D}"/usr/bin/idle${PYVER}
245 mv "${D}"/usr/share/man/man1/python.1 \
246 "${D}"/usr/share/man/man1/python${PYVER}.1
247 rm -f "${D}"/usr/bin/smtpd.py
248
249 # While we're working on the config stuff... Let's fix the OPT var
250 # so that it doesn't have any opts listed in it. Prevents the problem
251 # with compiling things with conflicting opts later.
252 dosed -e 's:^OPT=.*:OPT=-DNDEBUG:' \
253 /usr/$(get_libdir)/python${PYVER}/config/Makefile
254
255 if use build ; then
256 rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/{test,encodings,email,lib-tk,bsddb/test}
257 else
258 use elibc_uclibc && rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/{test,bsddb/test}
259 use berkdb || rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/bsddb
260 use tk || rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/lib-tk
261 fi
262
263 prep_ml_includes usr/include/python${PYVER}
264
265 # The stuff below this line extends from 2.1, and should be deprecated
266 # in 2.3, or possibly can wait till 2.4
267
268 # seems like the build do not install Makefile.pre.in anymore
269 # it probably shouldn't - use DistUtils, people!
270 insinto /usr/$(get_libdir)/python${PYVER}/config
271 doins "${S}"/Makefile.pre.in
272
273 if use examples ; then
274 mkdir -p "${D}"/usr/share/doc/${P}/examples
275 cp -r "${S}"/Tools "${D}"/usr/share/doc/${P}/examples
276 fi
277
278 newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT}
279 newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT}
280 }
281
282 pkg_postrm() {
283 local mansuffix=$(ecompress --suffix)
284 python_makesym
285 alternatives_auto_makesym "/usr/bin/idle" "idle[0-9].[0-9]"
286 alternatives_auto_makesym "/usr/bin/pydoc" "pydoc[0-9].[0-9]"
287 alternatives_auto_makesym "/usr/bin/python-config" \
288 "python-config-[0-9].[0-9]"
289
290 alternatives_auto_makesym "/usr/share/man/man1/python.1${mansuffix}" \
291 "python[0-9].[0-9].1${mansuffix}"
292
293 python_mod_cleanup /usr/lib/python${PYVER}
294 [[ "$(get_libdir)" == "lib" ]] || \
295 python_mod_cleanup /usr/$(get_libdir)/python${PYVER}
296 }
297
298 pkg_postinst() {
299 local myroot
300 myroot=$(echo $ROOT | sed 's:/$::')
301 local mansuffix=$(ecompress --suffix)
302
303 python_makesym
304 alternatives_auto_makesym "/usr/bin/idle" "idle[0-9].[0-9]"
305 alternatives_auto_makesym "/usr/bin/pydoc" "pydoc[0-9].[0-9]"
306 alternatives_auto_makesym "/usr/bin/python-config" \
307 "python-config-[0-9].[0-9]"
308
309 alternatives_auto_makesym "/usr/share/man/man1/python.1${mansuffix}" \
310 "python[0-9].[0-9].1${mansuffix}"
311
312 python_mod_optimize
313 python_mod_optimize -x "(site-packages|test)" \
314 /usr/lib/python${PYVER}
315 [[ "$(get_libdir)" == "lib" ]] || \
316 python_mod_optimize -x "(site-packages|test)" \
317 /usr/$(get_libdir)/python${PYVER}
318
319 # workaround possible python-upgrade-breaks-portage situation
320 if [ ! -f ${myroot}/usr/lib/portage/pym/portage.py ]; then
321 if [ -f ${myroot}/usr/lib/python2.3/site-packages/portage.py ]; then
322 einfo "Working around possible python-portage upgrade breakage"
323 mkdir -p ${myroot}/usr/lib/portage/pym
324 cp ${myroot}/usr/lib/python2.4/site-packages/{portage,xpak,output,cvstree,getbinpkg,emergehelp,dispatch_conf}.py ${myroot}/usr/lib/portage/pym
325 python_mod_optimize /usr/lib/portage/pym
326 fi
327 fi
328
329 echo
330 ewarn
331 ewarn "If you have just upgraded from an older version of python you will"
332 ewarn "need to run:"
333 ewarn
334 ewarn "/usr/sbin/python-updater"
335 ewarn
336 ewarn "This will automatically rebuild all the python dependent modules"
337 ewarn "to run with python-${PYVER}."
338 ewarn
339 ewarn "Your original Python is still installed and can be accessed via"
340 ewarn "/usr/bin/python2.x."
341 ewarn
342 ebeep 5
343 }
344
345 src_test() {
346 # Tests won't work when cross compiling
347 if tc-is-cross-compiler ; then
348 elog "Disabling tests due to crosscompiling."
349 return
350 fi
351
352 # PYTHON_DONTCOMPILE=1 breaks test_import
353 unset PYTHON_DONTCOMPILE
354
355 #skip all tests that fail during emerge but pass without emerge:
356 #(See bug# 67970)
357 local skip_tests="distutils global mimetools minidom mmap posix pyexpat sax strptime subprocess syntax tcl time urllib urllib2 webbrowser xml_etree"
358
359 # test_pow fails on alpha.
360 # http://bugs.python.org/issue756093
361 [[ ${ARCH} == "alpha" ]] && skip_tests="${skip_tests} pow"
362
363 for test in ${skip_tests} ; do
364 mv "${S}"/Lib/test/test_${test}.py "${T}"
365 done
366
367 # rerun failed tests in verbose mode (regrtest -w)
368 EXTRATESTOPTS="-w" make test || die "make test failed"
369
370 for test in ${skip_tests} ; do
371 mv "${T}"/test_${test}.py "${S}"/Lib/test/test_${test}.py
372 done
373
374 elog "Portage skipped the following tests which aren't able to run from emerge:"
375 for test in ${skip_tests} ; do
376 elog "test_${test}.py"
377 done
378
379 elog "If you'd like to run them, you may:"
380 elog "cd /usr/lib/python${PYVER}/test"
381 elog "and run the tests separately."
382 }
383
384
385
386 --
387 gentoo-commits@l.g.o mailing list