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