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.3-r1.ebuild
Date: Mon, 21 Feb 2011 22:19:45
Message-Id: 20110221221936.37FFB20054@flycatcher.gentoo.org
1 arfrever 11/02/21 22:19:36
2
3 Modified: ChangeLog
4 Added: python-3.1.3-r1.ebuild
5 Log:
6 Fix regression in unicodedata.normalize() (Python issue #10254). Fix NameError in logging.handlers.TimedRotatingFileHandler.__init__() (Gentoo bug #350400, Python issue #10810). Don't skip test_ctypes tests on hardened/PAX (Gentoo bug #348745).
7
8 (Portage version: 2.2.0_alpha24_p17/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.519 dev-lang/python/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/ChangeLog?rev=1.519&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/ChangeLog?rev=1.519&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/ChangeLog?r1=1.518&r2=1.519
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v
20 retrieving revision 1.518
21 retrieving revision 1.519
22 diff -u -r1.518 -r1.519
23 --- ChangeLog 21 Feb 2011 22:16:57 -0000 1.518
24 +++ ChangeLog 21 Feb 2011 22:19:36 -0000 1.519
25 @@ -1,6 +1,15 @@
26 # ChangeLog for dev-lang/python
27 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.518 2011/02/21 22:16:57 arfrever Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.519 2011/02/21 22:19:36 arfrever Exp $
30 +
31 +*python-3.1.3-r1 (21 Feb 2011)
32 +
33 + 21 Feb 2011; Arfrever Frehtes Taifersar Arahesis <arfrever@g.o>
34 + -python-3.1.3.ebuild, +python-3.1.3-r1.ebuild:
35 + Fix regression in unicodedata.normalize() (Python issue #10254). Fix
36 + NameError in logging.handlers.TimedRotatingFileHandler.__init__() (Gentoo bug
37 + #350400, Python issue #10810). Don't skip test_ctypes tests on hardened/PAX
38 + (Gentoo bug #348745).
39
40 *python-2.7.1-r1 (21 Feb 2011)
41
42
43
44
45 1.1 dev-lang/python/python-3.1.3-r1.ebuild
46
47 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-3.1.3-r1.ebuild?rev=1.1&view=markup
48 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-3.1.3-r1.ebuild?rev=1.1&content-type=text/plain
49
50 Index: python-3.1.3-r1.ebuild
51 ===================================================================
52 # Copyright 1999-2011 Gentoo Foundation
53 # Distributed under the terms of the GNU General Public License v2
54 # $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-3.1.3-r1.ebuild,v 1.1 2011/02/21 22:19:36 arfrever Exp $
55
56 EAPI="3"
57 WANT_AUTOMAKE="none"
58
59 inherit autotools eutils flag-o-matic multilib python toolchain-funcs
60
61 if [[ "${PV}" == *_pre* ]]; then
62 inherit subversion
63
64 ESVN_PROJECT="python"
65 ESVN_REPO_URI="http://svn.python.org/projects/python/branches/release31-maint"
66 ESVN_REVISION=""
67 else
68 MY_PV="${PV%_p*}"
69 MY_P="Python-${MY_PV}"
70 fi
71
72 PATCHSET_REVISION="1"
73
74 DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language."
75 HOMEPAGE="http://www.python.org/"
76 if [[ "${PV}" == *_pre* ]]; then
77 SRC_URI=""
78 else
79 SRC_URI="http://www.python.org/ftp/python/${MY_PV}/${MY_P}.tar.bz2
80 mirror://gentoo/python-gentoo-patches-${MY_PV}$([[ "${PATCHSET_REVISION}" != "0" ]] && echo "-r${PATCHSET_REVISION}").tar.bz2"
81 fi
82
83 LICENSE="PSF-2.2"
84 SLOT="3.1"
85 PYTHON_ABI="${SLOT}"
86 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
87 IUSE="build doc elibc_uclibc examples gdbm ipv6 +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml"
88
89 RDEPEND=">=app-admin/eselect-python-20091230
90 >=sys-libs/zlib-1.1.3
91 virtual/libffi
92 virtual/libintl
93 !build? (
94 gdbm? ( sys-libs/gdbm )
95 ncurses? (
96 >=sys-libs/ncurses-5.2
97 readline? ( >=sys-libs/readline-4.1 )
98 )
99 sqlite? ( >=dev-db/sqlite-3.3.3:3 )
100 ssl? ( dev-libs/openssl )
101 tk? ( >=dev-lang/tk-8.0 )
102 xml? ( >=dev-libs/expat-2 )
103 )"
104 DEPEND="${RDEPEND}
105 $([[ "${PV}" == *_pre* ]] && echo "=${CATEGORY}/${PN}-${PV%%.*}*")
106 dev-util/pkgconfig
107 $([[ "${PV}" =~ ^[[:digit:]]+\.[[:digit:]]+_pre ]] && echo "doc? ( dev-python/sphinx )")
108 !sys-devel/gcc[libffi]"
109 RDEPEND+=" !build? ( app-misc/mime-types )
110 $([[ "${PV}" =~ ^[[:digit:]]+\.[[:digit:]]+_pre ]] || echo "doc? ( dev-python/python-docs:${SLOT} )")"
111 PDEPEND="app-admin/python-updater"
112
113 PROVIDE="virtual/python"
114
115 if [[ "${PV}" != *_pre* ]]; then
116 S="${WORKDIR}/${MY_P}"
117 fi
118
119 pkg_setup() {
120 python_pkg_setup
121 }
122
123 src_prepare() {
124 # Ensure that internal copies of expat, libffi and zlib are not used.
125 rm -fr Modules/expat
126 rm -fr Modules/_ctypes/libffi*
127 rm -fr Modules/zlib
128
129 if [[ "${PV}" =~ ^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+_pre ]]; then
130 if grep -Eq '#define PY_RELEASE_LEVEL[[:space:]]+PY_RELEASE_LEVEL_FINAL' Include/patchlevel.h; then
131 # Update micro version, release level and version string.
132 local micro_version="${PV%_pre*}"
133 micro_version="${micro_version##*.}"
134 local version_string="${PV%.*}.$((${micro_version} - 1))+"
135 sed \
136 -e "s/\(#define PY_MICRO_VERSION[[:space:]]\+\)[^[:space:]]\+/\1${micro_version}/" \
137 -e "s/\(#define PY_RELEASE_LEVEL[[:space:]]\+\)[^[:space:]]\+/\1PY_RELEASE_LEVEL_ALPHA/" \
138 -e "s/\(#define PY_VERSION[[:space:]]\+\"\)[^\"]\+\(\"\)/\1${version_string}\2/" \
139 -i Include/patchlevel.h || die "sed failed"
140 fi
141 fi
142
143 local excluded_patches
144 if ! tc-is-cross-compiler; then
145 excluded_patches="*_all_crosscompile.patch"
146 fi
147
148 local patchset_dir
149 if [[ "${PV}" == *_pre* ]]; then
150 patchset_dir="${FILESDIR}/${SLOT}-${PATCHSET_REVISION}"
151 else
152 patchset_dir="${WORKDIR}/${MY_PV}"
153 fi
154
155 EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" epatch "${patchset_dir}"
156
157 sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
158 Lib/distutils/command/install.py \
159 Lib/distutils/sysconfig.py \
160 Lib/site.py \
161 Makefile.pre.in \
162 Modules/Setup.dist \
163 Modules/getpath.c \
164 setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
165
166 if ! use wininst; then
167 # Remove Microsoft Windows executables.
168 rm Lib/distutils/command/wininst-*.exe
169 fi
170
171 if [[ "${PV}" == *_pre* ]]; then
172 sed -e "s/\(-DSVNVERSION=\).*\( -o\)/\1\\\\\"${ESVN_REVISION}\\\\\"\2/" -i Makefile.pre.in || die "sed failed"
173 fi
174
175 eautoreconf
176 }
177
178 src_configure() {
179 if use build; then
180 # Disable extraneous modules with extra dependencies.
181 export PYTHON_DISABLE_MODULES="gdbm _curses _curses_panel readline _sqlite3 _tkinter _elementtree pyexpat"
182 export PYTHON_DISABLE_SSL="1"
183 else
184 local disable
185 use gdbm || disable+=" gdbm"
186 use ncurses || disable+=" _curses _curses_panel"
187 use readline || disable+=" readline"
188 use sqlite || disable+=" _sqlite3"
189 use ssl || export PYTHON_DISABLE_SSL="1"
190 use tk || disable+=" _tkinter"
191 use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
192 export PYTHON_DISABLE_MODULES="${disable}"
193
194 if ! use xml; then
195 ewarn "You have configured Python without XML support."
196 ewarn "This is NOT a recommended configuration as you"
197 ewarn "may face problems parsing any XML documents."
198 fi
199 fi
200
201 if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
202 einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
203 fi
204
205 if [[ "$(gcc-major-version)" -ge 4 ]]; then
206 append-flags -fwrapv
207 fi
208
209 filter-flags -malign-double
210
211 [[ "${ARCH}" == "alpha" ]] && append-flags -fPIC
212
213 # https://bugs.gentoo.org/show_bug.cgi?id=50309
214 if is-flagq -O3; then
215 is-flagq -fstack-protector-all && replace-flags -O3 -O2
216 use hardened && replace-flags -O3 -O2
217 fi
218
219 if tc-is-cross-compiler; then
220 OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \
221 ./configure --{build,host}=${CBUILD} || die "cross-configure failed"
222 emake python Parser/pgen || die "cross-make failed"
223 mv python hostpython
224 mv Parser/pgen Parser/hostpgen
225 make distclean
226 sed -i \
227 -e "/^HOSTPYTHON/s:=.*:=./hostpython:" \
228 -e "/^HOSTPGEN/s:=.*:=./Parser/hostpgen:" \
229 Makefile.pre.in || die "sed failed"
230 fi
231
232 # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
233 tc-export CXX
234
235 # Set LDFLAGS so we link modules with -lpython3.1 correctly.
236 # Needed on FreeBSD unless Python 3.1 is already installed.
237 # Please query BSD team before removing this!
238 append-ldflags "-L."
239
240 local dbmliborder
241 if use gdbm; then
242 dbmliborder+="${dbmliborder:+:}gdbm"
243 fi
244
245 OPT="" econf \
246 --with-fpectl \
247 --enable-shared \
248 $(use_enable ipv6) \
249 $(use_with threads) \
250 $(use_with wide-unicode) \
251 --infodir='${prefix}/share/info' \
252 --mandir='${prefix}/share/man' \
253 --with-computed-gotos \
254 --with-dbmliborder="${dbmliborder}" \
255 --with-libc="" \
256 --with-system-ffi
257 }
258
259 src_compile() {
260 emake EPYTHON="python${PV%%.*}" || die "emake failed"
261 }
262
263 src_test() {
264 # Tests will not work when cross compiling.
265 if tc-is-cross-compiler; then
266 elog "Disabling tests due to crosscompiling."
267 return
268 fi
269
270 if ! use threads; then
271 ewarn "Disabling tests due to USE=\"-threads\""
272 return
273 fi
274
275 # Byte compiling should be enabled here.
276 # Otherwise test_import fails.
277 python_enable_pyc
278
279 # Skip failing tests.
280 local skip_tests="distutils"
281
282 for test in ${skip_tests}; do
283 mv "${S}/Lib/test/test_${test}.py" "${T}"
284 done
285
286 # Rerun failed tests in verbose mode (regrtest -w).
287 emake test EXTRATESTOPTS="-w" < /dev/tty
288 local result="$?"
289
290 for test in ${skip_tests}; do
291 mv "${T}/test_${test}.py" "${S}/Lib/test/test_${test}.py"
292 done
293
294 elog "The following tests have been skipped:"
295 for test in ${skip_tests}; do
296 elog "test_${test}.py"
297 done
298
299 elog "If you would like to run them, you may:"
300 elog "cd '${EPREFIX}$(python_get_libdir)/test'"
301 elog "and run the tests separately."
302
303 python_disable_pyc
304
305 if [[ "${result}" -ne 0 ]]; then
306 die "emake test failed"
307 fi
308 }
309
310 src_install() {
311 emake DESTDIR="${D}" altinstall || die "emake altinstall failed"
312 python_clean_installation_image -q
313
314 mv "${ED}usr/bin/python${SLOT}-config" "${ED}usr/bin/python-config-${SLOT}"
315
316 # Fix collisions between different slots of Python.
317 mv "${ED}usr/bin/2to3" "${ED}usr/bin/2to3-${SLOT}"
318 mv "${ED}usr/bin/pydoc3" "${ED}usr/bin/pydoc${SLOT}"
319 mv "${ED}usr/bin/idle3" "${ED}usr/bin/idle${SLOT}"
320 rm -f "${ED}usr/bin/smtpd.py"
321
322 if use build; then
323 rm -fr "${ED}usr/bin/idle${SLOT}" "${ED}$(python_get_libdir)/"{idlelib,sqlite3,test,tkinter}
324 else
325 use elibc_uclibc && rm -fr "${ED}$(python_get_libdir)/test"
326 use sqlite || rm -fr "${ED}$(python_get_libdir)/"{sqlite3,test/test_sqlite*}
327 use tk || rm -fr "${ED}usr/bin/idle${SLOT}" "${ED}$(python_get_libdir)/"{idlelib,tkinter,test/test_tk*}
328 fi
329
330 use threads || rm -fr "${ED}$(python_get_libdir)/multiprocessing"
331
332 prep_ml_includes $(python_get_includedir)
333
334 dodoc Misc/{ACKS,HISTORY,NEWS} || die "dodoc failed"
335
336 if use examples; then
337 insinto /usr/share/doc/${PF}/examples
338 doins -r "${S}/Tools" || die "doins failed"
339 fi
340
341 newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT} || die "newinitd failed"
342 newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} || die "newconfd failed"
343 }
344
345 pkg_preinst() {
346 if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version ">=${CATEGORY}/${PN}-${SLOT}_alpha"; then
347 python_updater_warning="1"
348 fi
349 }
350
351 eselect_python_update() {
352 if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
353 eselect python update
354 fi
355
356 if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
357 eselect python update --python${PV%%.*}
358 fi
359 }
360
361 pkg_postinst() {
362 eselect_python_update
363
364 python_mod_optimize -f -x "/(site-packages|test|tests)/" $(python_get_libdir)
365
366 if [[ "${python_updater_warning}" == "1" ]]; then
367 ewarn
368 ewarn "\e[1;31m************************************************************************\e[0m"
369 ewarn
370 ewarn "You have just upgraded from an older version of Python."
371 ewarn "You should run 'python-updater \${options}' to rebuild Python modules."
372 ewarn
373 ewarn "\e[1;31m************************************************************************\e[0m"
374 ewarn
375
376 local n
377 for ((n = 0; n < 12; n++)); do
378 echo -ne "\a"
379 sleep 1
380 done
381 fi
382 }
383
384 pkg_postrm() {
385 eselect_python_update
386
387 python_mod_cleanup $(python_get_libdir)
388 }