Gentoo Archives: gentoo-commits

From: "Patrick McLean (chutzpah)" <chutzpah@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-lang/python: python-3.3.2.ebuild ChangeLog python-3.3.0.ebuild python-3.3.0-r1.ebuild
Date: Tue, 21 May 2013 21:23:39
Message-Id: 20130521212334.DE5C12171D@flycatcher.gentoo.org
1 chutzpah 13/05/21 21:23:34
2
3 Modified: ChangeLog
4 Added: python-3.3.2.ebuild
5 Removed: python-3.3.0.ebuild python-3.3.0-r1.ebuild
6 Log:
7 Version bump to 3.3.2, re-add keywords from 3.2 (unmask python 3.3).
8
9 (Portage version: 2.1.12.1/cvs/Linux x86_64, signed Manifest commit with key 5C350883)
10
11 Revision Changes Path
12 1.658 dev-lang/python/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/ChangeLog?rev=1.658&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/ChangeLog?rev=1.658&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/ChangeLog?r1=1.657&r2=1.658
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v
21 retrieving revision 1.657
22 retrieving revision 1.658
23 diff -u -r1.657 -r1.658
24 --- ChangeLog 18 May 2013 13:13:35 -0000 1.657
25 +++ ChangeLog 21 May 2013 21:23:34 -0000 1.658
26 @@ -1,6 +1,12 @@
27 # ChangeLog for dev-lang/python
28 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
29 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.657 2013/05/18 13:13:35 zorry Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.658 2013/05/21 21:23:34 chutzpah Exp $
31 +
32 +*python-3.3.2 (21 May 2013)
33 +
34 + 21 May 2013; Patrick McLean <chutz@g.o> -python-3.3.0.ebuild,
35 + -python-3.3.0-r1.ebuild, +python-3.3.2.ebuild:
36 + Version bump to 3.3.2, clean out old 3.3 versions preparing for unmasking.
37
38 18 May 2013; Magnus Granberg <zorry@g.o> python-2.7.4.ebuild,
39 python-3.2.4.ebuild, python-3.3.1.ebuild:
40
41
42
43 1.1 dev-lang/python/python-3.3.2.ebuild
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-3.3.2.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-3.3.2.ebuild?rev=1.1&content-type=text/plain
47
48 Index: python-3.3.2.ebuild
49 ===================================================================
50 # Copyright 1999-2013 Gentoo Foundation
51 # Distributed under the terms of the GNU General Public License v2
52 # $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-3.3.2.ebuild,v 1.1 2013/05/21 21:23:34 chutzpah Exp $
53
54 EAPI="3"
55 WANT_AUTOMAKE="none"
56 WANT_LIBTOOL="none"
57
58 inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing
59
60 MY_P="Python-${PV}"
61 PATCHSET_REVISION="1"
62
63 DESCRIPTION="An interpreted, interactive, object-oriented programming language"
64 HOMEPAGE="http://www.python.org/"
65 SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz
66 mirror://gentoo/python-gentoo-patches-${PV}-${PATCHSET_REVISION}.tar.xz"
67
68 LICENSE="PSF-2"
69 SLOT="3.3"
70 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
71 IUSE="build doc elibc_uclibc examples gdbm hardened ipv6 +ncurses +readline sqlite +ssl +threads tk wininst +xml"
72
73 # Do not add a dependency on dev-lang/python to this ebuild.
74 # If you need to apply a patch which requires python for bootstrapping, please
75 # run the bootstrap code on your dev box and include the results in the
76 # patchset. See bug 447752.
77
78 RDEPEND="app-arch/bzip2
79 >=sys-libs/zlib-1.1.3
80 virtual/libffi
81 virtual/libintl
82 !build? (
83 gdbm? ( sys-libs/gdbm[berkdb] )
84 ncurses? (
85 >=sys-libs/ncurses-5.2
86 readline? ( >=sys-libs/readline-4.1 )
87 )
88 sqlite? ( >=dev-db/sqlite-3.3.8:3[extensions] )
89 ssl? ( dev-libs/openssl )
90 tk? (
91 >=dev-lang/tk-8.0
92 dev-tcltk/blt
93 )
94 xml? ( >=dev-libs/expat-2.1 )
95 )
96 !!<sys-apps/sandbox-2.6-r1"
97 DEPEND="${RDEPEND}
98 virtual/pkgconfig
99 >=sys-devel/autoconf-2.65
100 !sys-devel/gcc[libffi]"
101 RDEPEND+=" !build? ( app-misc/mime-types )
102 doc? ( dev-python/python-docs:${SLOT} )"
103 PDEPEND="app-admin/eselect-python
104 app-admin/python-updater"
105
106 S="${WORKDIR}/${MY_P}"
107
108 src_prepare() {
109 # Ensure that internal copies of expat, libffi and zlib are not used.
110 rm -fr Modules/expat
111 rm -fr Modules/_ctypes/libffi*
112 rm -fr Modules/zlib
113
114 EPATCH_SUFFIX="patch" epatch "${WORKDIR}/${PV}-${PATCHSET_REVISION}"
115
116 sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
117 Lib/distutils/command/install.py \
118 Lib/distutils/sysconfig.py \
119 Lib/site.py \
120 Lib/sysconfig.py \
121 Lib/test/test_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 # Disable ABI flags.
128 sed -e "s/ABIFLAGS=\"\${ABIFLAGS}.*\"/:/" -i configure.ac || die "sed failed"
129
130 epatch_user
131
132 eautoconf
133 eautoheader
134 }
135
136 src_configure() {
137 if use build; then
138 # Disable extraneous modules with extra dependencies.
139 export PYTHON_DISABLE_MODULES="gdbm _curses _curses_panel readline _sqlite3 _tkinter _elementtree pyexpat"
140 export PYTHON_DISABLE_SSL="1"
141 else
142 local disable
143 use gdbm || disable+=" gdbm"
144 use ncurses || disable+=" _curses _curses_panel"
145 use readline || disable+=" readline"
146 use sqlite || disable+=" _sqlite3"
147 use ssl || export PYTHON_DISABLE_SSL="1"
148 use tk || disable+=" _tkinter"
149 use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
150 export PYTHON_DISABLE_MODULES="${disable}"
151
152 if ! use xml; then
153 ewarn "You have configured Python without XML support."
154 ewarn "This is NOT a recommended configuration as you"
155 ewarn "may face problems parsing any XML documents."
156 fi
157 fi
158
159 if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
160 einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
161 fi
162
163 if [[ "$(gcc-major-version)" -ge 4 ]]; then
164 append-flags -fwrapv
165 fi
166
167 filter-flags -malign-double
168
169 [[ "${ARCH}" == "alpha" ]] && append-flags -fPIC
170
171 # https://bugs.gentoo.org/show_bug.cgi?id=50309
172 if is-flagq -O3; then
173 is-flagq -fstack-protector-all && replace-flags -O3 -O2
174 use hardened && replace-flags -O3 -O2
175 fi
176
177 # Run the configure scripts in parallel.
178 multijob_init
179
180 mkdir -p "${WORKDIR}"/{${CBUILD},${CHOST}}
181
182 if tc-is-cross-compiler; then
183 (
184 multijob_child_init
185 cd "${WORKDIR}"/${CBUILD} >/dev/null
186 OPT="-O1" CFLAGS="" CPPFLAGS="" LDFLAGS="" CC="" \
187 "${S}"/configure \
188 --{build,host}=${CBUILD} \
189 || die "cross-configure failed"
190 ) &
191 multijob_post_fork
192
193 # The configure script assumes it's buggy when cross-compiling.
194 export ac_cv_buggy_getaddrinfo=no
195 export ac_cv_have_long_long_format=yes
196 fi
197
198 # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
199 tc-export CXX
200 # The configure script fails to use pkg-config correctly.
201 # http://bugs.python.org/issue15506
202 export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG)
203
204 # Set LDFLAGS so we link modules with -lpython3.2 correctly.
205 # Needed on FreeBSD unless Python 3.2 is already installed.
206 # Please query BSD team before removing this!
207 append-ldflags "-L."
208
209 local dbmliborder
210 if use gdbm; then
211 dbmliborder+="${dbmliborder:+:}gdbm"
212 fi
213
214 cd "${WORKDIR}"/${CHOST}
215 ECONF_SOURCE=${S} OPT="" \
216 econf \
217 --with-fpectl \
218 --enable-shared \
219 $(use_enable ipv6) \
220 $(use_with threads) \
221 --infodir='${prefix}/share/info' \
222 --mandir='${prefix}/share/man' \
223 --with-computed-gotos \
224 --with-dbmliborder="${dbmliborder}" \
225 --with-libc="" \
226 --enable-loadable-sqlite-extensions \
227 --with-system-expat \
228 --with-system-ffi
229
230 if tc-is-cross-compiler; then
231 # Modify the Makefile.pre so we don't regen for the host/ one.
232 # We need to link the host python programs into $PWD and run
233 # them from here because the distutils sysconfig module will
234 # parse Makefile/etc... from argv[0], and we need it to pick
235 # up the target settings, not the host ones.
236 sed -i \
237 -e '1iHOSTPYTHONPATH = ./hostpythonpath:' \
238 -e '/^HOSTPYTHON/s:=.*:= ./hostpython:' \
239 -e '/^HOSTPGEN/s:=.*:= ./Parser/hostpgen:' \
240 Makefile{.pre,} || die "sed failed"
241 fi
242
243 multijob_finish
244 }
245
246 src_compile() {
247 if tc-is-cross-compiler; then
248 cd "${WORKDIR}"/${CBUILD}
249 # Disable as many modules as possible -- but we need a few to install.
250 PYTHON_DISABLE_MODULES=$(
251 sed -n "/Extension('/{s:^.*Extension('::;s:'.*::;p}" "${S}"/setup.py | \
252 egrep -v '(unicodedata|time|cStringIO|_struct|binascii)'
253 ) \
254 PTHON_DISABLE_SSL="1" \
255 SYSROOT= \
256 emake || die "cross-make failed"
257 # See comment in src_configure about these.
258 ln python ../${CHOST}/hostpython || die
259 ln Parser/pgen ../${CHOST}/Parser/hostpgen || die
260 ln -s ../${CBUILD}/build/lib.*/ ../${CHOST}/hostpythonpath || die
261 fi
262
263 cd "${WORKDIR}"/${CHOST}
264 emake CPPFLAGS="" CFLAGS="" LDFLAGS="" || die "emake failed"
265
266 # Work around bug 329499. See also bug 413751 and 457194.
267 if has_version dev-libs/libffi[pax_kernel]; then
268 pax-mark E python
269 else
270 pax-mark m python
271 fi
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 cd "${WORKDIR}"/${CHOST}
282
283 # Skip failing tests.
284 local skipped_tests="gdb"
285
286 for test in ${skipped_tests}; do
287 mv "${S}"/Lib/test/test_${test}.py "${T}"
288 done
289
290 # Rerun failed tests in verbose mode (regrtest -w).
291 PYTHONDONTWRITEBYTECODE="" emake test EXTRATESTOPTS="-w" CPPFLAGS="" CFLAGS="" LDFLAGS="" < /dev/tty
292 local result="$?"
293
294 for test in ${skipped_tests}; do
295 mv "${T}/test_${test}.py" "${S}"/Lib/test
296 done
297
298 elog "The following tests have been skipped:"
299 for test in ${skipped_tests}; do
300 elog "test_${test}.py"
301 done
302
303 elog "If you would like to run them, you may:"
304 elog "cd '${EPREFIX}/usr/$(get_libdir)/python${SLOT}/test'"
305 elog "and run the tests separately."
306
307 if [[ "${result}" -ne 0 ]]; then
308 die "emake test failed"
309 fi
310 }
311
312 src_install() {
313 local libdir=${ED}/usr/$(get_libdir)/python${SLOT}
314
315 cd "${WORKDIR}"/${CHOST}
316 emake DESTDIR="${D}" altinstall || die "emake altinstall failed"
317
318 sed \
319 -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
320 -e "s/\(PY_LDFLAGS=\).*/\1/" \
321 -i "${libdir}/config-${SLOT}/Makefile" || die "sed failed"
322
323 # Backwards compat with Gentoo divergence.
324 dosym python${SLOT}-config /usr/bin/python-config-${SLOT} || die
325
326 # Fix collisions between different slots of Python.
327 rm -f "${ED}usr/$(get_libdir)/libpython3.so"
328
329 if use build; then
330 rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,sqlite3,test,tkinter}
331 else
332 use elibc_uclibc && rm -fr "${libdir}/test"
333 use sqlite || rm -fr "${libdir}/"{sqlite3,test/test_sqlite*}
334 use tk || rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,tkinter,test/test_tk*}
335 fi
336
337 use threads || rm -fr "${libdir}/multiprocessing"
338 use wininst || rm -f "${libdir}/distutils/command/"wininst-*.exe
339
340 dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS} || die "dodoc failed"
341
342 if use examples; then
343 insinto /usr/share/doc/${PF}/examples
344 find "${S}"/Tools -name __pycache__ -print0 | xargs -0 rm -fr
345 doins -r "${S}"/Tools || die "doins failed"
346 fi
347 insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
348 local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
349 emake --no-print-directory -s -f - 2>/dev/null)
350 newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
351
352 newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} || die "newconfd failed"
353 newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT} || die "newinitd failed"
354 sed \
355 -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \
356 -e "s:@PYDOC@:pydoc${SLOT}:" \
357 -i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed"
358
359 # for python-exec
360 python_export python${SLOT} EPYTHON PYTHON PYTHON_SITEDIR
361
362 # if not using a cross-compiler, use the fresh binary
363 if ! tc-is-cross-compiler; then
364 local PYTHON=./python \
365 LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}.
366 export LD_LIBRARY_PATH
367 fi
368
369 echo "EPYTHON='${EPYTHON}'" > epython.py
370 python_domodule epython.py
371 }
372
373 pkg_preinst() {
374 if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version ">=${CATEGORY}/${PN}-${SLOT}_alpha"; then
375 python_updater_warning="1"
376 fi
377 }
378
379 eselect_python_update() {
380 if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
381 eselect python update
382 fi
383
384 if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
385 eselect python update --python${PV%%.*}
386 fi
387 }
388
389 pkg_postinst() {
390 eselect_python_update
391
392 if [[ "${python_updater_warning}" == "1" ]]; then
393 ewarn "You have just upgraded from an older version of Python."
394 ewarn "You should switch active version of Python ${PV%%.*} and run"
395 ewarn "'python-updater [options]' to rebuild Python modules."
396 fi
397 }
398
399 pkg_postrm() {
400 eselect_python_update
401 }