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-3.4.3.ebuild ChangeLog
Date: Tue, 03 Mar 2015 03:11:47
Message-Id: 20150303031142.4BAA812EB8@oystercatcher.gentoo.org
1 floppym 15/03/03 03:11:42
2
3 Modified: ChangeLog
4 Added: python-3.4.3.ebuild
5 Log:
6 Version bump.
7
8 (Portage version: 2.2.17/cvs/Linux x86_64, signed Manifest commit with key 0BBEEA1FEA4843A4)
9
10 Revision Changes Path
11 1.814 dev-lang/python/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/ChangeLog?rev=1.814&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/ChangeLog?rev=1.814&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/ChangeLog?r1=1.813&r2=1.814
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v
20 retrieving revision 1.813
21 retrieving revision 1.814
22 diff -u -r1.813 -r1.814
23 --- ChangeLog 9 Feb 2015 15:33:48 -0000 1.813
24 +++ ChangeLog 3 Mar 2015 03:11:42 -0000 1.814
25 @@ -1,6 +1,11 @@
26 # ChangeLog for dev-lang/python
27 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.813 2015/02/09 15:33:48 vapier Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.814 2015/03/03 03:11:42 floppym Exp $
30 +
31 +*python-3.4.3 (03 Mar 2015)
32 +
33 + 03 Mar 2015; Mike Gilbert <floppym@g.o> +python-3.4.3.ebuild:
34 + Version bump.
35
36 09 Feb 2015; Mike Frysinger <vapier@g.o> python-2.7.9-r1.ebuild,
37 python-3.4.1.ebuild:
38
39
40
41 1.1 dev-lang/python/python-3.4.3.ebuild
42
43 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-3.4.3.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-3.4.3.ebuild?rev=1.1&content-type=text/plain
45
46 Index: python-3.4.3.ebuild
47 ===================================================================
48 # Copyright 1999-2015 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.4.3.ebuild,v 1.1 2015/03/03 03:11:42 floppym Exp $
51
52 EAPI="4"
53 WANT_LIBTOOL="none"
54
55 inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing
56
57 MY_P="Python-${PV/_/}"
58 PATCHSET_VERSION="3.4.3-0"
59
60 DESCRIPTION="An interpreted, interactive, object-oriented programming language"
61 HOMEPAGE="http://www.python.org/"
62 SRC_URI="http://www.python.org/ftp/python/${PV%_rc*}/${MY_P}.tar.xz
63 http://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz"
64
65 LICENSE="PSF-2"
66 SLOT="3.4"
67 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
68 IUSE="build elibc_uclibc examples gdbm hardened ipv6 +ncurses +readline sqlite +ssl +threads tk wininst +xml"
69
70 # Do not add a dependency on dev-lang/python to this ebuild.
71 # If you need to apply a patch which requires python for bootstrapping, please
72 # run the bootstrap code on your dev box and include the results in the
73 # patchset. See bug 447752.
74
75 RDEPEND="app-arch/bzip2
76 app-arch/xz-utils
77 >=sys-libs/zlib-1.1.3
78 virtual/libffi
79 virtual/libintl
80 !build? (
81 gdbm? ( sys-libs/gdbm[berkdb] )
82 ncurses? (
83 >=sys-libs/ncurses-5.2
84 readline? ( >=sys-libs/readline-4.1 )
85 )
86 sqlite? ( >=dev-db/sqlite-3.3.8:3 )
87 ssl? ( dev-libs/openssl )
88 tk? (
89 >=dev-lang/tk-8.0
90 dev-tcltk/blt
91 dev-tcltk/tix
92 )
93 xml? ( >=dev-libs/expat-2.1 )
94 )
95 !!<sys-apps/sandbox-2.6-r1"
96 DEPEND="${RDEPEND}
97 virtual/pkgconfig
98 >=sys-devel/autoconf-2.65
99 !sys-devel/gcc[libffi]"
100 RDEPEND+=" !build? ( app-misc/mime-types )"
101 PDEPEND="app-admin/eselect-python
102 app-admin/python-updater"
103
104 S="${WORKDIR}/${MY_P}"
105
106 src_prepare() {
107 # Ensure that internal copies of expat, libffi and zlib are not used.
108 rm -fr Modules/expat
109 rm -fr Modules/_ctypes/libffi*
110 rm -fr Modules/zlib
111
112 if tc-is-cross-compiler; then
113 # Invokes BUILDPYTHON, which is built for the host arch
114 local EPATCH_EXCLUDE="*_regenerate_platform-specific_modules.patch"
115 fi
116
117 EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
118
119 sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
120 Lib/distutils/command/install.py \
121 Lib/distutils/sysconfig.py \
122 Lib/site.py \
123 Lib/sysconfig.py \
124 Lib/test/test_site.py \
125 Makefile.pre.in \
126 Modules/Setup.dist \
127 Modules/getpath.c \
128 setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
129
130 # Disable ABI flags.
131 sed -e "s/ABIFLAGS=\"\${ABIFLAGS}.*\"/:/" -i configure.ac || die "sed failed"
132
133 epatch_user
134
135 eautoreconf
136 }
137
138 src_configure() {
139 if use build; then
140 # Disable extraneous modules with extra dependencies.
141 export PYTHON_DISABLE_MODULES="gdbm _curses _curses_panel readline _sqlite3 _tkinter _elementtree pyexpat"
142 export PYTHON_DISABLE_SSL="1"
143 else
144 local disable
145 use gdbm || disable+=" gdbm"
146 use ncurses || disable+=" _curses _curses_panel"
147 use readline || disable+=" readline"
148 use sqlite || disable+=" _sqlite3"
149 use ssl || export PYTHON_DISABLE_SSL="1"
150 use tk || disable+=" _tkinter"
151 use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
152 export PYTHON_DISABLE_MODULES="${disable}"
153
154 if ! use xml; then
155 ewarn "You have configured Python without XML support."
156 ewarn "This is NOT a recommended configuration as you"
157 ewarn "may face problems parsing any XML documents."
158 fi
159 fi
160
161 if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
162 einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
163 fi
164
165 if [[ "$(gcc-major-version)" -ge 4 ]]; then
166 append-flags -fwrapv
167 fi
168
169 filter-flags -malign-double
170
171 [[ "${ARCH}" == "alpha" ]] && append-flags -fPIC
172
173 # https://bugs.gentoo.org/show_bug.cgi?id=50309
174 if is-flagq -O3; then
175 is-flagq -fstack-protector-all && replace-flags -O3 -O2
176 use hardened && replace-flags -O3 -O2
177 fi
178
179 # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
180 tc-export CXX
181 # The configure script fails to use pkg-config correctly.
182 # http://bugs.python.org/issue15506
183 export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG)
184
185 # Set LDFLAGS so we link modules with -lpython3.2 correctly.
186 # Needed on FreeBSD unless Python 3.2 is already installed.
187 # Please query BSD team before removing this!
188 append-ldflags "-L."
189
190 local dbmliborder
191 if use gdbm; then
192 dbmliborder+="${dbmliborder:+:}gdbm"
193 fi
194
195 BUILD_DIR="${WORKDIR}/${CHOST}"
196 mkdir -p "${BUILD_DIR}" || die
197 cd "${BUILD_DIR}" || die
198
199 ECONF_SOURCE="${S}" OPT="" \
200 econf \
201 --with-fpectl \
202 --enable-shared \
203 $(use_enable ipv6) \
204 $(use_with threads) \
205 --infodir='${prefix}/share/info' \
206 --mandir='${prefix}/share/man' \
207 --with-computed-gotos \
208 --with-dbmliborder="${dbmliborder}" \
209 --with-libc="" \
210 --enable-loadable-sqlite-extensions \
211 --with-system-expat \
212 --with-system-ffi \
213 --without-ensurepip
214
215 if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
216 eerror "configure has detected that the sem_open function is broken."
217 eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
218 die "Broken sem_open function (bug 496328)"
219 fi
220 }
221
222 src_compile() {
223 # Avoid invoking pgen for cross-compiles.
224 touch Include/graminit.h Python/graminit.c || die
225
226 cd "${BUILD_DIR}" || die
227 emake CPPFLAGS="" CFLAGS="" LDFLAGS=""
228
229 # Work around bug 329499. See also bug 413751 and 457194.
230 if has_version dev-libs/libffi[pax_kernel]; then
231 pax-mark E python
232 else
233 pax-mark m python
234 fi
235 }
236
237 src_test() {
238 # Tests will not work when cross compiling.
239 if tc-is-cross-compiler; then
240 elog "Disabling tests due to crosscompiling."
241 return
242 fi
243
244 cd "${BUILD_DIR}" || die
245
246 # Skip failing tests.
247 local skipped_tests="gdb"
248
249 for test in ${skipped_tests}; do
250 mv "${S}"/Lib/test/test_${test}.py "${T}"
251 done
252
253 local -x PYTHONDONTWRITEBYTECODE=
254 emake test EXTRATESTOPTS="-u-network" CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
255 local result=$?
256
257 for test in ${skipped_tests}; do
258 mv "${T}/test_${test}.py" "${S}"/Lib/test
259 done
260
261 elog "The following tests have been skipped:"
262 for test in ${skipped_tests}; do
263 elog "test_${test}.py"
264 done
265
266 elog "If you would like to run them, you may:"
267 elog "cd '${EPREFIX}/usr/$(get_libdir)/python${SLOT}/test'"
268 elog "and run the tests separately."
269
270 if [[ ${result} -ne 0 ]]; then
271 die "emake test failed"
272 fi
273 }
274
275 src_install() {
276 local libdir=${ED}/usr/$(get_libdir)/python${SLOT}
277
278 cd "${BUILD_DIR}" || die
279
280 emake DESTDIR="${D}" altinstall
281
282 sed \
283 -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
284 -e "s/\(PY_LDFLAGS=\).*/\1/" \
285 -i "${libdir}/config-${SLOT}/Makefile" || die "sed failed"
286
287 # Backwards compat with Gentoo divergence.
288 dosym python${SLOT}-config /usr/bin/python-config-${SLOT}
289
290 # Fix collisions between different slots of Python.
291 rm -f "${ED}usr/$(get_libdir)/libpython3.so"
292
293 if use build; then
294 rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,sqlite3,test,tkinter}
295 else
296 use elibc_uclibc && rm -fr "${libdir}/test"
297 use sqlite || rm -fr "${libdir}/"{sqlite3,test/test_sqlite*}
298 use tk || rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,tkinter,test/test_tk*}
299 fi
300
301 use threads || rm -fr "${libdir}/multiprocessing"
302 use wininst || rm -f "${libdir}/distutils/command/"wininst-*.exe
303
304 dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS}
305
306 if use examples; then
307 insinto /usr/share/doc/${PF}/examples
308 find "${S}"/Tools -name __pycache__ -print0 | xargs -0 rm -fr
309 doins -r "${S}"/Tools
310 fi
311 insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
312 local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
313 emake --no-print-directory -s -f - 2>/dev/null)
314 newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
315
316 newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT}
317 newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT}
318 sed \
319 -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \
320 -e "s:@PYDOC@:pydoc${SLOT}:" \
321 -i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed"
322
323 # for python-exec
324 python_export python${SLOT} EPYTHON PYTHON PYTHON_SITEDIR
325
326 # if not using a cross-compiler, use the fresh binary
327 if ! tc-is-cross-compiler; then
328 local PYTHON=./python
329 local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}.
330 fi
331
332 echo "EPYTHON='${EPYTHON}'" > epython.py
333 python_domodule epython.py
334 }
335
336 pkg_preinst() {
337 if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version ">=${CATEGORY}/${PN}-${SLOT}_alpha"; then
338 python_updater_warning="1"
339 fi
340 }
341
342 eselect_python_update() {
343 if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
344 eselect python update
345 fi
346
347 if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
348 eselect python update --python${PV%%.*}
349 fi
350 }
351
352 pkg_postinst() {
353 eselect_python_update
354
355 if [[ "${python_updater_warning}" == "1" ]]; then
356 ewarn "You have just upgraded from an older version of Python."
357 ewarn
358 ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules."
359 fi
360 }
361
362 pkg_postrm() {
363 eselect_python_update
364 }