Gentoo Archives: gentoo-commits

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