Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/python/
Date: Sun, 03 Mar 2019 16:52:11
Message-Id: 1551631875.1229b00ec716d6f719c7aa5d65c2114ac6eb2ef1.floppym@gentoo
1 commit: 1229b00ec716d6f719c7aa5d65c2114ac6eb2ef1
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Sun Mar 3 16:50:32 2019 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sun Mar 3 16:51:15 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1229b00e
7
8 dev-lang/python: bump to 2.7.16
9
10 Closes: https://bugs.gentoo.org/671590
11 Package-Manager: Portage-2.3.59_p2, Repoman-2.3.12_p67
12 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
13
14 dev-lang/python/Manifest | 2 +
15 dev-lang/python/python-2.7.16.ebuild | 356 +++++++++++++++++++++++++++++++++++
16 2 files changed, 358 insertions(+)
17
18 diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
19 index 8f5351e48e6..58654f6f75b 100644
20 --- a/dev-lang/python/Manifest
21 +++ b/dev-lang/python/Manifest
22 @@ -1,4 +1,5 @@
23 DIST Python-2.7.15.tar.xz 12642436 BLAKE2B d8783a48ea26695e8d4677397a08194c738d7e4bc8ecaddaab609ad1fd5a1ca07701f707fe38d259f6bd44a39171ef95e7530f3df4bcb4d94abc4d21d7e2d489 SHA512 27ea43eb45fc68f3d2469d5f07636e10801dee11635a430ec8ec922ed790bb426b072da94df885e4dfa1ea8b7a24f2f56dd92f9b0f51e162330f161216bd6de6
24 +DIST Python-2.7.16.tar.xz 12752104 BLAKE2B 7d6b5b853f9974d44e04dd35ecdffaab87511e183b4b01dd4f8f4ee109c4b4ab208f045708f69717be9d3a706aa078b71438ed482c062c0b89c12730eae074ae SHA512 16e814e8dcffc707b595ca2919bd2fa3db0d15794c63d977364652c4a5b92e90e72b8c9e1cc83b5020398bd90a1b397dbdd7cb931c49f1aa4af6ef95414b43e0
25 DIST Python-3.4.5.tar.xz 14516820 BLAKE2B f9ddabd2df2241089d07756d3a8ba1c70096bee60d7cdef84041edbb20c488c3a573762441a4b7f543dbc0ce403ce84ff7d02e7d25699917bd014ab96deead85 SHA512 b548a5338d141b3086dea372fa2cc245ba5350ee9f0d1304ef6222dc45380b66d380b092e547d54206d56ca68563b95036f445f97f72bb0ef1d48f81a74a3d4c
26 DIST Python-3.4.6.tar.xz 14473592 BLAKE2B 4af4f8e6f5c6831b50e99dd9eef47617f14903dc709f53f833c64726b003e9f84f75be80ba8059dcada2b2f262d65875f70d8c53a163546e51f9a715c68f4f20 SHA512 f6785cf6a99a8a27823baefe59cc20e34cbec01bb444c8600e7f49b5437159d5137f9d80fce26e219846d71bfe98f68bc6f0c87719a34db0050a4eaca95959ac
27 DIST Python-3.4.8.tar.xz 14576444 BLAKE2B 262b82fbc0e4852216d2edf05f9e9194bc93be7b14a2d6ef56789b808cff274e58b2fa7134955464fd05ab36181b5861aeca31e2e05b27f0f58ac66d145bd56b SHA512 478552c72efe606cb1993024b81839c51d01f1c949564c007ab2b76016f110e1f7bd418e5de3f4f93b466ce7dbe6583d3c150830d1f28f75e0809625b568a7ec
28 @@ -12,6 +13,7 @@ DIST Python-3.6.8.tar.xz 17212420 BLAKE2B e104b49a35492b622080ab81a446c0cdd1223e
29 DIST Python-3.7.0.tar.xz 16922100 BLAKE2B cd2afd9ad1847ca793bc64ecb637906c35e0c8da8392d626cce3ebf19be5ccde1e6dcc499b933359cb24dcdbd024b3aaa916f96ed893b1f52d9825e404f27e5f SHA512 8bb11233fb67ee9ab8ed1b72f8fdc62f66e26a6beaaeb92448bce681cf065269833b1658d3ed2459127f25ba43adb0eab73cf27c59834a2a803fb529b4216739
30 DIST Python-3.7.2.tar.xz 17042320 BLAKE2B 79b06b7d38590b7ad00850a4323156bfee07c4cf8531cbc09d262c6eb38721e32b8b0591fc21017e56948dd81763e9061f118f204eda5b9cc0b84e7132b42979 SHA512 6cd2d6d8455558783b99d55985cd7b22d67b98f41a09b4fdd96f680a630a4e035220d2b903f8c59ed513aa5ffe6730fa947ddb55bb72ce36f0e945ef8af5d971
31 DIST python-gentoo-patches-2.7.15.tar.xz 16208 BLAKE2B 5739c2b3a236d48f8e33f0fe6515bfe7a8f99096f6223b402653988feac2513d37d26b6e40e5e049852f42657358170e468ca60097e0e2294e760787c12ad591 SHA512 687fd008d1d41b1e65ce5417f6f6aba84ffd42f7af44ef97c03a7806b28e6888f8df043a0c15187a8b229cc17642853e6feb25494db97f4d10f8a66f8ebcbcca
32 +DIST python-gentoo-patches-2.7.16.tar.xz 13904 BLAKE2B 218b46f8656f4a792dcd47eabca6d59a1558276b77676544991ee75914cd76dda84c36f43e72e477b850dd4cb52374d289f20dccd244a3b52ae5debaf3363432 SHA512 83f90545231c663a34c6925352a357a2b15997ac0362578a1893304c5070b5251922585ae8bc1bafb68d306bcddd4cdba4b6406648d473bd3e980eef65fe3ecd
33 DIST python-gentoo-patches-3.4.5-0.tar.xz 12044 BLAKE2B 7fb3cc7dcd987debd5aa263d8e26b21aad439d8e3177c06c3683406a53bbda9652175673b09b6300f6a5b62148190cd8a75c9b65a5de04d770866733fcc0ebcb SHA512 108a4845667ecdf4001fcbeffab0cfbbac87439a449a7351428b0f3e2f159e3848ee0c0dfa45c9fba893b9f9584b33722fc8bb0bd7485a1d0909c3a35ede6ed8
34 DIST python-gentoo-patches-3.4.6-0.tar.xz 11728 BLAKE2B 2a636f5500f4c7d354f421133f086cba9a25c30d5feaaa2dc25c9c588125d7c9097baecaa11f31548fa598b5dc137ca310ad86222510c0a955fa632a6d0a4b06 SHA512 41c22dc8f1db8800fc0b97eed2b27bf1873e5de1369bd4aecf7a7a91e609a78e45a4b56fc89d575317f33a7704c0c1cad1494e8a993415a198f256e8338f49ab
35 DIST python-gentoo-patches-3.5.4-0.tar.xz 11704 BLAKE2B 4a7d71feff18c7c8c109bed10748348484d314183c3de3ec950d5ca5ce7048bb322c470f3f5bff2d63eb7f2ed99c0fe75c621df050273d9d118681b28926061d SHA512 d395a87695f700598026038d6929ea5038abd7d494294037a4dfa02d5262203dbbaa6ae258a5a7f35ff5542f6266dcf69cc0b9c3df2a047cd2f6699a87e182ec
36
37 diff --git a/dev-lang/python/python-2.7.16.ebuild b/dev-lang/python/python-2.7.16.ebuild
38 new file mode 100644
39 index 00000000000..a4801ad8bcc
40 --- /dev/null
41 +++ b/dev-lang/python/python-2.7.16.ebuild
42 @@ -0,0 +1,356 @@
43 +# Copyright 1999-2019 Gentoo Authors
44 +# Distributed under the terms of the GNU General Public License v2
45 +
46 +EAPI="6"
47 +WANT_LIBTOOL="none"
48 +
49 +inherit autotools flag-o-matic pax-utils python-utils-r1 toolchain-funcs
50 +
51 +MY_P="Python-${PV}"
52 +PATCHSET_VERSION="2.7.16"
53 +
54 +DESCRIPTION="An interpreted, interactive, object-oriented programming language"
55 +HOMEPAGE="https://www.python.org/"
56 +SRC_URI="https://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz
57 + https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz"
58 +
59 +LICENSE="PSF-2"
60 +SLOT="2.7"
61 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
62 +IUSE="-berkdb bluetooth build doc elibc_uclibc examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml"
63 +
64 +# Do not add a dependency on dev-lang/python to this ebuild.
65 +# If you need to apply a patch which requires python for bootstrapping, please
66 +# run the bootstrap code on your dev box and include the results in the
67 +# patchset. See bug 447752.
68 +
69 +RDEPEND="app-arch/bzip2:0=
70 + >=sys-libs/zlib-1.1.3:0=
71 + virtual/libffi:=
72 + virtual/libintl
73 + berkdb? ( || (
74 + sys-libs/db:5.3
75 + sys-libs/db:5.1
76 + sys-libs/db:4.8
77 + sys-libs/db:4.7
78 + sys-libs/db:4.6
79 + sys-libs/db:4.5
80 + sys-libs/db:4.4
81 + sys-libs/db:4.3
82 + sys-libs/db:4.2
83 + ) )
84 + gdbm? ( sys-libs/gdbm:0=[berkdb] )
85 + ncurses? ( >=sys-libs/ncurses-5.2:0= )
86 + readline? ( >=sys-libs/readline-4.1:0= )
87 + sqlite? ( >=dev-db/sqlite-3.3.8:3= )
88 + ssl? (
89 + !libressl? ( dev-libs/openssl:0= )
90 + libressl? ( dev-libs/libressl:0= )
91 + )
92 + tk? (
93 + >=dev-lang/tcl-8.0:0=
94 + >=dev-lang/tk-8.0:0=
95 + dev-tcltk/blt:0=
96 + dev-tcltk/tix
97 + )
98 + xml? ( >=dev-libs/expat-2.1 )
99 + !!<sys-apps/portage-2.1.9"
100 +# bluetooth requires headers from bluez
101 +DEPEND="${RDEPEND}
102 + bluetooth? ( net-wireless/bluez )
103 + virtual/pkgconfig
104 + >=sys-devel/autoconf-2.65
105 + !sys-devel/gcc[libffi(-)]"
106 +RDEPEND+=" !build? ( app-misc/mime-types )
107 + doc? ( dev-python/python-docs:${SLOT} )"
108 +PDEPEND=">=app-eselect/eselect-python-20140125-r1"
109 +
110 +S="${WORKDIR}/${MY_P}"
111 +
112 +pkg_setup() {
113 + if use berkdb; then
114 + ewarn "'bsddb' module is out-of-date and no longer maintained inside"
115 + ewarn "dev-lang/python. 'bsddb' and 'dbhash' modules have been additionally"
116 + ewarn "removed in Python 3. A maintained alternative of 'bsddb3' module"
117 + ewarn "is provided by dev-python/bsddb3."
118 + else
119 + if has_version "=${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"; then
120 + ewarn "You are migrating from =${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"
121 + ewarn "to =${CATEGORY}/${PN}-${PV%%.*}*[-berkdb]."
122 + ewarn "You might need to migrate your databases."
123 + fi
124 + fi
125 +}
126 +
127 +src_prepare() {
128 + # Ensure that internal copies of expat, libffi and zlib are not used.
129 + rm -r Modules/expat || die
130 + rm -r Modules/_ctypes/libffi* || die
131 + rm -r Modules/zlib || die
132 +
133 + if tc-is-cross-compiler; then
134 + rm "${WORKDIR}/patches/0006-Regenerate-platform-specific-modules.patch" || die
135 + fi
136 +
137 + local PATCHES=(
138 + "${WORKDIR}/patches"
139 + # Fix for cross-compiling.
140 + "${FILESDIR}/python-2.7.5-nonfatal-compileall.patch"
141 + "${FILESDIR}/python-2.7.9-ncurses-pkg-config.patch"
142 + "${FILESDIR}/python-2.7.10-cross-compile-warn-test.patch"
143 + "${FILESDIR}/python-2.7.10-system-libffi.patch"
144 + )
145 +
146 + default
147 +
148 + sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
149 + Lib/distutils/command/install.py \
150 + Lib/distutils/sysconfig.py \
151 + Lib/site.py \
152 + Lib/sysconfig.py \
153 + Lib/test/test_site.py \
154 + Makefile.pre.in \
155 + Modules/Setup.dist \
156 + Modules/getpath.c \
157 + setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
158 +
159 + eautoreconf
160 +}
161 +
162 +src_configure() {
163 + # dbm module can be linked against berkdb or gdbm.
164 + # Defaults to gdbm when both are enabled, #204343.
165 + local disable
166 + use berkdb || use gdbm || disable+=" dbm"
167 + use berkdb || disable+=" _bsddb"
168 + # disable automagic bluetooth headers detection
169 + use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
170 + use gdbm || disable+=" gdbm"
171 + use ncurses || disable+=" _curses _curses_panel"
172 + use readline || disable+=" readline"
173 + use sqlite || disable+=" _sqlite3"
174 + use ssl || export PYTHON_DISABLE_SSL="1"
175 + use tk || disable+=" _tkinter"
176 + use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
177 + export PYTHON_DISABLE_MODULES="${disable}"
178 +
179 + if ! use xml; then
180 + ewarn "You have configured Python without XML support."
181 + ewarn "This is NOT a recommended configuration as you"
182 + ewarn "may face problems parsing any XML documents."
183 + fi
184 +
185 + if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
186 + einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
187 + fi
188 +
189 + if [[ "$(gcc-major-version)" -ge 4 ]]; then
190 + append-flags -fwrapv
191 + fi
192 +
193 + filter-flags -malign-double
194 +
195 + # https://bugs.gentoo.org/show_bug.cgi?id=50309
196 + if is-flagq -O3; then
197 + is-flagq -fstack-protector-all && replace-flags -O3 -O2
198 + use hardened && replace-flags -O3 -O2
199 + fi
200 +
201 + if tc-is-cross-compiler; then
202 + # Force some tests that try to poke fs paths.
203 + export ac_cv_file__dev_ptc=no
204 + export ac_cv_file__dev_ptmx=yes
205 + fi
206 +
207 + # Export CXX so it ends up in /usr/lib/python2.X/config/Makefile.
208 + tc-export CXX
209 + # The configure script fails to use pkg-config correctly.
210 + # http://bugs.python.org/issue15506
211 + export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG)
212 +
213 + # Set LDFLAGS so we link modules with -lpython2.7 correctly.
214 + # Needed on FreeBSD unless Python 2.7 is already installed.
215 + # Please query BSD team before removing this!
216 + append-ldflags "-L."
217 +
218 + local dbmliborder
219 + if use gdbm; then
220 + dbmliborder+="${dbmliborder:+:}gdbm"
221 + fi
222 + if use berkdb; then
223 + dbmliborder+="${dbmliborder:+:}bdb"
224 + fi
225 +
226 + local myeconfargs=(
227 + --with-fpectl
228 + --enable-shared
229 + $(use_enable ipv6)
230 + $(use_with threads)
231 + $(use wide-unicode && echo "--enable-unicode=ucs4" || echo "--enable-unicode=ucs2")
232 + --infodir='${prefix}/share/info'
233 + --mandir='${prefix}/share/man'
234 + --with-computed-gotos
235 + --with-dbmliborder="${dbmliborder}"
236 + --with-libc=
237 + --enable-loadable-sqlite-extensions
238 + --with-system-expat
239 + --with-system-ffi
240 + --without-ensurepip
241 + )
242 +
243 + OPT= econf "${myeconfargs[@]}"
244 +
245 + if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
246 + eerror "configure has detected that the sem_open function is broken."
247 + eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
248 + die "Broken sem_open function (bug 496328)"
249 + fi
250 +}
251 +
252 +src_compile() {
253 + # Avoid invoking pgen for cross-compiles.
254 + touch Include/graminit.h Python/graminit.c
255 +
256 + emake
257 +
258 + # Work around bug 329499. See also bug 413751 and 457194.
259 + if has_version dev-libs/libffi[pax_kernel]; then
260 + pax-mark E python
261 + else
262 + pax-mark m python
263 + fi
264 +}
265 +
266 +src_test() {
267 + # Tests will not work when cross compiling.
268 + if tc-is-cross-compiler; then
269 + elog "Disabling tests due to crosscompiling."
270 + return
271 + fi
272 +
273 + # Skip failing tests.
274 + local skipped_tests="distutils gdb"
275 +
276 + for test in ${skipped_tests}; do
277 + mv "${S}"/Lib/test/test_${test}.py "${T}"
278 + done
279 +
280 + # bug 660358
281 + local -x COLUMNS=80
282 +
283 + # Daylight saving time problem
284 + # https://bugs.python.org/issue22067
285 + # https://bugs.gentoo.org/610628
286 + local -x TZ=UTC
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 + emake DESTDIR="${D}" altinstall
314 +
315 + sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die "sed failed"
316 +
317 + # Fix collisions between different slots of Python.
318 + mv "${ED}usr/bin/2to3" "${ED}usr/bin/2to3-${SLOT}"
319 + mv "${ED}usr/bin/pydoc" "${ED}usr/bin/pydoc${SLOT}"
320 + mv "${ED}usr/bin/idle" "${ED}usr/bin/idle${SLOT}"
321 + rm -f "${ED}usr/bin/smtpd.py"
322 +
323 + use berkdb || rm -r "${libdir}/"{bsddb,dbhash.py*,test/test_bsddb*} || die
324 + use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
325 + use tk || rm -r "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk} || die
326 + use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test}
327 +
328 + use threads || rm -r "${libdir}/multiprocessing" || die
329 + use wininst || rm -r "${libdir}/distutils/command/"wininst-*.exe || die
330 +
331 + dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS}
332 +
333 + if use examples; then
334 + insinto /usr/share/doc/${PF}/examples
335 + doins -r "${S}"/Tools
336 + fi
337 + insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
338 + local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
339 + emake --no-print-directory -s -f - 2>/dev/null)
340 + newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
341 +
342 + newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT}
343 + newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT}
344 + sed \
345 + -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \
346 + -e "s:@PYDOC@:pydoc${SLOT}:" \
347 + -i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed"
348 +
349 + # for python-exec
350 + local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
351 +
352 + # if not using a cross-compiler, use the fresh binary
353 + if ! tc-is-cross-compiler; then
354 + local -x PYTHON=./python
355 + local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
356 + else
357 + vars=( PYTHON "${vars[@]}" )
358 + fi
359 +
360 + python_export "python${SLOT}" "${vars[@]}"
361 + echo "EPYTHON='${EPYTHON}'" > epython.py || die
362 + python_domodule epython.py
363 +
364 + # python-exec wrapping support
365 + local pymajor=${SLOT%.*}
366 + mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die
367 + # python and pythonX
368 + ln -s "../../../bin/python${SLOT}" "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
369 + ln -s "python${pymajor}" "${D}${PYTHON_SCRIPTDIR}/python" || die
370 + # python-config and pythonX-config
371 + ln -s "../../../bin/python${SLOT}-config" "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
372 + ln -s "python${pymajor}-config" "${D}${PYTHON_SCRIPTDIR}/python-config" || die
373 + # 2to3, pydoc, pyvenv
374 + ln -s "../../../bin/2to3-${SLOT}" "${D}${PYTHON_SCRIPTDIR}/2to3" || die
375 + ln -s "../../../bin/pydoc${SLOT}" "${D}${PYTHON_SCRIPTDIR}/pydoc" || die
376 + # idle
377 + if use tk; then
378 + ln -s "../../../bin/idle${SLOT}" "${D}${PYTHON_SCRIPTDIR}/idle" || die
379 + fi
380 +}
381 +
382 +eselect_python_update() {
383 + if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
384 + eselect python update
385 + fi
386 +
387 + if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
388 + eselect python update --python${PV%%.*}
389 + fi
390 +}
391 +
392 +pkg_postinst() {
393 + eselect_python_update
394 +}
395 +
396 +pkg_postrm() {
397 + eselect_python_update
398 +}