Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/python/
Date: Fri, 29 Mar 2019 12:59:30
Message-Id: 1553864352.1e3fcda6cbf3533091102bc3c7272d0bcf357fb9.mgorny@gentoo
1 commit: 1e3fcda6cbf3533091102bc3c7272d0bcf357fb9
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Mar 29 12:27:40 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Mar 29 12:59:12 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1e3fcda6
7
8 dev-lang/python: Bump to 3.7.3
9
10 Bug: https://bugs.gentoo.org/676700
11 Bug: https://bugs.gentoo.org/680298
12 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
13
14 dev-lang/python/Manifest | 2 +
15 dev-lang/python/python-3.7.3.ebuild | 325 ++++++++++++++++++++++++++++++++++++
16 2 files changed, 327 insertions(+)
17
18 diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
19 index ca4fcd71947..4aa3d6cec65 100644
20 --- a/dev-lang/python/Manifest
21 +++ b/dev-lang/python/Manifest
22 @@ -7,6 +7,7 @@ DIST Python-3.5.7.tar.xz 15324736 BLAKE2B 0f1dd80584385b7f859652c85dc6b51bf71cd9
23 DIST Python-3.6.5.tar.xz 17049912 BLAKE2B f393e9563a18a46c457afcd2e174d9eacda20fe2b0ae5461e11c582fa4d27b85c01bbe7b602f45511b6b44f635c6330205b12fb3e8325ffd07e87b78a8258889 SHA512 6b26fcd296b9bd8e67861eff10d14db7507711ddba947288d16d6def53135c39326b7f969c04bb2b2993f924d9e7ad3f5c5282a3915760bc0885cf0a8ea5eb51
24 DIST Python-3.6.8.tar.xz 17212420 BLAKE2B e104b49a35492b622080ab81a446c0cdd1223e8ddf95c4e1b262762a027664b59f3e4deeda4ba7177115d780e48b6764a053acef640a645327df428d2e4820cd SHA512 b17867e451ebe662f50df83ed112d3656c089e7d750651ea640052b01b713b58e66aac9e082f71fd16f5b5510bc9b797f5ccd30f5399581e9aa406197f02938a
25 DIST Python-3.7.2.tar.xz 17042320 BLAKE2B 79b06b7d38590b7ad00850a4323156bfee07c4cf8531cbc09d262c6eb38721e32b8b0591fc21017e56948dd81763e9061f118f204eda5b9cc0b84e7132b42979 SHA512 6cd2d6d8455558783b99d55985cd7b22d67b98f41a09b4fdd96f680a630a4e035220d2b903f8c59ed513aa5ffe6730fa947ddb55bb72ce36f0e945ef8af5d971
26 +DIST Python-3.7.3.tar.xz 17108364 BLAKE2B ac86ea442519a02f0afcb0d0ec70cb288ae28df63fc9f575ee4d8e03e6e31aff9ad2ff18ff5787d922727bd1c6f1a488f94541cd9787ac932d041c93847dea34 SHA512 6d9b7c0f1764e0f655a39430a3af6f7b5e3c9b7166c042e780677a54b17ad4ca6d0d9cba262c82b1b70bba8f7c28883dad4cc0d7cc194fc7d2c1b5f4f08a763a
27 DIST python-gentoo-patches-2.7.15.tar.xz 16208 BLAKE2B 5739c2b3a236d48f8e33f0fe6515bfe7a8f99096f6223b402653988feac2513d37d26b6e40e5e049852f42657358170e468ca60097e0e2294e760787c12ad591 SHA512 687fd008d1d41b1e65ce5417f6f6aba84ffd42f7af44ef97c03a7806b28e6888f8df043a0c15187a8b229cc17642853e6feb25494db97f4d10f8a66f8ebcbcca
28 DIST python-gentoo-patches-2.7.16.tar.xz 13904 BLAKE2B 218b46f8656f4a792dcd47eabca6d59a1558276b77676544991ee75914cd76dda84c36f43e72e477b850dd4cb52374d289f20dccd244a3b52ae5debaf3363432 SHA512 83f90545231c663a34c6925352a357a2b15997ac0362578a1893304c5070b5251922585ae8bc1bafb68d306bcddd4cdba4b6406648d473bd3e980eef65fe3ecd
29 DIST python-gentoo-patches-3.4.6-0.tar.xz 11728 BLAKE2B 2a636f5500f4c7d354f421133f086cba9a25c30d5feaaa2dc25c9c588125d7c9097baecaa11f31548fa598b5dc137ca310ad86222510c0a955fa632a6d0a4b06 SHA512 41c22dc8f1db8800fc0b97eed2b27bf1873e5de1369bd4aecf7a7a91e609a78e45a4b56fc89d575317f33a7704c0c1cad1494e8a993415a198f256e8338f49ab
30 @@ -14,3 +15,4 @@ DIST python-gentoo-patches-3.5.4-0.tar.xz 11704 BLAKE2B 4a7d71feff18c7c8c109bed1
31 DIST python-gentoo-patches-3.6.4.tar.xz 12888 BLAKE2B 7cf49ae22df53e855f2e99df51686b5d4bd0da82ef4c22836e24726ea9ed561808352c0305a5659b052d38b843f1ff61b6466a7bc3673b7e5cfb4d81d22fa4bc SHA512 90a1b685f2539872ffd67f96581f70145b7afaf18af19f4a7f4a61214103d2a10bf0069c1769dac229ae011fceaf8538f041082b33c1671905246d018d184dd7
32 DIST python-gentoo-patches-3.6.8.tar.xz 11224 BLAKE2B 5fe38282bcf28df18e0bd37756c880ae191ea738dc92f1cf83f682cfdc52525b9c44287dc99191a73d75c90672ab501b56adf49515b35ff1fdee88c8dc07b175 SHA512 89e700663db25d6d78eee1d4bfdab686c5341a794062f3a63df3485ac0b58deb4b4885d24701f3ae138d06ca783be92e310e1100c6d633910c33732f3cb0d7df
33 DIST python-gentoo-patches-3.7.2.tar.xz 9776 BLAKE2B fe451c3fb44a1ace4489d1bc68db9848b4227422fe9135659594248d057a8916e2abfe8e2677ef6efc9c962dbefe3ca7cd05cbd62b325d53eef6b05928f82017 SHA512 55e932624333b78b55e8981aaa7e7bfbddb635a61f594353a77a6bd5c2b57de31a4ee9ae04e072c4e2eb0fddd1c2702b4bd6133cf0a2c94ab35808df86550156
34 +DIST python-gentoo-patches-3.7.3-0.tar.xz 9800 BLAKE2B b3e1df06cc2c404f08d2da7ea7d44c3612c5b4f908c58d469084b4e78ee4c3024e57879b3f83027d980c9f5e065804e3e144ba734b1da357d3d073c22c14b02e SHA512 deeaf5fbd1d557d4c40c770c1bd772b835bf5ced1842b964fd8ad1aa652b706782301e8a860d6fd1909d90246a8f48a9aaf384d047fca594f96d6771c2901338
35
36 diff --git a/dev-lang/python/python-3.7.3.ebuild b/dev-lang/python/python-3.7.3.ebuild
37 new file mode 100644
38 index 00000000000..afdbc6cebb1
39 --- /dev/null
40 +++ b/dev-lang/python/python-3.7.3.ebuild
41 @@ -0,0 +1,325 @@
42 +# Copyright 1999-2019 Gentoo Authors
43 +# Distributed under the terms of the GNU General Public License v2
44 +
45 +EAPI="7"
46 +WANT_LIBTOOL="none"
47 +
48 +inherit autotools flag-o-matic pax-utils python-utils-r1 toolchain-funcs
49 +
50 +MY_P="Python-${PV}"
51 +PATCHSET_VERSION="3.7.3-0"
52 +
53 +DESCRIPTION="An interpreted, interactive, object-oriented programming language"
54 +HOMEPAGE="https://www.python.org/"
55 +SRC_URI="https://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz
56 + https://dev.gentoo.org/~mgorny/dist/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz"
57 +
58 +LICENSE="PSF-2"
59 +SLOT="3.7/3.7m"
60 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
61 +IUSE="bluetooth build examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test tk wininst +xml"
62 +RESTRICT="!test? ( test )"
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 + app-arch/xz-utils:0=
71 + sys-apps/util-linux:0=
72 + >=sys-libs/zlib-1.1.3:0=
73 + virtual/libffi:=
74 + virtual/libintl
75 + gdbm? ( sys-libs/gdbm:0=[berkdb] )
76 + ncurses? ( >=sys-libs/ncurses-5.2:0= )
77 + readline? ( >=sys-libs/readline-4.1:0= )
78 + sqlite? ( >=dev-db/sqlite-3.3.8:3= )
79 + ssl? (
80 + !libressl? ( dev-libs/openssl:0= )
81 + libressl? ( dev-libs/libressl:0= )
82 + )
83 + tk? (
84 + >=dev-lang/tcl-8.0:0=
85 + >=dev-lang/tk-8.0:0=
86 + dev-tcltk/blt:0=
87 + dev-tcltk/tix
88 + )
89 + xml? ( >=dev-libs/expat-2.1:0= )
90 + !!<sys-apps/sandbox-2.6-r1"
91 +# bluetooth requires headers from bluez
92 +DEPEND="${RDEPEND}
93 + bluetooth? ( net-wireless/bluez )
94 + test? ( app-arch/xz-utils[extra-filters(+)] )
95 + virtual/pkgconfig
96 + !sys-devel/gcc[libffi(-)]"
97 +RDEPEND+=" !build? ( app-misc/mime-types )"
98 +PDEPEND=">=app-eselect/eselect-python-20140125-r1"
99 +
100 +S="${WORKDIR}/${MY_P}"
101 +PYVER=${SLOT%/*}
102 +
103 +src_prepare() {
104 + # Ensure that internal copies of expat, libffi and zlib are not used.
105 + rm -fr Modules/expat
106 + rm -fr Modules/_ctypes/libffi*
107 + rm -fr Modules/zlib
108 +
109 + local PATCHES=(
110 + "${WORKDIR}/patches"
111 + )
112 +
113 + default
114 +
115 + sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
116 + setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
117 +
118 + eautoreconf
119 +}
120 +
121 +src_configure() {
122 + local disable
123 + # disable automagic bluetooth headers detection
124 + use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
125 + use gdbm || disable+=" gdbm"
126 + use ncurses || disable+=" _curses _curses_panel"
127 + use readline || disable+=" readline"
128 + use sqlite || disable+=" _sqlite3"
129 + use ssl || export PYTHON_DISABLE_SSL="1"
130 + use tk || disable+=" _tkinter"
131 + use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
132 + export PYTHON_DISABLE_MODULES="${disable}"
133 +
134 + if ! use xml; then
135 + ewarn "You have configured Python without XML support."
136 + ewarn "This is NOT a recommended configuration as you"
137 + ewarn "may face problems parsing any XML documents."
138 + fi
139 +
140 + if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
141 + einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
142 + fi
143 +
144 + if [[ "$(gcc-major-version)" -ge 4 ]]; then
145 + append-flags -fwrapv
146 + fi
147 +
148 + filter-flags -malign-double
149 +
150 + # https://bugs.gentoo.org/show_bug.cgi?id=50309
151 + if is-flagq -O3; then
152 + is-flagq -fstack-protector-all && replace-flags -O3 -O2
153 + use hardened && replace-flags -O3 -O2
154 + fi
155 +
156 + # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
157 + tc-export CXX
158 +
159 + # Set LDFLAGS so we link modules with -lpython3.2 correctly.
160 + # Needed on FreeBSD unless Python 3.2 is already installed.
161 + # Please query BSD team before removing this!
162 + append-ldflags "-L."
163 +
164 + local dbmliborder
165 + if use gdbm; then
166 + dbmliborder+="${dbmliborder:+:}gdbm"
167 + fi
168 +
169 + local myeconfargs=(
170 + --enable-shared
171 + $(use_enable ipv6)
172 + --infodir='${prefix}/share/info'
173 + --mandir='${prefix}/share/man'
174 + --with-computed-gotos
175 + --with-dbmliborder="${dbmliborder}"
176 + --with-libc=
177 + --enable-loadable-sqlite-extensions
178 + --without-ensurepip
179 + --with-system-expat
180 + --with-system-ffi
181 + )
182 +
183 + OPT="" econf "${myeconfargs[@]}"
184 +}
185 +
186 +src_compile() {
187 + # Ensure sed works as expected
188 + # https://bugs.gentoo.org/594768
189 + local -x LC_ALL=C
190 +
191 + emake CPPFLAGS= CFLAGS= LDFLAGS=
192 +
193 + # Work around bug 329499. See also bug 413751 and 457194.
194 + if has_version dev-libs/libffi[pax_kernel]; then
195 + pax-mark E python
196 + else
197 + pax-mark m python
198 + fi
199 +}
200 +
201 +src_test() {
202 + # Tests will not work when cross compiling.
203 + if tc-is-cross-compiler; then
204 + elog "Disabling tests due to crosscompiling."
205 + return
206 + fi
207 +
208 + # Skip failing tests.
209 + local skipped_tests="gdb"
210 +
211 + for test in ${skipped_tests}; do
212 + mv "${S}"/Lib/test/test_${test}.py "${T}"
213 + done
214 +
215 + # bug 660358
216 + local -x COLUMNS=80
217 +
218 + local -x PYTHONDONTWRITEBYTECODE=
219 +
220 + emake test EXTRATESTOPTS="-u-network" CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
221 + local result=$?
222 +
223 + for test in ${skipped_tests}; do
224 + mv "${T}/test_${test}.py" "${S}"/Lib/test
225 + done
226 +
227 + elog "The following tests have been skipped:"
228 + for test in ${skipped_tests}; do
229 + elog "test_${test}.py"
230 + done
231 +
232 + elog "If you would like to run them, you may:"
233 + elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'"
234 + elog "and run the tests separately."
235 +
236 + if [[ ${result} -ne 0 ]]; then
237 + die "emake test failed"
238 + fi
239 +}
240 +
241 +src_install() {
242 + local libdir=${ED%/}/usr/lib/python${PYVER}
243 +
244 + emake DESTDIR="${D}" altinstall
245 +
246 + sed \
247 + -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
248 + -e "s/\(PY_LDFLAGS=\).*/\1/" \
249 + -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed"
250 +
251 + # Fix collisions between different slots of Python.
252 + rm -f "${ED%/}/usr/$(get_libdir)/libpython3.so"
253 +
254 + # Cheap hack to get version with ABIFLAGS
255 + local abiver=$(cd "${ED%/}/usr/include"; echo python*)
256 + if [[ ${abiver} != python${PYVER} ]]; then
257 + # Replace python3.X with a symlink to python3.Xm
258 + rm "${ED%/}/usr/bin/python${PYVER}" || die
259 + dosym "${abiver}" "/usr/bin/python${PYVER}"
260 + # Create python3.X-config symlink
261 + dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
262 + # Create python-3.5m.pc symlink
263 + dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
264 + fi
265 +
266 + # python seems to get rebuilt in src_install (bug 569908)
267 + # Work around it for now.
268 + if has_version dev-libs/libffi[pax_kernel]; then
269 + pax-mark E "${ED%/}/usr/bin/${abiver}"
270 + else
271 + pax-mark m "${ED%/}/usr/bin/${abiver}"
272 + fi
273 +
274 + use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
275 + use tk || rm -r "${ED%/}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
276 +
277 + use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die
278 +
279 + dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS}
280 +
281 + if use examples; then
282 + insinto /usr/share/doc/${PF}/examples
283 + find "${S}"/Tools -name __pycache__ -print0 | xargs -0 rm -fr
284 + doins -r "${S}"/Tools
285 + fi
286 + insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
287 + local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
288 + emake --no-print-directory -s -f - 2>/dev/null)
289 + newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
290 +
291 + newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
292 + newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
293 + sed \
294 + -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
295 + -e "s:@PYDOC@:pydoc${PYVER}:" \
296 + -i "${ED%/}/etc/conf.d/pydoc-${PYVER}" "${ED%/}/etc/init.d/pydoc-${PYVER}" || die "sed failed"
297 +
298 + # for python-exec
299 + local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
300 +
301 + # if not using a cross-compiler, use the fresh binary
302 + if ! tc-is-cross-compiler; then
303 + local -x PYTHON=./python
304 + local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
305 + else
306 + vars=( PYTHON "${vars[@]}" )
307 + fi
308 +
309 + python_export "python${PYVER}" "${vars[@]}"
310 + echo "EPYTHON='${EPYTHON}'" > epython.py || die
311 + python_domodule epython.py
312 +
313 + # python-exec wrapping support
314 + local pymajor=${PYVER%.*}
315 + mkdir -p "${D%/}${PYTHON_SCRIPTDIR}" || die
316 + # python and pythonX
317 + ln -s "../../../bin/${abiver}" "${D%/}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
318 + ln -s "python${pymajor}" "${D%/}${PYTHON_SCRIPTDIR}/python" || die
319 + # python-config and pythonX-config
320 + # note: we need to create a wrapper rather than symlinking it due
321 + # to some random dirname(argv[0]) magic performed by python-config
322 + cat > "${D%/}${PYTHON_SCRIPTDIR}/python${pymajor}-config" <<-EOF || die
323 + #!/bin/sh
324 + exec "${abiver}-config" "\${@}"
325 + EOF
326 + chmod +x "${D%/}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
327 + ln -s "python${pymajor}-config" "${D%/}${PYTHON_SCRIPTDIR}/python-config" || die
328 + # 2to3, pydoc, pyvenv
329 + ln -s "../../../bin/2to3-${PYVER}" "${D%/}${PYTHON_SCRIPTDIR}/2to3" || die
330 + ln -s "../../../bin/pydoc${PYVER}" "${D%/}${PYTHON_SCRIPTDIR}/pydoc" || die
331 + ln -s "../../../bin/pyvenv-${PYVER}" "${D%/}${PYTHON_SCRIPTDIR}/pyvenv" || die
332 + # idle
333 + if use tk; then
334 + ln -s "../../../bin/idle${PYVER}" "${D%/}${PYTHON_SCRIPTDIR}/idle" || die
335 + fi
336 +}
337 +
338 +pkg_preinst() {
339 + if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then
340 + python_updater_warning="1"
341 + fi
342 +}
343 +
344 +eselect_python_update() {
345 + if [[ -z "$(eselect python show)" || ! -f "${EROOT%/}/usr/bin/$(eselect python show)" ]]; then
346 + eselect python update
347 + fi
348 +
349 + if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT%/}/usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
350 + eselect python update --python${PV%%.*}
351 + fi
352 +}
353 +
354 +pkg_postinst() {
355 + eselect_python_update
356 +
357 + if [[ "${python_updater_warning}" == "1" ]]; then
358 + ewarn "You have just upgraded from an older version of Python."
359 + ewarn
360 + ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules."
361 + fi
362 +}
363 +
364 +pkg_postrm() {
365 + eselect_python_update
366 +}