Gentoo Archives: gentoo-commits

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