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.6.1-r1.ebuild python-2.6.1.ebuild
Date: Sat, 21 Mar 2009 23:26:30
Message-Id: E1LlAaC-0004Th-NZ@stork.gentoo.org
1 neurogeek 09/03/21 23:26:28
2
3 Modified: ChangeLog
4 Added: python-2.6.1-r1.ebuild
5 Removed: python-2.6.1.ebuild
6 Log:
7 Fixed typo in sqlite3 extension. Removed old version
8 (Portage version: 2.2_rc23/cvs/Linux i686)
9
10 Revision Changes Path
11 1.368 dev-lang/python/ChangeLog
12
13 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/ChangeLog?rev=1.368&view=markup
14 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/ChangeLog?rev=1.368&content-type=text/plain
15 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/ChangeLog?r1=1.367&r2=1.368
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v
20 retrieving revision 1.367
21 retrieving revision 1.368
22 diff -u -r1.367 -r1.368
23 --- ChangeLog 26 Feb 2009 05:55:39 -0000 1.367
24 +++ ChangeLog 21 Mar 2009 23:26:28 -0000 1.368
25 @@ -1,6 +1,12 @@
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.367 2009/02/26 05:55:39 vapier Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.368 2009/03/21 23:26:28 neurogeek Exp $
30 +
31 +*python-2.6.1-r1 (21 Mar 2009)
32 +
33 + 21 Mar 2009; Jesus Rivero <neurogeek@g.o> -python-2.6.1.ebuild,
34 + +python-2.6.1-r1.ebuild:
35 + Fixed typo in sqlite3 extension. Removed old version
36
37 26 Feb 2009; Mike Frysinger <vapier@g.o>
38 +files/python-2.5-cross-printf.patch, python-2.5.2-r7.ebuild,
39
40
41
42 1.1 dev-lang/python/python-2.6.1-r1.ebuild
43
44 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/python-2.6.1-r1.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/python-2.6.1-r1.ebuild?rev=1.1&content-type=text/plain
46
47 Index: python-2.6.1-r1.ebuild
48 ===================================================================
49 # Copyright 1999-2009 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.6.1-r1.ebuild,v 1.1 2009/03/21 23:26:28 neurogeek 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=2
59
60 inherit eutils autotools flag-o-matic python versionator toolchain-funcs 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/2.6.1/${MY_P}.tar.bz2
73 mirror://gentoo/python-gentoo-patches-2.6-r5.tar.bz2"
74
75 LICENSE="PSF-2.2"
76 SLOT="2.6"
77 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
78 IUSE="berkdb build doc elibc_uclibc examples gdbm ipv6 ncurses readline sqlite ssl +threads tk ucs2 wininst +xml"
79
80 # NOTE: dev-python/{elementtree,celementtree,pysqlite,ctypes,cjkcodecs}
81 # do not conflict with the ones in python proper. - liquidx
82
83 DEPEND=">=app-admin/eselect-python-20080925
84 >=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-3.1 )
91 gdbm? ( sys-libs/gdbm )
92 ssl? ( dev-libs/openssl )
93 doc? ( dev-python/python-docs:2.6 )
94 xml? ( 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_prepare() {
104 default
105
106 if tc-is-cross-compiler ; then
107 [[ $(python -V 2>&1) != "Python ${PV}" ]] && \
108 die "Crosscompiling requires the same host and build versions."
109 epatch "${FILESDIR}"/python-2.6-test-cross.patch
110 else
111 rm "${WORKDIR}/${PYVER}"/*_all_crosscompile.patch
112 fi
113
114 EPATCH_SUFFIX="patch" epatch "${WORKDIR}/${PYVER}"
115
116 epatch "${FILESDIR}/${PN}-${PYVER}_turkish.patch"
117
118 sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
119 Lib/distutils/command/install.py \
120 Lib/distutils/sysconfig.py \
121 Lib/site.py \
122 Makefile.pre.in \
123 Modules/Setup.dist \
124 Modules/getpath.c \
125 setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
126
127 # fix os.utime() on hppa. utimes it not supported but unfortunately reported 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 ewarn "You have configured Python without XML support."
162 ewarn "This is NOT a recommended configuration as you"
163 ewarn "may face problems parsing any XML documents."
164 fi
165
166 einfo "Disabled modules: $PYTHON_DISABLE_MODULES"
167
168 export OPT="${CFLAGS}"
169
170 local myconf
171
172 # super-secret switch. don't use this unless you know what you're
173 # doing. enabling UCS2 support will break your existing python
174 # modules
175 use ucs2 \
176 && myconf="${myconf} --enable-unicode=ucs2" \
177 || myconf="${myconf} --enable-unicode=ucs4"
178
179 filter-flags -malign-double
180
181 # Seems to no longer be necessary
182 #[ "${ARCH}" = "amd64" ] && append-flags -fPIC
183 [ "${ARCH}" = "alpha" ] && append-flags -fPIC
184
185 # http://bugs.gentoo.org/show_bug.cgi?id=50309
186 if is-flag -O3; then
187 is-flag -fstack-protector-all && replace-flags -O3 -O2
188 use hardened && replace-flags -O3 -O2
189 fi
190
191 if tc-is-cross-compiler ; then
192 OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \
193 ./configure || die "cross-configure failed"
194 emake python Parser/pgen || die "cross-make failed"
195 mv python hostpython
196 mv Parser/pgen Parser/hostpgen
197 make distclean
198 sed -i \
199 -e '/^HOSTPYTHON/s:=.*:=./hostpython:' \
200 -e '/^HOSTPGEN/s:=.*:=./Parser/hostpgen:' \
201 Makefile.pre.in || die "sed failed"
202 fi
203
204 # export CXX so it ends up in /usr/lib/python2.x/config/Makefile
205 tc-export CXX
206
207 # set LDFLAGS so we link modules with -lpython2.5 correctly.
208 # Needed on FreeBSD unless python2.5 is already installed.
209 # Please query BSD team before removing this!
210 append-ldflags "-L."
211
212 econf \
213 --with-fpectl \
214 --enable-shared \
215 $(use_enable ipv6) \
216 $(use_with threads) \
217 --infodir='${prefix}'/share/info \
218 --mandir='${prefix}'/share/man \
219 --with-libc='' \
220 ${myconf}
221 }
222
223 src_install() {
224 dodir /usr
225 emake DESTDIR="${D}" altinstall maninstall || die
226
227 mv "${D}"/usr/bin/python${PYVER}-config "${D}"/usr/bin/python-config-${PYVER}
228
229 # Fix slotted collisions
230 mv "${D}"/usr/bin/2to3 "${D}"/usr/bin/2to3-${PYVER}
231 mv "${D}"/usr/bin/pydoc "${D}"/usr/bin/pydoc${PYVER}
232 mv "${D}"/usr/bin/idle "${D}"/usr/bin/idle${PYVER}
233 mv "${D}"/usr/share/man/man1/python.1 \
234 "${D}"/usr/share/man/man1/python${PYVER}.1
235 rm -f "${D}"/usr/bin/smtpd.py
236
237 # While we're working on the config stuff... Let's fix the OPT var
238 # so that it doesn't have any opts listed in it. Prevents the problem
239 # with compiling things with conflicting opts later.
240 dosed -e 's:^OPT=.*:OPT=-DNDEBUG:' \
241 /usr/$(get_libdir)/python${PYVER}/config/Makefile
242
243 if use build ; then
244 rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/{test,encodings,email,lib-tk,bsddb/test}
245 else
246 use elibc_uclibc && rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/{test,bsddb/test}
247 use berkdb || rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/bsddb
248 use tk || rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/lib-tk
249 fi
250
251 prep_ml_includes usr/include/python${PYVER}
252
253 # The stuff below this line extends from 2.1, and should be deprecated
254 # in 2.3, or possibly can wait till 2.4
255
256 # seems like the build do not install Makefile.pre.in anymore
257 # it probably shouldn't - use DistUtils, people!
258 insinto /usr/$(get_libdir)/python${PYVER}/config
259 doins "${S}"/Makefile.pre.in
260
261 if use examples ; then
262 insinto /usr/share/doc/${PF}/examples
263 doins -r "${S}"/Tools || die "doins failed"
264 fi
265
266 newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT}
267 newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT}
268
269 # Installs empty directory.
270 rmdir "${D}"/usr/$(get_libdir)/${PN}${PV}/lib-old
271 }
272
273 pkg_postrm() {
274 eselect python update --ignore 3.0
275 python_mod_cleanup /usr/$(get_libdir)/python${PYVER}
276 }
277
278 pkg_postinst() {
279 eselect python update --ignore 3.0
280 python_version
281
282 python_mod_optimize -x "(site-packages|test)" \
283 /usr/$(get_libdir)/python${PYVER}
284 }
285
286 src_test() {
287 # Tests won't work when cross compiling
288 if tc-is-cross-compiler ; then
289 elog "Disabling tests due to crosscompiling."
290 return
291 fi
292
293 # Byte compiling should be enabled here.
294 # Otherwise test_import fails.
295 python_enable_pyc
296
297 #skip all tests that fail during emerge but pass without emerge:
298 #(See bug# 67970)
299 local skip_tests="distutils global httpservers mimetools minidom mmap posix pyexpat sax strptime subprocess syntax tcl time urllib urllib2 webbrowser xml_etree"
300
301 # test_pow fails on alpha.
302 # http://bugs.python.org/issue756093
303 [[ ${ARCH} == "alpha" ]] && skip_tests="${skip_tests} pow"
304
305 for test in ${skip_tests} ; do
306 mv "${S}"/Lib/test/test_${test}.py "${T}"
307 done
308
309 # rerun failed tests in verbose mode (regrtest -w)
310 EXTRATESTOPTS="-w" make test || die "make test failed"
311
312 for test in ${skip_tests} ; do
313 mv "${T}"/test_${test}.py "${S}"/Lib/test/test_${test}.py
314 done
315
316 elog "Portage skipped the following tests which aren't able to run from emerge:"
317 for test in ${skip_tests} ; do
318 elog "test_${test}.py"
319 done
320
321 elog "If you'd like to run them, you may:"
322 elog "cd /usr/lib/python${PYVER}/test"
323 elog "and run the tests separately."
324 }