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.6-r1.ebuild python-2.6.ebuild
Date: Mon, 06 Oct 2008 12:15:27
Message-Id: E1Kmozk-0004Uu-2v@stork.gentoo.org
1 hawking 08/10/06 12:15:24
2
3 Modified: ChangeLog
4 Added: python-2.6-r1.ebuild
5 Removed: python-2.6.ebuild
6 Log:
7 Revbump. Use use_with for threads, remove die from econf, use emake instead of make, remove redundant python_mod_{cleanup,optimize}. Drop old.
8 (Portage version: -svn/cvs/Linux 2.6.26-gentoo x86_64)
9
10 Revision Changes Path
11 1.348 dev-lang/python/ChangeLog
12
13 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/ChangeLog?rev=1.348&view=markup
14 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/ChangeLog?rev=1.348&content-type=text/plain
15 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/ChangeLog?r1=1.347&r2=1.348
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v
20 retrieving revision 1.347
21 retrieving revision 1.348
22 diff -u -r1.347 -r1.348
23 --- ChangeLog 5 Oct 2008 00:55:31 -0000 1.347
24 +++ ChangeLog 6 Oct 2008 12:15:23 -0000 1.348
25 @@ -1,6 +1,13 @@
26 # ChangeLog for dev-lang/python
27 # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.347 2008/10/05 00:55:31 hawking Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.348 2008/10/06 12:15:23 hawking Exp $
30 +
31 +*python-2.6-r1 (06 Oct 2008)
32 +
33 + 06 Oct 2008; Ali Polatel <hawking@g.o> -python-2.6.ebuild,
34 + +python-2.6-r1.ebuild:
35 + Revbump. Use use_with for threads, remove die from econf, use emake
36 + instead of make, remove redundant python_mod_{cleanup,optimize}. Drop old.
37
38 *python-2.6 (05 Oct 2008)
39
40
41
42
43 1.1 dev-lang/python/python-2.6-r1.ebuild
44
45 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/python-2.6-r1.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/python-2.6-r1.ebuild?rev=1.1&content-type=text/plain
47
48 Index: python-2.6-r1.ebuild
49 ===================================================================
50 # Copyright 1999-2008 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.6-r1.ebuild,v 1.1 2008/10/06 12:15:23 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 EAPI=1
60
61 inherit eutils autotools flag-o-matic python multilib versionator toolchain-funcs 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/2.6/${MY_P}.tar.bz2
74 mirror://gentoo/python-gentoo-patches-${PV}.tar.bz2"
75
76 LICENSE="PSF-2.2"
77 SLOT="2.6"
78 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
79 IUSE="ncurses gdbm ssl readline tk berkdb bootstrap 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=">=app-admin/eselect-python-20080630
85 >=sys-libs/zlib-1.1.3
86 !build? (
87 sqlite? ( >=dev-db/sqlite-3 )
88 tk? ( >=dev-lang/tk-8.0 )
89 ncurses? ( >=sys-libs/ncurses-5.2
90 readline? ( >=sys-libs/readline-4.1 ) )
91 berkdb? ( >=sys-libs/db-3.1 )
92 gdbm? ( sys-libs/gdbm )
93 ssl? ( dev-libs/openssl )
94 doc? ( dev-python/python-docs:2.5 )
95 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.6-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 as working - gmsoft (22 May 04)
127 # PLEASE LEAVE THIS FIX FOR NEXT VERSIONS AS IT'S A CRITICAL FIX !!!
128 [ "${ARCH}" = "hppa" ] && sed -e 's/utimes //' -i "${S}"/configure
129
130 if ! use wininst; then
131 # remove microsoft windows executables
132 rm Lib/distutils/command/wininst-*.exe
133 fi
134
135 eautoreconf
136 }
137
138 src_configure() {
139 # disable extraneous modules with extra dependencies
140 if use build; then
141 export PYTHON_DISABLE_MODULES="readline pyexpat dbm gdbm bsddb _curses _curses_panel _tkinter _sqlite3"
142 export PYTHON_DISABLE_SSL=1
143 else
144 # dbm module can link to berkdb or gdbm
145 # defaults to gdbm when both are enabled, #204343
146 local disable
147 use berkdb || use gdbm || disable="${disable} dbm"
148 use berkdb || disable="${disable} bsddb"
149 use gdbm || disable="${disable} gdbm"
150 use ncurses || disable="${disable} _curses _curses_panel"
151 use readline || disable="${disable} readline"
152 use sqlite || disable="${disable} sqlite3"
153 use ssl || export PYTHON_DISABLE_SSL=1
154 use tk || disable="${disable} _tkinter"
155 export PYTHON_DISABLE_MODULES="${disable}"
156 fi
157 einfo "Disabled modules: $PYTHON_DISABLE_MODULES"
158 }
159
160 src_compile() {
161 filter-flags -malign-double
162
163 # Seems to no longer be necessary
164 #[ "${ARCH}" = "amd64" ] && append-flags -fPIC
165 [ "${ARCH}" = "alpha" ] && append-flags -fPIC
166
167 # http://bugs.gentoo.org/show_bug.cgi?id=50309
168 if is-flag -O3; then
169 is-flag -fstack-protector-all && replace-flags -O3 -O2
170 use hardened && replace-flags -O3 -O2
171 fi
172
173 export OPT="${CFLAGS}"
174
175 local myconf
176
177 # super-secret switch. don't use this unless you know what you're
178 # doing. enabling UCS2 support will break your existing python
179 # modules
180 use ucs2 \
181 && myconf="${myconf} --enable-unicode=ucs2" \
182 || myconf="${myconf} --enable-unicode=ucs4"
183
184 src_configure
185
186 if tc-is-cross-compiler ; then
187 OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \
188 ./configure || die "cross-configure failed"
189 emake python Parser/pgen || die "cross-make failed"
190 mv python hostpython
191 mv Parser/pgen Parser/hostpgen
192 make distclean
193 sed -i \
194 -e '/^HOSTPYTHON/s:=.*:=./hostpython:' \
195 -e '/^HOSTPGEN/s:=.*:=./Parser/hostpgen:' \
196 Makefile.pre.in || die
197 fi
198
199 # export CXX so it ends up in /usr/lib/python2.x/config/Makefile
200 tc-export CXX
201
202 # set LDFLAGS so we link modules with -lpython2.5 correctly.
203 # Needed on FreeBSD unless python2.5 is already installed.
204 # Please query BSD team before removing this!
205 append-ldflags "-L."
206
207 econf \
208 --with-fpectl \
209 --enable-shared \
210 $(use_enable ipv6) \
211 $(use_with threads) \
212 --infodir='${prefix}'/share/info \
213 --mandir='${prefix}'/share/man \
214 --with-libc='' \
215 ${myconf}
216 emake || die "Parallel make failed"
217 }
218
219 src_install() {
220 dodir /usr
221 src_configure
222 emake DESTDIR="${D}" altinstall maninstall || die
223
224 mv "${D}"/usr/bin/python${PYVER}-config "${D}"/usr/bin/python-config-${PYVER}
225
226 # Fix slotted collisions
227 mv "${D}"/usr/bin/2to3 "${D}"/usr/bin/2to3-${PYVER}
228 mv "${D}"/usr/bin/pydoc "${D}"/usr/bin/pydoc${PYVER}
229 mv "${D}"/usr/bin/idle "${D}"/usr/bin/idle${PYVER}
230 mv "${D}"/usr/share/man/man1/python.1 \
231 "${D}"/usr/share/man/man1/python${PYVER}.1
232 rm -f "${D}"/usr/bin/smtpd.py
233
234 # While we're working on the config stuff... Let's fix the OPT var
235 # so that it doesn't have any opts listed in it. Prevents the problem
236 # with compiling things with conflicting opts later.
237 dosed -e 's:^OPT=.*:OPT=-DNDEBUG:' \
238 /usr/$(get_libdir)/python${PYVER}/config/Makefile
239
240 if use build ; then
241 rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/{test,encodings,email,lib-tk,bsddb/test}
242 else
243 use elibc_uclibc && rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/{test,bsddb/test}
244 use berkdb || rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/bsddb
245 use tk || rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/lib-tk
246 fi
247
248 prep_ml_includes usr/include/python${PYVER}
249
250 # The stuff below this line extends from 2.1, and should be deprecated
251 # in 2.3, or possibly can wait till 2.4
252
253 # seems like the build do not install Makefile.pre.in anymore
254 # it probably shouldn't - use DistUtils, people!
255 insinto /usr/$(get_libdir)/python${PYVER}/config
256 doins "${S}"/Makefile.pre.in
257
258 if use examples ; then
259 insinto /usr/share/doc/${PF}/examples
260 doins -r "${S}"/Tools || die "doins failed"
261 fi
262
263 newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT}
264 newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT}
265 }
266
267 pkg_postrm() {
268 eselect python update --ignore 3.0
269 python_mod_cleanup /usr/$(get_libdir)/python${PYVER}
270 }
271
272 pkg_postinst() {
273 local myroot
274 myroot="$(echo "${ROOT}" | sed 's:/$::')"
275
276 eselect python update --ignore 3.0
277 python_version
278
279 python_mod_optimize -x "(site-packages|test)" \
280 /usr/$(get_libdir)/python${PYVER}
281 }
282
283 src_test() {
284 # Tests won't work when cross compiling
285 if tc-is-cross-compiler ; then
286 elog "Disabling tests due to crosscompiling."
287 return
288 fi
289
290 # PYTHON_DONTCOMPILE=1 breaks test_import
291 unset PYTHON_DONTCOMPILE
292
293 #skip all tests that fail during emerge but pass without emerge:
294 #(See bug# 67970)
295 local skip_tests="distutils global httpservers mimetools minidom mmap posix pyexpat sax strptime subprocess syntax tcl time urllib urllib2 webbrowser xml_etree"
296
297 # test_pow fails on alpha.
298 # http://bugs.python.org/issue756093
299 [[ ${ARCH} == "alpha" ]] && skip_tests="${skip_tests} pow"
300
301 for test in ${skip_tests} ; do
302 mv "${S}"/Lib/test/test_${test}.py "${T}"
303 done
304
305 # rerun failed tests in verbose mode (regrtest -w)
306 EXTRATESTOPTS="-w" make test || die "make test failed"
307
308 for test in ${skip_tests} ; do
309 mv "${T}"/test_${test}.py "${S}"/Lib/test/test_${test}.py
310 done
311
312 elog "Portage skipped the following tests which aren't able to run from emerge:"
313 for test in ${skip_tests} ; do
314 elog "test_${test}.py"
315 done
316
317 elog "If you'd like to run them, you may:"
318 elog "cd /usr/lib/python${PYVER}/test"
319 elog "and run the tests separately."
320 }