Gentoo Archives: gentoo-commits

From: "Mike Gilbert (floppym)" <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-lang/python: python-2.7.5-r4.ebuild ChangeLog
Date: Sat, 26 Oct 2013 15:11:26
Message-Id: 20131026151121.029BE2004E@flycatcher.gentoo.org
1 floppym 13/10/26 15:11:20
2
3 Modified: ChangeLog
4 Added: python-2.7.5-r4.ebuild
5 Log:
6 Apply patch to fix regression in subprocess module, bug 489378.
7
8 (Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key 0BBEEA1FEA4843A4)
9
10 Revision Changes Path
11 1.711 dev-lang/python/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/ChangeLog?rev=1.711&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/ChangeLog?rev=1.711&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/ChangeLog?r1=1.710&r2=1.711
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v
20 retrieving revision 1.710
21 retrieving revision 1.711
22 diff -u -r1.710 -r1.711
23 --- ChangeLog 16 Oct 2013 23:43:45 -0000 1.710
24 +++ ChangeLog 26 Oct 2013 15:11:20 -0000 1.711
25 @@ -1,6 +1,12 @@
26 # ChangeLog for dev-lang/python
27 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.710 2013/10/16 23:43:45 floppym Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.711 2013/10/26 15:11:20 floppym Exp $
30 +
31 +*python-2.7.5-r4 (26 Oct 2013)
32 +
33 + 26 Oct 2013; Mike Gilbert <floppym@g.o>
34 + +files/python-2.7-issue18851.patch, +python-2.7.5-r4.ebuild:
35 + Apply patch to fix regression in subprocess module, bug 489378.
36
37 *python-2.7.5-r3 (16 Oct 2013)
38 *python-3.2.5-r3 (16 Oct 2013)
39
40
41
42 1.1 dev-lang/python/python-2.7.5-r4.ebuild
43
44 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-2.7.5-r4.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-2.7.5-r4.ebuild?rev=1.1&content-type=text/plain
46
47 Index: python-2.7.5-r4.ebuild
48 ===================================================================
49 # Copyright 1999-2013 Gentoo Foundation
50 # Distributed under the terms of the GNU General Public License v2
51 # $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.7.5-r4.ebuild,v 1.1 2013/10/26 15:11:20 floppym Exp $
52
53 EAPI="4"
54 WANT_AUTOMAKE="none"
55 WANT_LIBTOOL="none"
56
57 inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing
58
59 MY_P="Python-${PV}"
60 PATCHSET_REVISION="0"
61
62 DESCRIPTION="An interpreted, interactive, object-oriented programming language"
63 HOMEPAGE="http://www.python.org/"
64 SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz
65 mirror://gentoo/python-gentoo-patches-${PV}-${PATCHSET_REVISION}.tar.xz"
66
67 LICENSE="PSF-2"
68 SLOT="2.7"
69 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
70 IUSE="-berkdb build doc elibc_uclibc examples gdbm hardened ipv6 +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml"
71
72 # Do not add a dependency on dev-lang/python to this ebuild.
73 # If you need to apply a patch which requires python for bootstrapping, please
74 # run the bootstrap code on your dev box and include the results in the
75 # patchset. See bug 447752.
76
77 RDEPEND="app-arch/bzip2
78 >=sys-libs/zlib-1.1.3
79 virtual/libffi
80 virtual/libintl
81 !build? (
82 berkdb? ( || (
83 sys-libs/db:5.3
84 sys-libs/db:5.2
85 sys-libs/db:5.1
86 sys-libs/db:5.0
87 sys-libs/db:4.8
88 sys-libs/db:4.7
89 sys-libs/db:4.6
90 sys-libs/db:4.5
91 sys-libs/db:4.4
92 sys-libs/db:4.3
93 sys-libs/db:4.2
94 ) )
95 gdbm? ( sys-libs/gdbm[berkdb] )
96 ncurses? (
97 >=sys-libs/ncurses-5.2
98 readline? ( >=sys-libs/readline-4.1 )
99 )
100 sqlite? ( >=dev-db/sqlite-3.3.8:3 )
101 ssl? ( dev-libs/openssl )
102 tk? (
103 >=dev-lang/tk-8.0
104 dev-tcltk/blt
105 )
106 xml? ( >=dev-libs/expat-2.1 )
107 )
108 !!<sys-apps/portage-2.1.9"
109 DEPEND="${RDEPEND}
110 virtual/pkgconfig
111 >=sys-devel/autoconf-2.65
112 !sys-devel/gcc[libffi]"
113 RDEPEND+=" !build? ( app-misc/mime-types )
114 doc? ( dev-python/python-docs:${SLOT} )"
115 PDEPEND="app-admin/eselect-python
116 app-admin/python-updater"
117
118 S="${WORKDIR}/${MY_P}"
119
120 pkg_setup() {
121 if use berkdb; then
122 ewarn "'bsddb' module is out-of-date and no longer maintained inside"
123 ewarn "dev-lang/python. 'bsddb' and 'dbhash' modules have been additionally"
124 ewarn "removed in Python 3. A maintained alternative of 'bsddb3' module"
125 ewarn "is provided by dev-python/bsddb3."
126 else
127 if has_version "=${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"; then
128 ewarn "You are migrating from =${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"
129 ewarn "to =${CATEGORY}/${PN}-${PV%%.*}*[-berkdb]."
130 ewarn "You might need to migrate your databases."
131 fi
132 fi
133 }
134
135 src_prepare() {
136 # Ensure that internal copies of expat, libffi and zlib are not used.
137 rm -r Modules/expat || die
138 rm -r Modules/_ctypes/libffi* || die
139 rm -r Modules/zlib || die
140
141 if tc-is-cross-compiler; then
142 local EPATCH_EXCLUDE="*_regenerate_platform-specific_modules.patch"
143 fi
144
145 EPATCH_SUFFIX="patch" epatch "${WORKDIR}/${PV}-${PATCHSET_REVISION}"
146
147 epatch "${FILESDIR}/${P}-library-path.patch" #474882
148 epatch "${FILESDIR}/${P}-re_unsigned_ptrdiff.patch" #476426
149 epatch "${FILESDIR}/CVE-2013-4238_py27.patch"
150 epatch "${FILESDIR}/python-2.7-issue16248.patch"
151 epatch "${FILESDIR}/python-2.7-issue18851.patch"
152
153 # Fix for cross-compiling.
154 epatch "${FILESDIR}/python-2.7.5-nonfatal-compileall.patch"
155
156 sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
157 Lib/distutils/command/install.py \
158 Lib/distutils/sysconfig.py \
159 Lib/site.py \
160 Lib/sysconfig.py \
161 Lib/test/test_site.py \
162 Makefile.pre.in \
163 Modules/Setup.dist \
164 Modules/getpath.c \
165 setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
166
167 epatch_user
168
169 eautoconf
170 eautoheader
171 }
172
173 src_configure() {
174 if use build; then
175 # Disable extraneous modules with extra dependencies.
176 export PYTHON_DISABLE_MODULES="dbm _bsddb gdbm _curses _curses_panel readline _sqlite3 _tkinter _elementtree pyexpat"
177 export PYTHON_DISABLE_SSL="1"
178 else
179 # dbm module can be linked against berkdb or gdbm.
180 # Defaults to gdbm when both are enabled, #204343.
181 local disable
182 use berkdb || use gdbm || disable+=" dbm"
183 use berkdb || disable+=" _bsddb"
184 use gdbm || disable+=" gdbm"
185 use ncurses || disable+=" _curses _curses_panel"
186 use readline || disable+=" readline"
187 use sqlite || disable+=" _sqlite3"
188 use ssl || export PYTHON_DISABLE_SSL="1"
189 use tk || disable+=" _tkinter"
190 use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
191 export PYTHON_DISABLE_MODULES="${disable}"
192
193 if ! use xml; then
194 ewarn "You have configured Python without XML support."
195 ewarn "This is NOT a recommended configuration as you"
196 ewarn "may face problems parsing any XML documents."
197 fi
198 fi
199
200 if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
201 einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
202 fi
203
204 if [[ "$(gcc-major-version)" -ge 4 ]]; then
205 append-flags -fwrapv
206 fi
207
208 filter-flags -malign-double
209
210 [[ "${ARCH}" == "alpha" ]] && append-flags -fPIC
211
212 # https://bugs.gentoo.org/show_bug.cgi?id=50309
213 if is-flagq -O3; then
214 is-flagq -fstack-protector-all && replace-flags -O3 -O2
215 use hardened && replace-flags -O3 -O2
216 fi
217
218 # Export CXX so it ends up in /usr/lib/python2.X/config/Makefile.
219 tc-export CXX
220 # The configure script fails to use pkg-config correctly.
221 # http://bugs.python.org/issue15506
222 export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG)
223
224 # Set LDFLAGS so we link modules with -lpython2.7 correctly.
225 # Needed on FreeBSD unless Python 2.7 is already installed.
226 # Please query BSD team before removing this!
227 append-ldflags "-L."
228
229 local dbmliborder
230 if use gdbm; then
231 dbmliborder+="${dbmliborder:+:}gdbm"
232 fi
233 if use berkdb; then
234 dbmliborder+="${dbmliborder:+:}bdb"
235 fi
236
237 BUILD_DIR="${WORKDIR}/${CHOST}"
238 mkdir -p "${BUILD_DIR}" || die
239 cd "${BUILD_DIR}" || die
240
241 ECONF_SOURCE="${S}" OPT="" \
242 econf \
243 --with-fpectl \
244 --enable-shared \
245 $(use_enable ipv6) \
246 $(use_with threads) \
247 $(use wide-unicode && echo "--enable-unicode=ucs4" || echo "--enable-unicode=ucs2") \
248 --infodir='${prefix}/share/info' \
249 --mandir='${prefix}/share/man' \
250 --with-dbmliborder="${dbmliborder}" \
251 --with-libc="" \
252 --enable-loadable-sqlite-extensions \
253 --with-system-expat \
254 --with-system-ffi
255 }
256
257 src_compile() {
258 # Avoid invoking pgen for cross-compiles.
259 touch Include/graminit.h Python/graminit.c
260
261 cd "${BUILD_DIR}" || die
262 emake
263
264 # Work around bug 329499. See also bug 413751 and 457194.
265 if has_version dev-libs/libffi[pax_kernel]; then
266 pax-mark E python
267 else
268 pax-mark m python
269 fi
270 }
271
272 src_test() {
273 # Tests will not work when cross compiling.
274 if tc-is-cross-compiler; then
275 elog "Disabling tests due to crosscompiling."
276 return
277 fi
278
279 cd "${BUILD_DIR}" || die
280
281 # Skip failing tests.
282 local skipped_tests="distutils gdb"
283
284 for test in ${skipped_tests}; do
285 mv "${S}"/Lib/test/test_${test}.py "${T}"
286 done
287
288 # Rerun failed tests in verbose mode (regrtest -w).
289 emake test EXTRATESTOPTS="-w" < /dev/tty
290 local result="$?"
291
292 for test in ${skipped_tests}; do
293 mv "${T}/test_${test}.py" "${S}"/Lib/test
294 done
295
296 elog "The following tests have been skipped:"
297 for test in ${skipped_tests}; do
298 elog "test_${test}.py"
299 done
300
301 elog "If you would like to run them, you may:"
302 elog "cd '${EPREFIX}/usr/$(get_libdir)/python${SLOT}/test'"
303 elog "and run the tests separately."
304
305 if [[ "${result}" -ne 0 ]]; then
306 die "emake test failed"
307 fi
308 }
309
310 src_install() {
311 local libdir=${ED}/usr/$(get_libdir)/python${SLOT}
312
313 cd "${BUILD_DIR}" || die
314 emake DESTDIR="${D}" altinstall
315
316 sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die "sed failed"
317
318 # Backwards compat with Gentoo divergence.
319 dosym python${SLOT}-config /usr/bin/python-config-${SLOT}
320
321 # Fix collisions between different slots of Python.
322 mv "${ED}usr/bin/2to3" "${ED}usr/bin/2to3-${SLOT}"
323 mv "${ED}usr/bin/pydoc" "${ED}usr/bin/pydoc${SLOT}"
324 mv "${ED}usr/bin/idle" "${ED}usr/bin/idle${SLOT}"
325 rm -f "${ED}usr/bin/smtpd.py"
326
327 if use build; then
328 rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{bsddb,dbhash.py,idlelib,lib-tk,sqlite3,test}
329 else
330 use berkdb || rm -r "${libdir}/"{bsddb,dbhash.py,test/test_bsddb*} || die
331 use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
332 use tk || rm -r "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk} || die
333 use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test}
334 fi
335
336 use threads || rm -r "${libdir}/multiprocessing" || die
337 use wininst || rm -r "${libdir}/distutils/command/"wininst-*.exe || die
338
339 dodoc "${S}"/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
344 fi
345 insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
346 local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
347 emake --no-print-directory -s -f - 2>/dev/null)
348 newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
349
350 newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT}
351 newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT}
352 sed \
353 -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \
354 -e "s:@PYDOC@:pydoc${SLOT}:" \
355 -i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed"
356
357 # for python-exec
358 python_export python${SLOT} EPYTHON PYTHON PYTHON_SITEDIR
359
360 # if not using a cross-compiler, use the fresh binary
361 if ! tc-is-cross-compiler; then
362 local PYTHON=./python
363 local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}.
364 fi
365
366 echo "EPYTHON='${EPYTHON}'" > epython.py
367 python_domodule epython.py
368 }
369
370 pkg_preinst() {
371 if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version "${CATEGORY}/${PN}:2.7"; then
372 python_updater_warning="1"
373 fi
374 }
375
376 eselect_python_update() {
377 if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
378 eselect python update
379 fi
380
381 if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
382 eselect python update --python${PV%%.*}
383 fi
384 }
385
386 pkg_postinst() {
387 eselect_python_update
388
389 if [[ "${python_updater_warning}" == "1" ]]; then
390 ewarn "You have just upgraded from an older version of Python."
391 ewarn "You should switch active version of Python ${PV%%.*} and run"
392 ewarn "'python-updater [options]' to rebuild Python modules."
393 fi
394 }
395
396 pkg_postrm() {
397 eselect_python_update
398 }