Gentoo Archives: gentoo-commits

From: "Arfrever Frehtes Taifersar Arahesis (arfrever)" <arfrever@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-lang/python: ChangeLog python-3.1.ebuild
Date: Sat, 01 Aug 2009 21:47:35
Message-Id: E1MXMQO-0002QD-8m@stork.gentoo.org
1 arfrever 09/08/01 21:47:32
2
3 Modified: ChangeLog
4 Added: python-3.1.ebuild
5 Log:
6 Version bump (bug #250186).
7 (Portage version: 13870-svn/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.398 dev-lang/python/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/ChangeLog?rev=1.398&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/ChangeLog?rev=1.398&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/ChangeLog?r1=1.397&r2=1.398
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v
19 retrieving revision 1.397
20 retrieving revision 1.398
21 diff -u -r1.397 -r1.398
22 --- ChangeLog 1 Aug 2009 08:16:10 -0000 1.397
23 +++ ChangeLog 1 Aug 2009 21:47:32 -0000 1.398
24 @@ -1,6 +1,12 @@
25 # ChangeLog for dev-lang/python
26 # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.397 2009/08/01 08:16:10 zmedico Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.398 2009/08/01 21:47:32 arfrever Exp $
29 +
30 +*python-3.1 (01 Aug 2009)
31 +
32 + 01 Aug 2009; Arfrever Frehtes Taifersar Arahesis <arfrever@g.o>
33 + +python-3.1.ebuild:
34 + Version bump (bug #250186).
35
36 01 Aug 2009; Zac Medico <zmedico@g.o> python-2.6.2-r1.ebuild:
37 Bug #248081 - Fix tests not to assume that stdin is a tty.
38
39
40
41 1.1 dev-lang/python/python-3.1.ebuild
42
43 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/python-3.1.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/python/python-3.1.ebuild?rev=1.1&content-type=text/plain
45
46 Index: python-3.1.ebuild
47 ===================================================================
48 # Copyright 1999-2009 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-3.1.ebuild,v 1.1 2009/08/01 21:47:32 arfrever Exp $
51
52 EAPI="2"
53
54 inherit autotools eutils flag-o-matic multilib pax-utils python toolchain-funcs versionator
55
56 # We need this so that we don't depends on python.eclass
57 PYVER_MAJOR=$(get_major_version)
58 PYVER_MINOR=$(get_version_component_range 2)
59 PYVER="${PYVER_MAJOR}.${PYVER_MINOR}"
60
61 MY_P="Python-${PV}"
62 S="${WORKDIR}/${MY_P}"
63
64 DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language."
65 HOMEPAGE="http://www.python.org/"
66 SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.bz2
67 mirror://gentoo/python-gentoo-patches-${PV}.tar.bz2"
68
69 LICENSE="PSF-2.2"
70 SLOT="3.1"
71 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
72 IUSE="build doc elibc_uclibc examples gdbm ipv6 ncurses readline sqlite ssl +threads tk ucs2 wininst +xml"
73
74 DEPEND=">=app-admin/eselect-python-20080925
75 >=sys-libs/zlib-1.1.3
76 !build? (
77 sqlite? ( >=dev-db/sqlite-3 )
78 tk? ( >=dev-lang/tk-8.0 )
79 ncurses? ( >=sys-libs/ncurses-5.2
80 readline? ( >=sys-libs/readline-4.1 ) )
81 gdbm? ( sys-libs/gdbm )
82 ssl? ( dev-libs/openssl )
83 doc? ( dev-python/python-docs:${SLOT} )
84 xml? ( dev-libs/expat )
85 )"
86 RDEPEND="${DEPEND}"
87 PDEPEND="${DEPEND} app-admin/python-updater"
88
89 PROVIDE="virtual/python"
90
91 src_prepare() {
92 if ! tc-is-cross-compiler; then
93 rm "${WORKDIR}/${PV}"/*_all_crosscompile.patch
94 fi
95
96 EPATCH_SUFFIX="patch" epatch "${WORKDIR}/${PV}"
97
98 sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
99 Lib/distutils/command/install.py \
100 Lib/distutils/sysconfig.py \
101 Lib/site.py \
102 Makefile.pre.in \
103 Modules/Setup.dist \
104 Modules/getpath.c \
105 setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
106
107 # Fix os.utime() on hppa. utimes it not supported but unfortunately reported as working - gmsoft (22 May 04)
108 # PLEASE LEAVE THIS FIX FOR NEXT VERSIONS AS IT'S A CRITICAL FIX !!!
109 [[ "${ARCH}" == "hppa" ]] && sed -e "s/utimes //" -i "${S}/configure"
110
111 if ! use wininst; then
112 # Remove Microsoft Windows executables.
113 rm Lib/distutils/command/wininst-*.exe
114 fi
115
116 # Don't silence output of setup.py.
117 sed -e '/setup\.py -q build/d' -i Makefile.pre.in
118
119 # Fix OtherFileTests.testStdin() not to assume
120 # that stdin is a tty for bug #248081.
121 sed -e "s:'osf1V5':'osf1V5' and sys.stdin.isatty():" -i Lib/test/test_file.py || die "sed failed"
122
123 eautoreconf
124 }
125
126 src_configure() {
127 # Disable extraneous modules with extra dependencies.
128 if use build; then
129 export PYTHON_DISABLE_MODULES="readline pyexpat gdbm _curses _curses_panel _tkinter _sqlite3"
130 export PYTHON_DISABLE_SSL=1
131 else
132 local disable
133 use xml || disable="${disable} pyexpat"
134 use gdbm || disable="${disable} gdbm"
135 use ncurses || disable="${disable} _curses _curses_panel"
136 use readline || disable="${disable} readline"
137 use sqlite || disable="${disable} sqlite3"
138 use ssl || export PYTHON_DISABLE_SSL=1
139 use tk || disable="${disable} _tkinter"
140 export PYTHON_DISABLE_MODULES="${disable}"
141 fi
142
143 if ! use xml; then
144 ewarn "You have configured Python without XML support."
145 ewarn "This is NOT a recommended configuration as you"
146 ewarn "may face problems parsing any XML documents."
147 fi
148
149 einfo "Disabled modules: $PYTHON_DISABLE_MODULES"
150
151 export OPT="${CFLAGS}"
152
153 filter-flags -malign-double
154
155 [[ "${ARCH}" == "alpha" ]] && append-flags -fPIC
156
157 # https://bugs.gentoo.org/show_bug.cgi?id=50309
158 if is-flag -O3; then
159 is-flag -fstack-protector-all && replace-flags -O3 -O2
160 use hardened && replace-flags -O3 -O2
161 fi
162
163 if tc-is-cross-compiler; then
164 OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \
165 ./configure --{build,host}=${CBUILD} || die "cross-configure failed"
166 emake python Parser/pgen || die "cross-make failed"
167 mv python hostpython
168 mv Parser/pgen Parser/hostpgen
169 make distclean
170 sed -i \
171 -e "/^HOSTPYTHON/s:=.*:=./hostpython:" \
172 -e "/^HOSTPGEN/s:=.*:=./Parser/hostpgen:" \
173 Makefile.pre.in || die "sed failed"
174 fi
175
176 # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
177 tc-export CXX
178
179 # Set LDFLAGS so we link modules with -lpython3.1 correctly.
180 # Needed on FreeBSD unless Python 3.1 is already installed.
181 # Please query BSD team before removing this!
182 append-ldflags "-L."
183
184 local dbmliborder
185 if use gdbm; then
186 dbmliborder+=":gdbm"
187 fi
188 dbmliborder="${dbmliborder#:}"
189
190 econf \
191 --with-fpectl \
192 --enable-shared \
193 $(use_enable ipv6) \
194 $(use_with threads) \
195 $(use_with !ucs2 wide-unicode) \
196 --infodir='${prefix}'/share/info \
197 --mandir='${prefix}'/share/man \
198 --with-libc='' \
199 --with-dbmliborder=${dbmliborder}
200 }
201
202 src_test() {
203 # Tests won't work when cross compiling.
204 if tc-is-cross-compiler; then
205 elog "Disabling tests due to crosscompiling."
206 return
207 fi
208
209 # Byte compiling should be enabled here.
210 # Otherwise test_import fails.
211 python_enable_pyc
212
213 # Skip all tests that fail during emerge but pass without emerge:
214 # (See bug #67970)
215 local skip_tests="distutils"
216
217 # test_pow fails on alpha.
218 # http://bugs.python.org/issue756093
219 [[ ${ARCH} == "alpha" ]] && skip_tests+=" pow"
220
221 # test_ctypes fails with PAX kernel (bug #234498).
222 host-is-pax && skip_tests+=" ctypes"
223
224 for test in ${skip_tests}; do
225 mv "${S}"/Lib/test/test_${test}.py "${T}"
226 done
227
228 # Rerun failed tests in verbose mode (regrtest -w).
229 EXTRATESTOPTS="-w" make test || die "make test failed"
230
231 for test in ${skip_tests}; do
232 mv "${T}"/test_${test}.py "${S}"/Lib/test/test_${test}.py
233 done
234
235 elog "Portage skipped the following tests which aren't able to run from emerge:"
236 for test in ${skip_tests}; do
237 elog "test_${test}.py"
238 done
239
240 elog "If you'd like to run them, you may:"
241 elog "cd /usr/$(get_libdir)/python${PYVER}/test"
242 elog "and run the tests separately."
243 }
244
245 src_install() {
246 emake DESTDIR="${D}" altinstall || die "emake altinstall failed"
247
248 mv "${D}"/usr/bin/python${PYVER}-config "${D}"/usr/bin/python-config-${PYVER}
249
250 # Fix slotted collisions.
251 mv "${D}"/usr/bin/2to3 "${D}"/usr/bin/2to3-${PYVER}
252 mv "${D}"/usr/bin/pydoc3 "${D}"/usr/bin/pydoc${PYVER}
253 mv "${D}"/usr/bin/idle3 "${D}"/usr/bin/idle${PYVER}
254 rm -f "${D}"/usr/bin/smtpd.py
255
256 # Fix the OPT variable so that it doesn't have any flags listed in it.
257 # Prevents the problem with compiling things with conflicting flags later.
258 sed -e "s:^OPT=.*:OPT=-DNDEBUG:" -i "${D}usr/$(get_libdir)/python${PYVER}/config/Makefile"
259
260 if use build; then
261 rm -fr "${D}"/usr/$(get_libdir)/python${PYVER}/{test,encodings,email,lib-tk}
262 else
263 use elibc_uclibc && rm -fr "${D}"/usr/$(get_libdir)/python${PYVER}/test
264 use tk || rm -fr "${D}"/usr/$(get_libdir)/python${PYVER}/lib-tk
265 fi
266
267 prep_ml_includes usr/include/python${PYVER}
268
269 if use examples; then
270 insinto /usr/share/doc/${PF}/examples
271 doins -r "${S}"/Tools || die "doins failed"
272 fi
273
274 newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT}
275 newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT}
276 }
277
278 pkg_postrm() {
279 eselect python update --ignore 3.0 --ignore 3.1
280
281 python_mod_cleanup /usr/lib/python${PYVER}
282 [[ "$(get_libdir)" != "lib" ]] && python_mod_cleanup /usr/$(get_libdir)/python${PYVER}
283 }
284
285 pkg_postinst() {
286 # Update symlink temporarily for byte-compiling.
287 eselect python update
288
289 python_mod_optimize -x "(site-packages|test)" /usr/lib/python${PYVER}
290 [[ "$(get_libdir)" != "lib" ]] && python_mod_optimize -x "(site-packages|test)" /usr/$(get_libdir)/python${PYVER}
291
292 # Update symlink back to old version.
293 # Remove this after testing is done.
294 eselect python update --ignore 3.0 --ignore 3.1
295
296 ewarn
297 ewarn "WARNING!"
298 ewarn "Many Python modules haven't been ported yet to Python 3.*."
299 ewarn "/usr/bin/python hasn't been updated and still references your old Python installation."
300 ewarn
301 ebeep
302 }