Gentoo Archives: gentoo-commits

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