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, 01 Jan 2021 16:45:14
Message-Id: 1609519505.4faddad008d735373844e0398901d0d93e03625d.mgorny@gentoo
1 commit: 4faddad008d735373844e0398901d0d93e03625d
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 1 16:39:31 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Jan 1 16:45:05 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4faddad0
7
8 dev-lang/python: Remove old
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-lang/python/Manifest | 2 -
13 dev-lang/python/python-3.10.0_alpha1.ebuild | 331 --------------------------
14 dev-lang/python/python-3.8.7_rc1.ebuild | 355 ----------------------------
15 3 files changed, 688 deletions(-)
16
17 diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
18 index 917be956873..a83ea29bae2 100644
19 --- a/dev-lang/python/Manifest
20 +++ b/dev-lang/python/Manifest
21 @@ -1,5 +1,4 @@
22 DIST Python-2.7.18.tar.xz 12854736 BLAKE2B 060a621c91dd8e3d321aec99d44c17aa67381998256a1a002d316b38288349884d5960de35c49352d03129ed0bae599e641ec2225898158ebce50a7a2fd74d2c SHA512 a7bb62b51f48ff0b6df0b18f5b0312a523e3110f49c3237936bfe56ed0e26838c0274ff5401bda6fc21bf24337477ccac49e8026c5d651e4b4cafb5eb5086f6c
23 -DIST Python-3.10.0a1.tar.xz 18571152 BLAKE2B d74e467dfce1a0e3374377fc36865f1059e3810f67492608bbcfdb6880fc9a748ed19d1e3c4617a9218c842e8e9cb4119845eccb6848acae9b4af389cbbdb43a SHA512 eb1a0f6dd023efe67cfc2c833b0a7d390765d288e4da7aae932ba66b970d63ad377dbe48ddf0548c5cca5334a3aa1c7e92f972b68c54e4238ea1f3610adb8910
24 DIST Python-3.10.0a3.tar.xz 18676916 BLAKE2B 86c8e3cd5d9658a2b1027558eda42294807173cac39010737dba6a0bf75a3a7211297cb79061085ab0cea52eaaba521140ff67c3b6edeebd677429191f4435b5 SHA512 a361c04081e9bd7e740c3311d92ec1428f12c589613ab39ed2bb1ac5aa20e4d8bc6d6e76eefc20edd459ecf8be1720f3985126be38407fcfb41f5a6efcea3998
25 DIST Python-3.6.11.tar.xz 17213036 BLAKE2B 4dae9d9c5eb7e97a8990b0b5739d40ba8a85081c7e03adc22a3305e713d39b3a98ff66c17b395b9d45355e124307eed87803211378d14360e8b3455f7146a1ba SHA512 c76969a6602e095641ba5fd0999a47cf0187eb26559ba9a6e80fe401b8928f6cd9eabd963f615f7c667e48f56603f2508d2b5692c83ea8da1e21292131fb11d6
26 DIST Python-3.6.12.tar.xz 17202980 BLAKE2B c8d22e4d57bcaffe77cd902cda3a473e73adf2b74ab104c23b4d846f19632a24cc0c478af84079b16d784bd1c0956824c06c1f6134fd24f54e58aaab0fe96bb6 SHA512 1462801f3f6626a853097d34ccdca9838c4c5bd81ecc3abc751003f5f2f8d36eecdaa4130ef4218de351c5586093c11669639a34492668fbc5a2a4a241f4a070
27 @@ -9,7 +8,6 @@ DIST Python-3.8.4.tar.xz 18020412 BLAKE2B cfcfb293c413b25fc3ca48116cf8ffaba7bee1
28 DIST Python-3.8.5.tar.xz 18019640 BLAKE2B bb3e0566afe28759e4ab129ad0986a0fc5103514f2e2b22ff4aa3973c3173ebdd24d4267fbaf903841814a611fd9ea122673e5a1918934366e5c0efaef9d7517 SHA512 460cee65d7df7150694590575502d7f22e548ebfc99c8f8b363eef8bf30ee72e58d8ffacb1d607824f877f880eb9fd6775a508388029583e1e1df3380f3f9587
29 DIST Python-3.8.6.tar.xz 18233864 BLAKE2B c8a8ef6055e344dda30eb808804cfa62016b4f840257cffd5a495e5932f5696e50579d49b8181a487c9cd4a89bdb95656e80981039783a21d20f7980aa2c9883 SHA512 22faec84f6e172e1ac7c6bd6fd37e9b6ae4afc91cf5136aa8cac8ebbed8d18793f9196e8749b8ccc43447cb6c41cb450f65ea72dd363c06dfaeb14e0455f5560
30 DIST Python-3.8.7.tar.xz 18261096 BLAKE2B 6ac20efef41e828cb796aabcb7808400d494b9b48759950c8c15ee90762394f6763163d8e37ab407c1c79ebb9cda09189eaa969a75f96c86a96ccee962443924 SHA512 6a27d8eab3076930df46b0cf127f9b664f8d4147349b2b98132f464deb7f69d87e0167e8ee8e6c64249125ad73760d965ecbc81c252b63a1e7aac95594c62b74
31 -DIST Python-3.8.7rc1.tar.xz 18258688 BLAKE2B cd18abf3a2f97856581735fc6ab98882c3839edd84f736b2f681a227694319f410154201e5e09938ec45ba00b69a593737da22263560080da72625f8611f14c6 SHA512 0c42622433b968dc0943894bff6e90603bdfc4e49ab4373e2686a158e1d4b3450e60aa16d8203ce3d0e0e8bb0ebcaad281ccd7eb03b355eeeb7c811a4cd799ec
32 DIST Python-3.9.0.tar.xz 18866140 BLAKE2B 8e12b64e187a65461473ac3b281dc489f0abac586e0755f6dbeceb236b34bdc008085eeac9ee1a19d76f5ec6a2fbda623985454c9d0164c4888a97b8cd940034 SHA512 b141039c9701a8cb0d15cd11a279153077524af4d0599e7d2c7279d4c18d05fda06b33ef82342d875de996c7117b7dc6eb154dc3669d38a1efa99801aeec6c5e
33 DIST Python-3.9.1.tar.xz 18897104 BLAKE2B bcbce176510e8e7c6ba6070588bedc52121c21c5271f59b3d629dfb542c51ee62622b2ca53a6e2041f1a51b2d089368cc4de9bb749e8ebad9a2c4eb4de83538e SHA512 b90029d6825751685983e9dcf0e0ec9e46f18e6c7d37b0dd7a245a94316f8c0090308ad7c2b2b49ed2514b0b909177231dd5bcad03031bf4624e37136fcf8019
34 DIST python-gentoo-patches-2.7.18-r3.tar.xz 18856 BLAKE2B e35b3d847dad114057b7dab7615941b4879f3531aff1d23bced22da2d445cdec77cdd416566611ca01a3d39f30f16ef224f835f35ca12a301024d7a9fb6a507b SHA512 abb102223555535d5214fa91fd4bb3d1241050c86027af1612a9bd43fea2721e184587e5b784e5af9cbf563b8fec5a25cd07dc5fa72d762228734713176cfcbd
35
36 diff --git a/dev-lang/python/python-3.10.0_alpha1.ebuild b/dev-lang/python/python-3.10.0_alpha1.ebuild
37 deleted file mode 100644
38 index ea470a43ed9..00000000000
39 --- a/dev-lang/python/python-3.10.0_alpha1.ebuild
40 +++ /dev/null
41 @@ -1,331 +0,0 @@
42 -# Copyright 1999-2020 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 check-reqs flag-o-matic multiprocessing pax-utils \
49 - python-utils-r1 toolchain-funcs
50 -
51 -MY_P="Python-${PV/_alpha/a}"
52 -PYVER=$(ver_cut 1-2)
53 -PATCHSET="python-gentoo-patches-3.10.0a1"
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/~mgorny/dist/python/${PATCHSET}.tar.xz"
59 -S="${WORKDIR}/${MY_P}"
60 -
61 -LICENSE="PSF-2"
62 -SLOT="${PYVER}"
63 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
64 -IUSE="bluetooth build examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test tk wininst +xml"
65 -RESTRICT="!test? ( test )"
66 -
67 -# Do not add a dependency on dev-lang/python to this ebuild.
68 -# If you need to apply a patch which requires python for bootstrapping, please
69 -# run the bootstrap code on your dev box and include the results in the
70 -# patchset. See bug 447752.
71 -
72 -RDEPEND="app-arch/bzip2:=
73 - app-arch/xz-utils:=
74 - dev-libs/libffi:=
75 - sys-apps/util-linux:=
76 - >=sys-libs/zlib-1.1.3:=
77 - virtual/libcrypt:=
78 - virtual/libintl
79 - gdbm? ( sys-libs/gdbm:=[berkdb] )
80 - ncurses? ( >=sys-libs/ncurses-5.2:= )
81 - readline? ( >=sys-libs/readline-4.1:= )
82 - sqlite? ( >=dev-db/sqlite-3.3.8:3= )
83 - ssl? (
84 - !libressl? ( dev-libs/openssl:= )
85 - libressl? ( dev-libs/libressl:= )
86 - )
87 - tk? (
88 - >=dev-lang/tcl-8.0:=
89 - >=dev-lang/tk-8.0:=
90 - dev-tcltk/blt:=
91 - dev-tcltk/tix
92 - )
93 - xml? ( >=dev-libs/expat-2.1:= )"
94 -# bluetooth requires headers from bluez
95 -DEPEND="${RDEPEND}
96 - bluetooth? ( net-wireless/bluez )
97 - test? ( app-arch/xz-utils[extra-filters(+)] )
98 - virtual/pkgconfig
99 - !sys-devel/gcc[libffi(-)]"
100 -RDEPEND+=" !build? ( app-misc/mime-types )"
101 -PDEPEND=">=app-eselect/eselect-python-20140125-r1"
102 -
103 -# large file tests involve a 2.5G file being copied (duplicated)
104 -CHECKREQS_DISK_BUILD=5500M
105 -
106 -pkg_pretend() {
107 - use test && check-reqs_pkg_pretend
108 -}
109 -
110 -pkg_setup() {
111 - use test && check-reqs_pkg_setup
112 -}
113 -
114 -src_prepare() {
115 - # Ensure that internal copies of expat, libffi and zlib are not used.
116 - rm -fr Modules/expat || die
117 - rm -fr Modules/_ctypes/libffi* || die
118 - rm -fr Modules/zlib || die
119 -
120 - local PATCHES=(
121 - "${WORKDIR}/${PATCHSET}"
122 - )
123 -
124 - default
125 -
126 - sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
127 - setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
128 -
129 - # force correct number of jobs
130 - # https://bugs.gentoo.org/737660
131 - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
132 - sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die
133 - sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die
134 -
135 - eautoreconf
136 -}
137 -
138 -src_configure() {
139 - local disable
140 - # disable automagic bluetooth headers detection
141 - use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
142 - use gdbm || disable+=" gdbm"
143 - use ncurses || disable+=" _curses _curses_panel"
144 - use readline || disable+=" readline"
145 - use sqlite || disable+=" _sqlite3"
146 - use ssl || export PYTHON_DISABLE_SSL="1"
147 - use tk || disable+=" _tkinter"
148 - use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
149 - export PYTHON_DISABLE_MODULES="${disable}"
150 -
151 - if ! use xml; then
152 - ewarn "You have configured Python without XML support."
153 - ewarn "This is NOT a recommended configuration as you"
154 - ewarn "may face problems parsing any XML documents."
155 - fi
156 -
157 - if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
158 - einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
159 - fi
160 -
161 - if [[ "$(gcc-major-version)" -ge 4 ]]; then
162 - append-flags -fwrapv
163 - fi
164 -
165 - filter-flags -malign-double
166 -
167 - # https://bugs.gentoo.org/show_bug.cgi?id=50309
168 - if is-flagq -O3; then
169 - is-flagq -fstack-protector-all && replace-flags -O3 -O2
170 - use hardened && replace-flags -O3 -O2
171 - fi
172 -
173 - # https://bugs.gentoo.org/700012
174 - if is-flagq -flto || is-flagq '-flto=*'; then
175 - append-cflags $(test-flags-CC -ffat-lto-objects)
176 - fi
177 -
178 - # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
179 - tc-export CXX
180 -
181 - # Set LDFLAGS so we link modules with -lpython3.2 correctly.
182 - # Needed on FreeBSD unless Python 3.2 is already installed.
183 - # Please query BSD team before removing this!
184 - append-ldflags "-L."
185 -
186 - # Fix implicit declarations on cross and prefix builds. Bug #674070.
187 - use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
188 -
189 - local dbmliborder
190 - if use gdbm; then
191 - dbmliborder+="${dbmliborder:+:}gdbm"
192 - fi
193 -
194 - local myeconfargs=(
195 - # glibc-2.30 removes it; since we can't cleanly force-rebuild
196 - # Python on glibc upgrade, remove it proactively to give
197 - # a chance for users rebuilding python before glibc
198 - ac_cv_header_stropts_h=no
199 -
200 - --enable-shared
201 - $(use_enable ipv6)
202 - --infodir='${prefix}/share/info'
203 - --mandir='${prefix}/share/man'
204 - --with-computed-gotos
205 - --with-dbmliborder="${dbmliborder}"
206 - --with-libc=
207 - --enable-loadable-sqlite-extensions
208 - --without-ensurepip
209 - --with-system-expat
210 - --with-system-ffi
211 - )
212 -
213 - OPT="" econf "${myeconfargs[@]}"
214 -}
215 -
216 -src_compile() {
217 - # Ensure sed works as expected
218 - # https://bugs.gentoo.org/594768
219 - local -x LC_ALL=C
220 -
221 - emake CPPFLAGS= CFLAGS= LDFLAGS=
222 -
223 - # Work around bug 329499. See also bug 413751 and 457194.
224 - if has_version dev-libs/libffi[pax_kernel]; then
225 - pax-mark E python
226 - else
227 - pax-mark m python
228 - fi
229 -}
230 -
231 -src_test() {
232 - # Tests will not work when cross compiling.
233 - if tc-is-cross-compiler; then
234 - elog "Disabling tests due to crosscompiling."
235 - return
236 - fi
237 -
238 - # Skip failing tests.
239 - local skipped_tests="gdb"
240 -
241 - for test in ${skipped_tests}; do
242 - mv "${S}"/Lib/test/test_${test}.py "${T}"
243 - done
244 -
245 - # bug 660358
246 - local -x COLUMNS=80
247 - local -x PYTHONDONTWRITEBYTECODE=
248 -
249 - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
250 -
251 - emake test EXTRATESTOPTS="-u-network -j${jobs}" \
252 - CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
253 - local result=$?
254 -
255 - for test in ${skipped_tests}; do
256 - mv "${T}/test_${test}.py" "${S}"/Lib/test
257 - done
258 -
259 - elog "The following tests have been skipped:"
260 - for test in ${skipped_tests}; do
261 - elog "test_${test}.py"
262 - done
263 -
264 - elog "If you would like to run them, you may:"
265 - elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'"
266 - elog "and run the tests separately."
267 -
268 - if [[ ${result} -ne 0 ]]; then
269 - die "emake test failed"
270 - fi
271 -}
272 -
273 -src_install() {
274 - local libdir=${ED}/usr/lib/python${PYVER}
275 -
276 - emake DESTDIR="${D}" altinstall
277 -
278 - # Remove static library
279 - rm "${ED}"/usr/$(get_libdir)/libpython*.a || die
280 -
281 - sed \
282 - -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
283 - -e "s/\(PY_LDFLAGS=\).*/\1/" \
284 - -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed"
285 -
286 - # Fix collisions between different slots of Python.
287 - rm "${ED}/usr/$(get_libdir)/libpython3.so" || die
288 -
289 - # Cheap hack to get version with ABIFLAGS
290 - local abiver=$(cd "${ED}/usr/include"; echo python*)
291 - if [[ ${abiver} != python${PYVER} ]]; then
292 - # Replace python3.X with a symlink to python3.Xm
293 - rm "${ED}/usr/bin/python${PYVER}" || die
294 - dosym "${abiver}" "/usr/bin/python${PYVER}"
295 - # Create python3.X-config symlink
296 - dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
297 - # Create python-3.5m.pc symlink
298 - dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
299 - fi
300 -
301 - # python seems to get rebuilt in src_install (bug 569908)
302 - # Work around it for now.
303 - if has_version dev-libs/libffi[pax_kernel]; then
304 - pax-mark E "${ED}/usr/bin/${abiver}"
305 - else
306 - pax-mark m "${ED}/usr/bin/${abiver}"
307 - fi
308 -
309 - use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
310 - use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
311 -
312 - dodoc Misc/{ACKS,HISTORY,NEWS}
313 -
314 - if use examples; then
315 - docinto examples
316 - find Tools -name __pycache__ -exec rm -fr {} + || die
317 - dodoc -r Tools
318 - fi
319 - insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
320 - local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
321 - emake --no-print-directory -s -f - 2>/dev/null)
322 - newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
323 -
324 - newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
325 - newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
326 - sed \
327 - -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
328 - -e "s:@PYDOC@:pydoc${PYVER}:" \
329 - -i "${ED}/etc/conf.d/pydoc-${PYVER}" \
330 - "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed"
331 -
332 - local -x EPYTHON=python${PYVER}
333 - # if not using a cross-compiler, use the fresh binary
334 - if ! tc-is-cross-compiler; then
335 - local -x PYTHON=./python
336 - local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
337 - else
338 - local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
339 - fi
340 -
341 - echo "EPYTHON='${EPYTHON}'" > epython.py || die
342 - python_domodule epython.py
343 -
344 - # python-exec wrapping support
345 - local pymajor=${PYVER%.*}
346 - local scriptdir=${D}$(python_get_scriptdir)
347 - mkdir -p "${scriptdir}" || die
348 - # python and pythonX
349 - ln -s "../../../bin/${abiver}" \
350 - "${scriptdir}/python${pymajor}" || die
351 - ln -s "python${pymajor}" "${scriptdir}/python" || die
352 - # python-config and pythonX-config
353 - # note: we need to create a wrapper rather than symlinking it due
354 - # to some random dirname(argv[0]) magic performed by python-config
355 - cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die
356 - #!/bin/sh
357 - exec "${abiver}-config" "\${@}"
358 - EOF
359 - chmod +x "${scriptdir}/python${pymajor}-config" || die
360 - ln -s "python${pymajor}-config" \
361 - "${scriptdir}/python-config" || die
362 - # 2to3, pydoc
363 - ln -s "../../../bin/2to3-${PYVER}" \
364 - "${scriptdir}/2to3" || die
365 - ln -s "../../../bin/pydoc${PYVER}" \
366 - "${scriptdir}/pydoc" || die
367 - # idle
368 - if use tk; then
369 - ln -s "../../../bin/idle${PYVER}" \
370 - "${scriptdir}/idle" || die
371 - fi
372 -}
373
374 diff --git a/dev-lang/python/python-3.8.7_rc1.ebuild b/dev-lang/python/python-3.8.7_rc1.ebuild
375 deleted file mode 100644
376 index b60d4405e93..00000000000
377 --- a/dev-lang/python/python-3.8.7_rc1.ebuild
378 +++ /dev/null
379 @@ -1,355 +0,0 @@
380 -# Copyright 1999-2020 Gentoo Authors
381 -# Distributed under the terms of the GNU General Public License v2
382 -
383 -EAPI="7"
384 -WANT_LIBTOOL="none"
385 -
386 -inherit autotools flag-o-matic multiprocessing pax-utils \
387 - python-utils-r1 toolchain-funcs
388 -
389 -MY_P="Python-${PV/_rc/rc}"
390 -PYVER=$(ver_cut 1-2)
391 -PATCHSET="python-gentoo-patches-3.8.6"
392 -
393 -DESCRIPTION="An interpreted, interactive, object-oriented programming language"
394 -HOMEPAGE="https://www.python.org/"
395 -SRC_URI="https://www.python.org/ftp/python/${PV%_rc*}/${MY_P}.tar.xz
396 - https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz"
397 -S="${WORKDIR}/${MY_P}"
398 -
399 -LICENSE="PSF-2"
400 -SLOT="${PYVER}"
401 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
402 -IUSE="bluetooth build examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test tk wininst +xml"
403 -RESTRICT="!test? ( test )"
404 -
405 -# Do not add a dependency on dev-lang/python to this ebuild.
406 -# If you need to apply a patch which requires python for bootstrapping, please
407 -# run the bootstrap code on your dev box and include the results in the
408 -# patchset. See bug 447752.
409 -
410 -RDEPEND="app-arch/bzip2:=
411 - app-arch/xz-utils:=
412 - dev-libs/libffi:=
413 - sys-apps/util-linux:=
414 - >=sys-libs/zlib-1.1.3:=
415 - virtual/libcrypt:=
416 - virtual/libintl
417 - gdbm? ( sys-libs/gdbm:=[berkdb] )
418 - ncurses? ( >=sys-libs/ncurses-5.2:= )
419 - readline? ( >=sys-libs/readline-4.1:= )
420 - sqlite? ( >=dev-db/sqlite-3.3.8:3= )
421 - ssl? (
422 - !libressl? ( dev-libs/openssl:= )
423 - libressl? ( dev-libs/libressl:= )
424 - )
425 - tk? (
426 - >=dev-lang/tcl-8.0:=
427 - >=dev-lang/tk-8.0:=
428 - dev-tcltk/blt:=
429 - dev-tcltk/tix
430 - )
431 - xml? ( >=dev-libs/expat-2.1:= )"
432 -# bluetooth requires headers from bluez
433 -DEPEND="${RDEPEND}
434 - bluetooth? ( net-wireless/bluez )
435 - test? ( app-arch/xz-utils[extra-filters(+)] )
436 - virtual/pkgconfig
437 - !sys-devel/gcc[libffi(-)]"
438 -RDEPEND+=" !build? ( app-misc/mime-types )"
439 -PDEPEND=">=app-eselect/eselect-python-20140125-r1"
440 -
441 -src_prepare() {
442 - # Ensure that internal copies of expat, libffi and zlib are not used.
443 - rm -fr Modules/expat || die
444 - rm -fr Modules/_ctypes/libffi* || die
445 - rm -fr Modules/zlib || die
446 -
447 - local PATCHES=(
448 - "${WORKDIR}/${PATCHSET}"
449 - )
450 -
451 - default
452 -
453 - sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
454 - setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
455 -
456 - # force correct number of jobs
457 - # https://bugs.gentoo.org/737660
458 - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
459 - sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die
460 - sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die
461 -
462 - eautoreconf
463 -}
464 -
465 -src_configure() {
466 - local disable
467 - # disable automagic bluetooth headers detection
468 - use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
469 - use gdbm || disable+=" gdbm"
470 - use ncurses || disable+=" _curses _curses_panel"
471 - use readline || disable+=" readline"
472 - use sqlite || disable+=" _sqlite3"
473 - use ssl || export PYTHON_DISABLE_SSL="1"
474 - use tk || disable+=" _tkinter"
475 - use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
476 - export PYTHON_DISABLE_MODULES="${disable}"
477 -
478 - if ! use xml; then
479 - ewarn "You have configured Python without XML support."
480 - ewarn "This is NOT a recommended configuration as you"
481 - ewarn "may face problems parsing any XML documents."
482 - fi
483 -
484 - if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
485 - einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
486 - fi
487 -
488 - if [[ "$(gcc-major-version)" -ge 4 ]]; then
489 - append-flags -fwrapv
490 - fi
491 -
492 - filter-flags -malign-double
493 -
494 - # https://bugs.gentoo.org/show_bug.cgi?id=50309
495 - if is-flagq -O3; then
496 - is-flagq -fstack-protector-all && replace-flags -O3 -O2
497 - use hardened && replace-flags -O3 -O2
498 - fi
499 -
500 - # https://bugs.gentoo.org/700012
501 - if is-flagq -flto || is-flagq '-flto=*'; then
502 - append-cflags $(test-flags-CC -ffat-lto-objects)
503 - fi
504 -
505 - # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
506 - tc-export CXX
507 -
508 - # Set LDFLAGS so we link modules with -lpython3.2 correctly.
509 - # Needed on FreeBSD unless Python 3.2 is already installed.
510 - # Please query BSD team before removing this!
511 - append-ldflags "-L."
512 -
513 - # Fix implicit declarations on cross and prefix builds. Bug #674070.
514 - use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
515 -
516 - local dbmliborder
517 - if use gdbm; then
518 - dbmliborder+="${dbmliborder:+:}gdbm"
519 - fi
520 -
521 - local myeconfargs=(
522 - # glibc-2.30 removes it; since we can't cleanly force-rebuild
523 - # Python on glibc upgrade, remove it proactively to give
524 - # a chance for users rebuilding python before glibc
525 - ac_cv_header_stropts_h=no
526 -
527 - --enable-shared
528 - $(use_enable ipv6)
529 - --infodir='${prefix}/share/info'
530 - --mandir='${prefix}/share/man'
531 - --with-computed-gotos
532 - --with-dbmliborder="${dbmliborder}"
533 - --with-libc=
534 - --enable-loadable-sqlite-extensions
535 - --without-ensurepip
536 - --with-system-expat
537 - --with-system-ffi
538 - )
539 -
540 - OPT="" econf "${myeconfargs[@]}"
541 -}
542 -
543 -src_compile() {
544 - # Ensure sed works as expected
545 - # https://bugs.gentoo.org/594768
546 - local -x LC_ALL=C
547 -
548 - emake CPPFLAGS= CFLAGS= LDFLAGS=
549 -
550 - # Work around bug 329499. See also bug 413751 and 457194.
551 - if has_version dev-libs/libffi[pax_kernel]; then
552 - pax-mark E python
553 - else
554 - pax-mark m python
555 - fi
556 -}
557 -
558 -src_test() {
559 - # Tests will not work when cross compiling.
560 - if tc-is-cross-compiler; then
561 - elog "Disabling tests due to crosscompiling."
562 - return
563 - fi
564 -
565 - # Skip failing tests.
566 - local skipped_tests="gdb"
567 -
568 - for test in ${skipped_tests}; do
569 - mv "${S}"/Lib/test/test_${test}.py "${T}"
570 - done
571 -
572 - # bug 660358
573 - local -x COLUMNS=80
574 - local -x PYTHONDONTWRITEBYTECODE=
575 -
576 - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
577 -
578 - emake test EXTRATESTOPTS="-u-network -j${jobs}" \
579 - CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
580 - local result=$?
581 -
582 - for test in ${skipped_tests}; do
583 - mv "${T}/test_${test}.py" "${S}"/Lib/test
584 - done
585 -
586 - elog "The following tests have been skipped:"
587 - for test in ${skipped_tests}; do
588 - elog "test_${test}.py"
589 - done
590 -
591 - elog "If you would like to run them, you may:"
592 - elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'"
593 - elog "and run the tests separately."
594 -
595 - if [[ ${result} -ne 0 ]]; then
596 - die "emake test failed"
597 - fi
598 -}
599 -
600 -src_install() {
601 - local libdir=${ED}/usr/lib/python${PYVER}
602 -
603 - emake DESTDIR="${D}" altinstall
604 -
605 - # Remove static library
606 - rm "${ED}"/usr/$(get_libdir)/libpython*.a || die
607 -
608 - sed \
609 - -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
610 - -e "s/\(PY_LDFLAGS=\).*/\1/" \
611 - -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed"
612 -
613 - # Fix collisions between different slots of Python.
614 - rm "${ED}/usr/$(get_libdir)/libpython3.so" || die
615 -
616 - # Cheap hack to get version with ABIFLAGS
617 - local abiver=$(cd "${ED}/usr/include"; echo python*)
618 - if [[ ${abiver} != python${PYVER} ]]; then
619 - # Replace python3.X with a symlink to python3.Xm
620 - rm "${ED}/usr/bin/python${PYVER}" || die
621 - dosym "${abiver}" "/usr/bin/python${PYVER}"
622 - # Create python3.X-config symlink
623 - dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
624 - # Create python-3.5m.pc symlink
625 - dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
626 - fi
627 -
628 - # python seems to get rebuilt in src_install (bug 569908)
629 - # Work around it for now.
630 - if has_version dev-libs/libffi[pax_kernel]; then
631 - pax-mark E "${ED}/usr/bin/${abiver}"
632 - else
633 - pax-mark m "${ED}/usr/bin/${abiver}"
634 - fi
635 -
636 - use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
637 - use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
638 -
639 - use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die
640 -
641 - dodoc Misc/{ACKS,HISTORY,NEWS}
642 -
643 - if use examples; then
644 - docinto examples
645 - find Tools -name __pycache__ -exec rm -fr {} + || die
646 - dodoc -r Tools
647 - fi
648 - insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
649 - local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
650 - emake --no-print-directory -s -f - 2>/dev/null)
651 - newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
652 -
653 - newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
654 - newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
655 - sed \
656 - -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
657 - -e "s:@PYDOC@:pydoc${PYVER}:" \
658 - -i "${ED}/etc/conf.d/pydoc-${PYVER}" \
659 - "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed"
660 -
661 - local -x EPYTHON=python${PYVER}
662 - # if not using a cross-compiler, use the fresh binary
663 - if ! tc-is-cross-compiler; then
664 - local -x PYTHON=./python
665 - local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
666 - else
667 - local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
668 - fi
669 -
670 - echo "EPYTHON='${EPYTHON}'" > epython.py || die
671 - python_domodule epython.py
672 -
673 - # python-exec wrapping support
674 - local pymajor=${PYVER%.*}
675 - local scriptdir=${D}$(python_get_scriptdir)
676 - mkdir -p "${scriptdir}" || die
677 - # python and pythonX
678 - ln -s "../../../bin/${abiver}" \
679 - "${scriptdir}/python${pymajor}" || die
680 - ln -s "python${pymajor}" "${scriptdir}/python" || die
681 - # python-config and pythonX-config
682 - # note: we need to create a wrapper rather than symlinking it due
683 - # to some random dirname(argv[0]) magic performed by python-config
684 - cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die
685 - #!/bin/sh
686 - exec "${abiver}-config" "\${@}"
687 - EOF
688 - chmod +x "${scriptdir}/python${pymajor}-config" || die
689 - ln -s "python${pymajor}-config" \
690 - "${scriptdir}/python-config" || die
691 - # 2to3, pydoc
692 - ln -s "../../../bin/2to3-${PYVER}" \
693 - "${scriptdir}/2to3" || die
694 - ln -s "../../../bin/pydoc${PYVER}" \
695 - "${scriptdir}/pydoc" || die
696 - # idle
697 - if use tk; then
698 - ln -s "../../../bin/idle${PYVER}" \
699 - "${scriptdir}/idle" || die
700 - fi
701 -}
702 -
703 -pkg_preinst() {
704 - if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then
705 - python_updater_warning="1"
706 - fi
707 -}
708 -
709 -eselect_python_update() {
710 - if [[ -z "$(eselect python show)" || \
711 - ! -f "${EROOT}/usr/bin/$(eselect python show)" ]]; then
712 - eselect python update
713 - fi
714 -
715 - if [[ -z "$(eselect python show --python${PV%%.*})" || \
716 - ! -f "${EROOT}/usr/bin/$(eselect python show --python${PV%%.*})" ]]
717 - then
718 - eselect python update --python${PV%%.*}
719 - fi
720 -}
721 -
722 -pkg_postinst() {
723 - eselect_python_update
724 -
725 - if [[ "${python_updater_warning}" == "1" ]]; then
726 - ewarn "You have just upgraded from an older version of Python."
727 - ewarn
728 - ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules."
729 - fi
730 -}
731 -
732 -pkg_postrm() {
733 - eselect_python_update
734 -}