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:12
Message-Id: 1551631860.85ffc0e1f88866fcb9986e49160e7d08c8b7ec83.floppym@gentoo
1 commit: 85ffc0e1f88866fcb9986e49160e7d08c8b7ec83
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Sun Mar 3 16:13:25 2019 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sun Mar 3 16:51:00 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=85ffc0e1
7
8 dev-lang/python: bump to 3.6.8
9
10 Bug: 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-3.6.8.ebuild | 349 ++++++++++++++++++++++++++++++++++++
16 2 files changed, 351 insertions(+)
17
18 diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
19 index cdfd2498cea..8f5351e48e6 100644
20 --- a/dev-lang/python/Manifest
21 +++ b/dev-lang/python/Manifest
22 @@ -8,6 +8,7 @@ DIST Python-3.6.3.tar.xz 16974296 BLAKE2B 8220fc0c2eaa315d3972085b0f531f169adb6c
23 DIST Python-3.6.4.tar.xz 16992824 BLAKE2B 2347a70bb25468221178b1542ddd4376f136a515f2873ee1f640c4629eb77a9608af0f6be37128ba3e8ad614ebc17e7be20b73384983533aa77bca4403ea7935 SHA512 09ba2103ac517ac4d262f00380c9aac836a53401ce252540c17fd821a3b92e1ddf32528d00772221eb3126b12cb95b62c3ac3e852f4951e6f2eb406c88c848a2
24 DIST Python-3.6.5.tar.xz 17049912 BLAKE2B f393e9563a18a46c457afcd2e174d9eacda20fe2b0ae5461e11c582fa4d27b85c01bbe7b602f45511b6b44f635c6330205b12fb3e8325ffd07e87b78a8258889 SHA512 6b26fcd296b9bd8e67861eff10d14db7507711ddba947288d16d6def53135c39326b7f969c04bb2b2993f924d9e7ad3f5c5282a3915760bc0885cf0a8ea5eb51
25 DIST Python-3.6.6.tar.xz 17156744 BLAKE2B fa4333149f84570cc4a0d1ec76c819610888750a51268b9db7d05df7d9c11e5ed72daff5d81b404015d9c678cb034d8a32034262ce73629ee8f96772853a706c SHA512 c71f87c5906e770322a14cacad228655659f782207db826320449d12bf86091c3662f317e1773158dec52f8b052eaedfb4c03b561cc2a6cfcd381597fd2d2b04
26 +DIST Python-3.6.8.tar.xz 17212420 BLAKE2B e104b49a35492b622080ab81a446c0cdd1223e8ddf95c4e1b262762a027664b59f3e4deeda4ba7177115d780e48b6764a053acef640a645327df428d2e4820cd SHA512 b17867e451ebe662f50df83ed112d3656c089e7d750651ea640052b01b713b58e66aac9e082f71fd16f5b5510bc9b797f5ccd30f5399581e9aa406197f02938a
27 DIST Python-3.7.0.tar.xz 16922100 BLAKE2B cd2afd9ad1847ca793bc64ecb637906c35e0c8da8392d626cce3ebf19be5ccde1e6dcc499b933359cb24dcdbd024b3aaa916f96ed893b1f52d9825e404f27e5f SHA512 8bb11233fb67ee9ab8ed1b72f8fdc62f66e26a6beaaeb92448bce681cf065269833b1658d3ed2459127f25ba43adb0eab73cf27c59834a2a803fb529b4216739
28 DIST Python-3.7.2.tar.xz 17042320 BLAKE2B 79b06b7d38590b7ad00850a4323156bfee07c4cf8531cbc09d262c6eb38721e32b8b0591fc21017e56948dd81763e9061f118f204eda5b9cc0b84e7132b42979 SHA512 6cd2d6d8455558783b99d55985cd7b22d67b98f41a09b4fdd96f680a630a4e035220d2b903f8c59ed513aa5ffe6730fa947ddb55bb72ce36f0e945ef8af5d971
29 DIST python-gentoo-patches-2.7.15.tar.xz 16208 BLAKE2B 5739c2b3a236d48f8e33f0fe6515bfe7a8f99096f6223b402653988feac2513d37d26b6e40e5e049852f42657358170e468ca60097e0e2294e760787c12ad591 SHA512 687fd008d1d41b1e65ce5417f6f6aba84ffd42f7af44ef97c03a7806b28e6888f8df043a0c15187a8b229cc17642853e6feb25494db97f4d10f8a66f8ebcbcca
30 @@ -17,5 +18,6 @@ DIST python-gentoo-patches-3.5.4-0.tar.xz 11704 BLAKE2B 4a7d71feff18c7c8c109bed1
31 DIST python-gentoo-patches-3.6.2-0.tar.xz 10744 BLAKE2B 3075754627617ac2ceee879eaf1a0e6564505655cdbdff380233a09df701a6188d64fe1f6a8c642b1fb05ef3c460a07042b6a362d655cd02717d6d9ba47983a1 SHA512 2aac1700c541202aa4f43bff4cb521b996d52ab350133318abaddb43f4b6e20548f37de472ace8024ef325ebf63fdfff0d43f8aa1f717d3c56f974b7aa1764e3
32 DIST python-gentoo-patches-3.6.4.tar.xz 12888 BLAKE2B 7cf49ae22df53e855f2e99df51686b5d4bd0da82ef4c22836e24726ea9ed561808352c0305a5659b052d38b843f1ff61b6466a7bc3673b7e5cfb4d81d22fa4bc SHA512 90a1b685f2539872ffd67f96581f70145b7afaf18af19f4a7f4a61214103d2a10bf0069c1769dac229ae011fceaf8538f041082b33c1671905246d018d184dd7
33 DIST python-gentoo-patches-3.6.6.tar.xz 13876 BLAKE2B 4be56b54e70c9b83209734097e03a7dbaa8f46ae13e268fc6a7f465ffd052ce03ca9e1fc45f1d432f2de17d4ce16ca8bc684b24344862cd8f52f9d1a90d90b7a SHA512 534b9eaefcbc45908119852a103bf10e400a8628c66aa599812fbceda36810d626d33e6701d1b7866e4df68397f717df6a217cb414049ca6f378eff9f43a27ab
34 +DIST python-gentoo-patches-3.6.8.tar.xz 11224 BLAKE2B 5fe38282bcf28df18e0bd37756c880ae191ea738dc92f1cf83f682cfdc52525b9c44287dc99191a73d75c90672ab501b56adf49515b35ff1fdee88c8dc07b175 SHA512 89e700663db25d6d78eee1d4bfdab686c5341a794062f3a63df3485ac0b58deb4b4885d24701f3ae138d06ca783be92e310e1100c6d633910c33732f3cb0d7df
35 DIST python-gentoo-patches-3.7.0.tar.xz 12268 BLAKE2B 758b635ff53b6f7bfabb1db632ee2a5c14b163d6d6f14e4e44c31c9ac1591d411f597d42b05707f586f9ff7c3a030703502307bae732bcf003987939eb5b036d SHA512 19dd5bac06bb40622e74e3b16c7fba83f1178417e686eaf61b2b207602c76beebc8c78d675e401ec4d18add1ca033fd47baf2e48e9abb487593b7d821bcaf509
36 DIST python-gentoo-patches-3.7.2.tar.xz 9776 BLAKE2B fe451c3fb44a1ace4489d1bc68db9848b4227422fe9135659594248d057a8916e2abfe8e2677ef6efc9c962dbefe3ca7cd05cbd62b325d53eef6b05928f82017 SHA512 55e932624333b78b55e8981aaa7e7bfbddb635a61f594353a77a6bd5c2b57de31a4ee9ae04e072c4e2eb0fddd1c2702b4bd6133cf0a2c94ab35808df86550156
37
38 diff --git a/dev-lang/python/python-3.6.8.ebuild b/dev-lang/python/python-3.6.8.ebuild
39 new file mode 100644
40 index 00000000000..f91b8039ecd
41 --- /dev/null
42 +++ b/dev-lang/python/python-3.6.8.ebuild
43 @@ -0,0 +1,349 @@
44 +# Copyright 1999-2019 Gentoo Authors
45 +# Distributed under the terms of the GNU General Public License v2
46 +
47 +EAPI="6"
48 +WANT_LIBTOOL="none"
49 +
50 +inherit autotools flag-o-matic pax-utils python-utils-r1 toolchain-funcs
51 +
52 +MY_P="Python-${PV}"
53 +PATCHSET_VERSION="3.6.8"
54 +
55 +DESCRIPTION="An interpreted, interactive, object-oriented programming language"
56 +HOMEPAGE="https://www.python.org/"
57 +SRC_URI="https://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz
58 + https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz"
59 +
60 +LICENSE="PSF-2"
61 +SLOT="3.6/3.6m"
62 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
63 +IUSE="bluetooth build examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test +threads tk wininst +xml"
64 +RESTRICT="!test? ( test )"
65 +
66 +# Do not add a dependency on dev-lang/python to this ebuild.
67 +# If you need to apply a patch which requires python for bootstrapping, please
68 +# run the bootstrap code on your dev box and include the results in the
69 +# patchset. See bug 447752.
70 +
71 +RDEPEND="app-arch/bzip2:0=
72 + app-arch/xz-utils:0=
73 + >=sys-libs/zlib-1.1.3:0=
74 + virtual/libffi:=
75 + virtual/libintl
76 + gdbm? ( sys-libs/gdbm:0=[berkdb] )
77 + ncurses? ( >=sys-libs/ncurses-5.2:0= )
78 + readline? ( >=sys-libs/readline-4.1:0= )
79 + sqlite? ( >=dev-db/sqlite-3.3.8:3= )
80 + ssl? (
81 + !libressl? ( dev-libs/openssl:0= )
82 + libressl? ( dev-libs/libressl:0= )
83 + )
84 + tk? (
85 + >=dev-lang/tcl-8.0:0=
86 + >=dev-lang/tk-8.0:0=
87 + dev-tcltk/blt:0=
88 + dev-tcltk/tix
89 + )
90 + xml? ( >=dev-libs/expat-2.1:0= )
91 + !!<sys-apps/sandbox-2.6-r1"
92 +# bluetooth requires headers from bluez
93 +DEPEND="${RDEPEND}
94 + bluetooth? ( net-wireless/bluez )
95 + test? ( app-arch/xz-utils[extra-filters(+)] )
96 + virtual/pkgconfig
97 + !sys-devel/gcc[libffi(-)]"
98 +RDEPEND+=" !build? ( app-misc/mime-types )"
99 +PDEPEND=">=app-eselect/eselect-python-20140125-r1"
100 +
101 +S="${WORKDIR}/${MY_P}"
102 +PYVER=${SLOT%/*}
103 +
104 +src_prepare() {
105 + # Ensure that internal copies of expat, libffi and zlib are not used.
106 + rm -fr Modules/expat
107 + rm -fr Modules/_ctypes/libffi*
108 + rm -fr Modules/zlib
109 +
110 + local PATCHES=(
111 + "${WORKDIR}/patches"
112 + )
113 +
114 + default
115 +
116 + sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
117 + Lib/distutils/command/install.py \
118 + Lib/distutils/sysconfig.py \
119 + Lib/site.py \
120 + Lib/sysconfig.py \
121 + Lib/test/test_site.py \
122 + Makefile.pre.in \
123 + Modules/Setup.dist \
124 + Modules/getpath.c \
125 + configure.ac \
126 + setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
127 +
128 + eautoreconf
129 +}
130 +
131 +src_configure() {
132 + local disable
133 + # disable automagic bluetooth headers detection
134 + use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
135 + use gdbm || disable+=" gdbm"
136 + use ncurses || disable+=" _curses _curses_panel"
137 + use readline || disable+=" readline"
138 + use sqlite || disable+=" _sqlite3"
139 + use ssl || export PYTHON_DISABLE_SSL="1"
140 + use tk || disable+=" _tkinter"
141 + use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
142 + export PYTHON_DISABLE_MODULES="${disable}"
143 +
144 + if ! use xml; then
145 + ewarn "You have configured Python without XML support."
146 + ewarn "This is NOT a recommended configuration as you"
147 + ewarn "may face problems parsing any XML documents."
148 + fi
149 +
150 + if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
151 + einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
152 + fi
153 +
154 + if [[ "$(gcc-major-version)" -ge 4 ]]; then
155 + append-flags -fwrapv
156 + fi
157 +
158 + filter-flags -malign-double
159 +
160 + # https://bugs.gentoo.org/show_bug.cgi?id=50309
161 + if is-flagq -O3; then
162 + is-flagq -fstack-protector-all && replace-flags -O3 -O2
163 + use hardened && replace-flags -O3 -O2
164 + fi
165 +
166 + # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
167 + tc-export CXX
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 + local myeconfargs=(
180 + --with-fpectl
181 + --enable-shared
182 + $(use_enable ipv6)
183 + $(use_with threads)
184 + --infodir='${prefix}/share/info'
185 + --mandir='${prefix}/share/man'
186 + --with-computed-gotos
187 + --with-dbmliborder="${dbmliborder}"
188 + --with-libc=
189 + --enable-loadable-sqlite-extensions
190 + --without-ensurepip
191 + --with-system-expat
192 + --with-system-ffi
193 + )
194 +
195 + OPT="" econf "${myeconfargs[@]}"
196 +
197 + if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
198 + eerror "configure has detected that the sem_open function is broken."
199 + eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
200 + die "Broken sem_open function (bug 496328)"
201 + fi
202 +}
203 +
204 +src_compile() {
205 + # Ensure sed works as expected
206 + # https://bugs.gentoo.org/594768
207 + local -x LC_ALL=C
208 +
209 + emake CPPFLAGS= CFLAGS= LDFLAGS=
210 +
211 + # Work around bug 329499. See also bug 413751 and 457194.
212 + if has_version dev-libs/libffi[pax_kernel]; then
213 + pax-mark E python
214 + else
215 + pax-mark m python
216 + fi
217 +}
218 +
219 +src_test() {
220 + # Tests will not work when cross compiling.
221 + if tc-is-cross-compiler; then
222 + elog "Disabling tests due to crosscompiling."
223 + return
224 + fi
225 +
226 + # Skip failing tests.
227 + local skipped_tests="gdb"
228 +
229 + for test in ${skipped_tests}; do
230 + mv "${S}"/Lib/test/test_${test}.py "${T}"
231 + done
232 +
233 + # bug 660358
234 + local -x COLUMNS=80
235 +
236 + local -x PYTHONDONTWRITEBYTECODE=
237 +
238 + emake test EXTRATESTOPTS="-u-network" CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
239 + local result=$?
240 +
241 + for test in ${skipped_tests}; do
242 + mv "${T}/test_${test}.py" "${S}"/Lib/test
243 + done
244 +
245 + elog "The following tests have been skipped:"
246 + for test in ${skipped_tests}; do
247 + elog "test_${test}.py"
248 + done
249 +
250 + elog "If you would like to run them, you may:"
251 + elog "cd '${EPREFIX}/usr/$(get_libdir)/python${PYVER}/test'"
252 + elog "and run the tests separately."
253 +
254 + if [[ ${result} -ne 0 ]]; then
255 + die "emake test failed"
256 + fi
257 +}
258 +
259 +src_install() {
260 + local libdir=${ED}/usr/$(get_libdir)/python${PYVER}
261 +
262 + emake DESTDIR="${D}" altinstall
263 +
264 + sed \
265 + -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
266 + -e "s/\(PY_LDFLAGS=\).*/\1/" \
267 + -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed"
268 +
269 + # Fix collisions between different slots of Python.
270 + rm -f "${ED}usr/$(get_libdir)/libpython3.so"
271 +
272 + # Cheap hack to get version with ABIFLAGS
273 + local abiver=$(cd "${ED}usr/include"; echo python*)
274 + if [[ ${abiver} != python${PYVER} ]]; then
275 + # Replace python3.X with a symlink to python3.Xm
276 + rm "${ED}usr/bin/python${PYVER}" || die
277 + dosym "${abiver}" "/usr/bin/python${PYVER}"
278 + # Create python3.X-config symlink
279 + dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
280 + # Create python-3.5m.pc symlink
281 + dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
282 + fi
283 +
284 + # python seems to get rebuilt in src_install (bug 569908)
285 + # Work around it for now.
286 + if has_version dev-libs/libffi[pax_kernel]; then
287 + pax-mark E "${ED}usr/bin/${abiver}"
288 + else
289 + pax-mark m "${ED}usr/bin/${abiver}"
290 + fi
291 +
292 + use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
293 + use tk || rm -r "${ED}usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
294 +
295 + use threads || rm -r "${libdir}/multiprocessing" || die
296 + use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die
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 +}