summaryrefslogtreecommitdiff
path: root/dev-lang/python
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-09-03 20:56:28 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-09-03 20:56:28 +0100
commitfbda87924e6faa7a1919f1a2b4182490bde5ec5c (patch)
treef3114a4ed212a754756adce027aeef3a4a1a2e2a /dev-lang/python
parent3b08f674e3f771b49370edb144dab0958c8cf721 (diff)
gentoo resync : 03.09.2021
Diffstat (limited to 'dev-lang/python')
-rw-r--r--dev-lang/python/Manifest16
-rw-r--r--dev-lang/python/python-2.7.18_p13.ebuild353
-rw-r--r--dev-lang/python/python-3.10.0_rc1_p2.ebuild4
-rw-r--r--dev-lang/python/python-3.6.14_p1.ebuild11
-rw-r--r--dev-lang/python/python-3.7.11_p1.ebuild6
-rw-r--r--dev-lang/python/python-3.8.12.ebuild6
-rw-r--r--dev-lang/python/python-3.9.6_p2.ebuild6
-rw-r--r--dev-lang/python/python-3.9.7.ebuild344
8 files changed, 724 insertions, 22 deletions
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index 27c953461fc7..bfceed111bfb 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -14,7 +14,10 @@ DIST Python-3.8.12.tar.xz 18443568 BLAKE2B 73413aee7a31347ac4342718a54d23d403622
DIST Python-3.8.12.tar.xz.asc 833 BLAKE2B 33f59aa667555832ee510d2a7295079f34a3983dfa84beab20b33ec691ea3eecfcc4a62591fe233fc30622d0236ee69a3d41b8922ee2f4c632df3523d565c3ec SHA512 ef552b716a721f410abb14387594c8b0ddc65ce4b8a6ae6bf920c1db2ea9ddf6bbf547e93d3716495ae31848eb1049aae4257016e888393681bbfb6f6529bc12
DIST Python-3.9.6.tar.xz 19051972 BLAKE2B 0d8586b2935088eeab7138cf2210c1a74f1bf7359359d25750af5f69de55eb39c92f518b887a8b749c772ed7d33e85b912928ae6d878514eb58d85ef210f54f0 SHA512 01c529e3207738d8771caeb5ed6217e10745c21aa39832fe3185e1c87fdb6aedead97ce38dbb11e02d873654028bd8071c3f345c18452769520723284efe9dc1
DIST Python-3.9.6.tar.xz.asc 833 BLAKE2B 41901bfb80a901f2f14e86769e6d08ded8f75656d347201345183162e180e61442da871a1067572a54da579551166a19bf5436e51581bb10cb78afc4d28773fc SHA512 0673c8833f302c829bfde97453c52744f6aa99b4a72520f4cc384d4aa9d6ffd28a1407ceafb0a1ec4462b3aa74b656bf39c67872c4e6a131429ea58c47ad0ecc
+DIST Python-3.9.7.tar.xz 19123232 BLAKE2B 69dfba6974c8c74de1b71977d28cad4d7c26615695f48a99444d2eb83d657b4bd8d22e7f6e94b1b2dcbcc5605c0aee08c609b9564e306f48588e2a7f471209b2 SHA512 55139776ab58a40f9e1e70613d7071d559ef9e51e32a77791422aac134322c21a49f0348c42813214b69789c589367eae43e16d4ae838a73daf37617e966b735
+DIST Python-3.9.7.tar.xz.asc 833 BLAKE2B 2d9c47e47d9a625e393a8b456dd5b10dd485fc13ca7c236b5fd304c373879bea8ab3c67ff99c3a81350443f6ccba20718466a221a05faada6b82cfe92943fdbf SHA512 7ff9f845f520efab3b4a0e95da3ffe055ee5777a4173a5b2cc1fd2419dc2b4faf30d1e711e372df36e34bc971ecfcde88a7cd815cfe2d8080ccb575a1ae8e101
DIST python-gentoo-patches-2.7.18_p11.tar.xz 31340 BLAKE2B bdc097b971ab8ec0b60f944002af34f3fff6b681c43515a4fec2fcac1a2c731bf4fcfae2178463103911e2f8cd6bc84d3b56cd0ad61da5c8276278ec9b85a242 SHA512 2a2388c4543267bfb0167f963a22f5141442c9347d9a8806ad6917843e6958d47c8f1933244651c870101b21408c920408fe056efb7a148117c24ab391151d88
+DIST python-gentoo-patches-2.7.18_p13.tar.xz 33296 BLAKE2B 91b711458aff4f6337ee1b34aff58d7edda6725644a64c9320076a1e04c816729ed163d82333cfe4dfef379a9ad5ef50ba00abdbbfed4503b0f92c8f0b7ca683 SHA512 97f3657a4a95e8492aa710801b974a56e6dd4636e475aea45cbbe76e7ae32d00f07b05769887f05e49cb0df8584ac9499a7ce842bad77f837a7c869f9b769b07
DIST python-gentoo-patches-3.10.0rc1_p1.tar.xz 8496 BLAKE2B b3b771a8894e5bfeabb3bee10cf60c068dca28341784f0914bb2190f67f10007c2e4e3b18dc31ac7dd791e06314cd3f8cda6776261c6e83da380c492bbc53e89 SHA512 bb22cc121d3b915b98de32244926188dd9717054f32437822a59652be001ac3b6309cb1aba79ce158a486d33e761a31861aed56b5a7976bc83aee18174903248
DIST python-gentoo-patches-3.10.0rc1_p2.tar.xz 10548 BLAKE2B b0a78e3b5e45ead483391c4382c3d6046b4a03e43c1ab5fcd1569f05afc271dde6278078cec852756364663111c38f0ecedca99ef2f2bb233714406505ed8e79 SHA512 1e0129903a3756b6ab087b982269197b64028432f81592b887d8431f429f864918eaa611c7b671e303de7603fd835fb4563219fedd3ee1dbd42e843e66d4fccd
DIST python-gentoo-patches-3.6.14.tar.xz 14744 BLAKE2B b9482f9d2b7ada60eff9a5672ed21556c00b473a7cfdb543dce8253fb0ff1539e635a35569478c496012ecde4eef78a257da28f7a80bff99da10249708262229 SHA512 246f83911c8e52ea83a9bf453faa0bc0ea0c29bbf3b666a938e3790c6147f71e617ff9cb27501c5f0b89172eb9e7819e3f2ef0a5bae271cc938d2c0c2b93f7ae
@@ -25,15 +28,18 @@ DIST python-gentoo-patches-3.8.11.tar.xz 16932 BLAKE2B aaa1df33997f4077916fb7cca
DIST python-gentoo-patches-3.8.12.tar.xz 14936 BLAKE2B 1cb6cdb0bb659b1bc3f8a4ecd80da74b41a9fa2f4d5646ac4b48ddecd5124677cb24574a425404fedab4fb9c7faba4b1cb54cc3482785559a54fa3e9b3ca13f1 SHA512 86c30622bbf6847efcdf2bc43d916b05ee78ab17f45b93148a01cf4c181592029ecc52e8c4887112d97aeece63a92ee0f685a689287c133443cf51b3f8171fb9
DIST python-gentoo-patches-3.9.6_p1.tar.xz 12764 BLAKE2B 927718f1aadb5d5ef67e647a639a10bffdd48474bf01e50bd37ef1242bce57606b7b54c4823c1da3585ee76e737028163e38e9b4e19037585cc53f925e1c5fa7 SHA512 f06fb55786bd942e72e3225ee9ce218724aeee29f301279743588749007e991851a8f29db5b5dfd85435e3d763c00942947909a6fc60581bd0f3e8a6e913bff8
DIST python-gentoo-patches-3.9.6_p2.tar.xz 14720 BLAKE2B e14634229b65a29f5294694949c138bfa6146810349d1207a07d84eeca529571eb9c760b58ddbe6e8d96d50d1a3e0d1dfe42328c53c977a9eeb22ecd553317dc SHA512 5d84b8bb4e5584e3ef8e6298af000e772240ad93ed0aaadf1d785db947f1e79aecae7313b8dbeb65849212c9930e683be6e18e42ef6c41a3c27d60f75df08a01
+DIST python-gentoo-patches-3.9.7.tar.xz 12764 BLAKE2B 0cdd255ee1b90f117a7b11cf3ce96d48fe6e8b7b0d43958c473c23489fa4b512f7d8c385fc7c67ba0e62946fd22a608c3f088a3220934136c056bdd14e802752 SHA512 64ba96a5b07ff986b07c2694cd917d5542513cdf2d8ec96940bc2a730a479538968789121e6608feb1bae5465eafbae176726d79f2ddf025a0b7f59b67404b07
EBUILD python-2.7.18_p11.ebuild 10256 BLAKE2B c52519a9e5c941e6111a52043f10870773c00c78be3e8234ebe750d27e5b472e9623fd2707475277aaef90ddb3498e188a5c875bab3523113ed4a9f8086b4408 SHA512 5c3dbd96e9a27a4f5b57540ab0414c39ada0cac6e17575eddf3b15ea4145fb5cfba9f9a47b2880f0ee2fed2016c467fb8dbdda38b674871fe9a21edb77eeebb2
+EBUILD python-2.7.18_p13.ebuild 10091 BLAKE2B 06b604c51eec4cca588f5efdafcbbc7c04cad4d4c23687ef32d6c329ae8b618a600b1225b6ddf8e77a994d9aad1fbd53f0de6c9653566d0f3714535b616a995f SHA512 626bba20dd4caa17ed25494eb2546e58792963982db626c3bfeb5cf2fd6e049f69e81112d7c78663829c094c324439c34f67325a8cd2654e13ec51f789421083
EBUILD python-3.10.0_rc1_p1.ebuild 10023 BLAKE2B cba56d652815335faec57c8391af8aac7e8817c96994703ae5f82122ffb7c0e5817a57694ceba2e5990ca9e3bf86247d77e560e9e44982b2ac67dee8842c2253 SHA512 a627786f84e10b03b582f1f360f8b55b58594254eb44a4a86432f18a67d2d96f14f873b9b069a49073b283eb6d123ebd3bf3c2bd4ac4ff2debc13564e7645672
-EBUILD python-3.10.0_rc1_p2.ebuild 10023 BLAKE2B cba56d652815335faec57c8391af8aac7e8817c96994703ae5f82122ffb7c0e5817a57694ceba2e5990ca9e3bf86247d77e560e9e44982b2ac67dee8842c2253 SHA512 a627786f84e10b03b582f1f360f8b55b58594254eb44a4a86432f18a67d2d96f14f873b9b069a49073b283eb6d123ebd3bf3c2bd4ac4ff2debc13564e7645672
+EBUILD python-3.10.0_rc1_p2.ebuild 10013 BLAKE2B 0fc5812116ad7d044e61ca6103b75cbf42c309799c70d59f4fff7d496893d3e1ed6f0a4381772e41ccb945a09948cf90ffaf61003da3b15853a55436cdc2865d SHA512 7048e4eabec33c57dc17c4867ef0b867df71cc00ce038252ad67cf88b83ef94250313463a2e6941b427600947b8e49a2a2f11b46c8fbb448fbb854ce4be83e1a
EBUILD python-3.6.14.ebuild 9798 BLAKE2B 52980170cf4415b48d2d13ed630076d79c21a65d950fd883c07660f5014514ad8da96e9d05029fabb165d6e88a8618601d62f961c68a5037d4a0a26c441bd4cb SHA512 44f4ed1f07cc9332ea9699de4789a33d82ec7c2a0c474dbccdd215695fa02f4facb095ee57d151a734031a35380ff79b33042448f98d8a4f8505aab6aa3caf3b
-EBUILD python-3.6.14_p1.ebuild 9806 BLAKE2B 738055cccd3af0c933ae706bd1e9901e215779049701849a73937b653dbdc11da10abde298a32e8bee0f1a303a43fee2c25c9a5afaacee8d6902076accc3422d SHA512 18fe692c437a86a09361e005bc80d7fdd0057ae21fe0fb81296f3bfe5a06ee52d2dfa673e55d0b7b9f5e613501434d97752793743c28c13f075f55aaf94dbd81
+EBUILD python-3.6.14_p1.ebuild 9707 BLAKE2B 3baf8953c0b74cd03cff20614a967f89b4904c2b572608cfbc2df4cebe84cdf55421ccffbded219abb6b6451ca6f57c1ce226eeec6c89e996c88e3829b319208 SHA512 3e3093ca059bf348e2e86ecc9488b4533c74da3628d88171ed265f31b8e7fa11158c298ca77ff823493fa82f0462415dca0f1fc1e4d25f81521d60a51ac17bfa
EBUILD python-3.7.11.ebuild 9611 BLAKE2B ebfa5095f7ef7f5550f5f2c148a9c910f280c634f1096c7b63bc3ffed02d6118abfaf74342f2d2e39449de7982eff911b46c542327090d39e8f97a69cb6edf94 SHA512 f432e100d47346e434acdc3eadbec80fe9e25211bf59dc7c50c8a15b7cce3dac6f41bd3529246e3ca1035f66a2815a9ac8893a2dc3f0535f592f84a25c3fbb3e
-EBUILD python-3.7.11_p1.ebuild 9619 BLAKE2B 1d75c012a0895d75cf6bd5a8c9a9cab31400b165c9e3231016dfbbefb7d3064cc1a185a0c76a78a9ab95f11db7d4b71e84d5f9b4c5291d948f3c58f713ce36eb SHA512 0e98d9de53a2d8f91ad6e9c7974d7251d20b79f42e50113ef49062b646f9a07b5b51b03052b151604b89741bfcca3a783c0c51b1a46681aa60acc791e95eff04
+EBUILD python-3.7.11_p1.ebuild 9606 BLAKE2B a0fc400930571f088c41ee4b40103324e37df8829bec30557de6edce7117737f243c79a66b3df80194cb19f15fdb7127772a4cf27f22275354fe3f79f20836b5 SHA512 ad03d8271f86a289885a69e3a2e269c8a6dc775d8c0c6c5d9ae3ad4f88109a35e2d2404a81a06a681583544178bcb48c9b07997af6c78d1b139b54c9994f9ea7
EBUILD python-3.8.11.ebuild 9765 BLAKE2B 95aa5d7f2fb61c4663b9f48746c866cddd28552d78ebbc111ff6f476748c48bcb77a8f1a15775a68c791c805cf239c61c12b97a48bad84cd3c943c2c0b009e63 SHA512 3871776a49c1fb058465903962b4ed1475b513f80e92bd91ab5ac61e591a0e6235b0ff78325e66ea09e5231fd1df37ece847b7605a1fd2edd7e7de0383f37bc9
-EBUILD python-3.8.12.ebuild 9773 BLAKE2B ffd306270f98fe613da3cbfe23a75a4937b1f818fcb6ddaa08d9bae363505a509d8d1aa8fd426adf440a9ce688eb3c6fc31b62b6c45f33be3e369f57735660b0 SHA512 e2d11ac55776703acbb67dd951d686d89b6121db1db7587a6da5e075dd2850845c66e8bbeaaa5d3f609e0a9dab6aa15365d564853ebb96991023b106077da8be
+EBUILD python-3.8.12.ebuild 9760 BLAKE2B 7bce6bd971377831b008dddd3aad01c9c833595fcb541778ac7af7ff52af0ad17f1a774884f89f404032653bd4b2aefc3646cbddd32c6dd102e2fe19494a7c68 SHA512 521df131c95dcb5a8821e09e418474f928d92497f12830b2f6281ff2ca39e27e5920732b92b702fd134d31a65030cb5cc579380f00ffad4fa057ab1fb1c82d19
EBUILD python-3.9.6_p1.ebuild 9904 BLAKE2B c454574bff806cbee78dcb7442e7742792aba87fb735baf7e9d6a72baa3aa698c78e63278649e083fe1f1b86cabb98a33f722b75344e038505f9f8660d2d50b5 SHA512 f84c7b5c35734b80daced5bf6e103e485271ab257c6d43008019ff68dcbdfe7c8b1898b4c5b6d3d67c5143ba5eab42d5b3c6c45f894d1325b650822f2d65d10e
-EBUILD python-3.9.6_p2.ebuild 9912 BLAKE2B eca50c46134708b9a26995194df39fa36066373246341d5a5bfe57cebbf14688e616bf58cb58c379707f98393b9b8f186c10fd29909e94674250a43853e34724 SHA512 6ff575770724852a52fce73d2dec068ef9b6c4f98f1cf30b6113b4a8e075744052756f920f9ea9718f2808941c85b6b887771535d5731dfb4ec5357801f19872
+EBUILD python-3.9.6_p2.ebuild 9901 BLAKE2B 10ff11ce2d240743f7aa184abdc5a1447f82ed17c275b137bf5648b598247247a7e82f41119689eadc98dae689d563ec34028bd29187595d3839ecc2c662e9b6 SHA512 0b89a013400f1e3760cbb17f377749d3884475fc4320e5fef805aba62410a9a339174fc7f38d1a28793c2b7b3e68a1985a3ad5b1e79faab09f8a7c32e041a85e
+EBUILD python-3.9.7.ebuild 9902 BLAKE2B 4bcf17e812cc2dcfdaf4ff2b7f2be3a23905247630f456bcb0e4db2966683b5e0dbe640ff822395b3c0f7c5f79c9dac68b2141f2bbdd745ec52a017111f40c23 SHA512 342f3d6566dec3dc698fff54df77dc46144b8b80c96efece51ca9f0c460c46b167939182f297a20ebf15423a9cd7dd6f51be62e1a6e75036e962352c94dc1fae
MISC metadata.xml 819 BLAKE2B 120c7c65d77488e726c5a0f4aa19469867ea6900e747169fae2f9cf8f14ec2936089d5edfe1935ce610bec26387273e261b1cc4b023680c8c4b229f2141a7223 SHA512 08f45707e5490067a21951b9d37c8ae67064ab67cccc5b8d8c204eab8d4a004fb910627b62989c67b849b89d301618f8f8f7996e99e1ef5bab38a239c49c124d
diff --git a/dev-lang/python/python-2.7.18_p13.ebuild b/dev-lang/python/python-2.7.18_p13.ebuild
new file mode 100644
index 000000000000..9446e911e5b5
--- /dev/null
+++ b/dev-lang/python/python-2.7.18_p13.ebuild
@@ -0,0 +1,353 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+WANT_LIBTOOL="none"
+
+inherit autotools flag-o-matic pax-utils \
+ python-utils-r1 toolchain-funcs verify-sig
+
+MY_P="Python-${PV%_p*}"
+PYVER=$(ver_cut 1-2)
+PATCHSET="python-gentoo-patches-${PV}"
+
+DESCRIPTION="An interpreted, interactive, object-oriented programming language"
+HOMEPAGE="https://www.python.org/"
+SRC_URI="https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz
+ https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz
+ verify-sig? (
+ https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz.asc
+ )"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="PSF-2"
+SLOT="${PYVER}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 sparc ~x86"
+IUSE="berkdb bluetooth build elibc_uclibc examples gdbm hardened +ncurses +readline +sqlite +ssl tk wininst +xml"
+
+# Do not add a dependency on dev-lang/python to this ebuild.
+# If you need to apply a patch which requires python for bootstrapping, please
+# run the bootstrap code on your dev box and include the results in the
+# patchset. See bug 447752.
+
+RDEPEND="app-arch/bzip2:=
+ dev-libs/libffi:=
+ >=sys-libs/zlib-1.1.3:=
+ virtual/libcrypt:=
+ virtual/libintl
+ berkdb? ( || (
+ sys-libs/db:5.3
+ sys-libs/db:5.1
+ sys-libs/db:4.8
+ sys-libs/db:4.7
+ sys-libs/db:4.6
+ sys-libs/db:4.5
+ sys-libs/db:4.4
+ sys-libs/db:4.3
+ sys-libs/db:4.2
+ ) )
+ gdbm? ( sys-libs/gdbm:=[berkdb] )
+ ncurses? ( >=sys-libs/ncurses-5.2:= )
+ readline? ( >=sys-libs/readline-4.1:= )
+ sqlite? ( >=dev-db/sqlite-3.3.8:3= )
+ ssl? ( dev-libs/openssl:= )
+ tk? (
+ >=dev-lang/tcl-8.0:=
+ >=dev-lang/tk-8.0:=
+ dev-tcltk/blt:=
+ dev-tcltk/tix
+ )
+ xml? ( >=dev-libs/expat-2.1:= )"
+# bluetooth requires headers from bluez
+DEPEND="${RDEPEND}
+ bluetooth? ( net-wireless/bluez )"
+BDEPEND="
+ virtual/pkgconfig
+ verify-sig? ( app-crypt/openpgp-keys-python )
+ !sys-devel/gcc[libffi(-)]"
+RDEPEND+="
+ !build? ( app-misc/mime-types )
+ !<=dev-lang/python-exec-2.4.6-r1"
+
+VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc
+
+pkg_setup() {
+ if use berkdb; then
+ ewarn "'bsddb' module is out-of-date and no longer maintained inside"
+ ewarn "dev-lang/python. 'bsddb' and 'dbhash' modules have been additionally"
+ ewarn "removed in Python 3. A maintained alternative of 'bsddb3' module"
+ ewarn "is provided by dev-python/bsddb3."
+ else
+ if has_version "=${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"; then
+ ewarn "You are migrating from =${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"
+ ewarn "to =${CATEGORY}/${PN}-${PV%%.*}*[-berkdb]."
+ ewarn "You might need to migrate your databases."
+ fi
+ fi
+}
+
+src_unpack() {
+ if use verify-sig; then
+ verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc}
+ fi
+ default
+}
+
+src_prepare() {
+ # Ensure that internal copies of expat, libffi and zlib are not used.
+ rm -fr Modules/expat || die
+ rm -fr Modules/_ctypes/libffi* || die
+ rm -fr Modules/zlib || die
+
+ local PATCHES=(
+ "${WORKDIR}/${PATCHSET}"
+ )
+
+ default
+
+ sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
+ Lib/distutils/command/install.py \
+ Lib/distutils/sysconfig.py \
+ Lib/site.py \
+ Lib/sysconfig.py \
+ Lib/test/test_site.py \
+ Makefile.pre.in \
+ Modules/Setup.dist \
+ Modules/getpath.c \
+ setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
+
+ eautoreconf
+}
+
+src_configure() {
+ # dbm module can be linked against berkdb or gdbm.
+ # Defaults to gdbm when both are enabled, #204343.
+ local disable
+ use berkdb || use gdbm || disable+=" dbm"
+ use berkdb || disable+=" _bsddb"
+ # disable automagic bluetooth headers detection
+ use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
+ use gdbm || disable+=" gdbm"
+ use ncurses || disable+=" _curses _curses_panel"
+ use readline || disable+=" readline"
+ use sqlite || disable+=" _sqlite3"
+ use ssl || export PYTHON_DISABLE_SSL="1"
+ use tk || disable+=" _tkinter"
+ use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
+ export PYTHON_DISABLE_MODULES="${disable}"
+
+ if ! use xml; then
+ ewarn "You have configured Python without XML support."
+ ewarn "This is NOT a recommended configuration as you"
+ ewarn "may face problems parsing any XML documents."
+ fi
+
+ if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
+ einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
+ fi
+
+ if [[ "$(gcc-major-version)" -ge 4 ]]; then
+ append-flags -fwrapv
+ fi
+
+ filter-flags -malign-double
+
+ # https://bugs.gentoo.org/show_bug.cgi?id=50309
+ if is-flagq -O3; then
+ is-flagq -fstack-protector-all && replace-flags -O3 -O2
+ use hardened && replace-flags -O3 -O2
+ fi
+
+ if tc-is-cross-compiler; then
+ # Force some tests that try to poke fs paths.
+ export ac_cv_file__dev_ptc=no
+ export ac_cv_file__dev_ptmx=yes
+ fi
+
+ # Export CXX so it ends up in /usr/lib/python2.X/config/Makefile.
+ tc-export CXX
+ # The configure script fails to use pkg-config correctly.
+ # http://bugs.python.org/issue15506
+ export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG)
+
+ local dbmliborder
+ if use gdbm; then
+ dbmliborder+="${dbmliborder:+:}gdbm"
+ fi
+ if use berkdb; then
+ dbmliborder+="${dbmliborder:+:}bdb"
+ fi
+
+ local myeconfargs=(
+ # The check is broken on clang, and gives false positive:
+ # https://bugs.gentoo.org/596798
+ # (upstream dropped this flag in 3.2a4 anyway)
+ ac_cv_opt_olimit_ok=no
+ # glibc-2.30 removes it; since we can't cleanly force-rebuild
+ # Python on glibc upgrade, remove it proactively to give
+ # a chance for users rebuilding python before glibc
+ ac_cv_header_stropts_h=no
+
+ --with-fpectl
+ --enable-shared
+ --enable-ipv6
+ --with-threads
+ --enable-unicode=ucs4
+ --infodir='${prefix}/share/info'
+ --mandir='${prefix}/share/man'
+ --with-computed-gotos
+ --with-dbmliborder="${dbmliborder}"
+ --with-libc=
+ --enable-loadable-sqlite-extensions
+ --with-system-expat
+ --with-system-ffi
+ --without-ensurepip
+ )
+
+ OPT="" econf "${myeconfargs[@]}"
+
+ if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
+ eerror "configure has detected that the sem_open function is broken."
+ eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
+ die "Broken sem_open function (bug 496328)"
+ fi
+}
+
+src_compile() {
+ # Ensure sed works as expected
+ # https://bugs.gentoo.org/594768
+ local -x LC_ALL=C
+
+ # Avoid invoking pgen for cross-compiles.
+ touch Include/graminit.h Python/graminit.c
+
+ emake
+
+ # Work around bug 329499. See also bug 413751 and 457194.
+ if has_version dev-libs/libffi[pax-kernel]; then
+ pax-mark E python
+ else
+ pax-mark m python
+ fi
+}
+
+src_test() {
+ # Tests will not work when cross compiling.
+ if tc-is-cross-compiler; then
+ elog "Disabling tests due to crosscompiling."
+ return
+ fi
+
+ # Skip failing tests.
+ local skipped_tests="distutils gdb"
+
+ for test in ${skipped_tests}; do
+ mv "${S}"/Lib/test/test_${test}.py "${T}"
+ done
+
+ # bug 660358
+ local -x COLUMNS=80
+
+ # Daylight saving time problem
+ # https://bugs.python.org/issue22067
+ # https://bugs.gentoo.org/610628
+ local -x TZ=UTC
+
+ # Rerun failed tests in verbose mode (regrtest -w).
+ emake test EXTRATESTOPTS="-w" < /dev/tty
+ local result="$?"
+
+ for test in ${skipped_tests}; do
+ mv "${T}/test_${test}.py" "${S}"/Lib/test
+ done
+
+ elog "The following tests have been skipped:"
+ for test in ${skipped_tests}; do
+ elog "test_${test}.py"
+ done
+
+ elog "If you would like to run them, you may:"
+ elog "cd '${EPREFIX}/usr/$(get_libdir)/python${PYVER}/test'"
+ elog "and run the tests separately."
+
+ if [[ ${result} -ne 0 ]]; then
+ die "emake test failed"
+ fi
+}
+
+src_install() {
+ local libdir=${ED}/usr/$(get_libdir)/python${PYVER}
+
+ emake DESTDIR="${D}" altinstall
+
+ sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die
+
+ # Fix collisions between different slots of Python.
+ mv "${ED}/usr/bin/2to3" "${ED}/usr/bin/2to3-${PYVER}" || die
+ mv "${ED}/usr/bin/pydoc" "${ED}/usr/bin/pydoc${PYVER}" || die
+ mv "${ED}/usr/bin/idle" "${ED}/usr/bin/idle${PYVER}" || die
+ rm "${ED}/usr/bin/smtpd.py" || die
+
+ use berkdb || rm -r "${libdir}/"{bsddb,dbhash.py*,test/test_bsddb*} || die
+ use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
+ use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,lib-tk} || die
+ use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test}
+
+ use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die
+
+ dodoc Misc/{ACKS,HISTORY,NEWS}
+
+ if use examples; then
+ docinto examples
+ dodoc -r Tools
+ fi
+ insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
+ local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
+ emake --no-print-directory -s -f - 2>/dev/null)
+ newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
+
+ newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
+ newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
+ sed \
+ -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
+ -e "s:@PYDOC@:pydoc${PYVER}:" \
+ -i "${ED}/etc/conf.d/pydoc-${PYVER}" \
+ "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed"
+
+ local -x EPYTHON=python${PYVER}
+ # if not using a cross-compiler, use the fresh binary
+ if ! tc-is-cross-compiler; then
+ local -x PYTHON=./python
+ local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
+ else
+ local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
+ fi
+
+ echo "EPYTHON='${EPYTHON}'" > epython.py || die
+ python_domodule epython.py
+
+ # python-exec wrapping support
+ local scriptdir=${D}$(python_get_scriptdir)
+ mkdir -p "${scriptdir}" || die
+ # python
+ ln -s "../../../bin/python${PYVER}" \
+ "${scriptdir}/python" || die
+ # python-config
+ ln -s "../../../bin/python${PYVER}-config" \
+ "${scriptdir}/python-config" || die
+ # 2to3, pydoc, pyvenv
+ ln -s "../../../bin/2to3-${PYVER}" \
+ "${scriptdir}/2to3" || die
+ ln -s "../../../bin/pydoc${PYVER}" \
+ "${scriptdir}/pydoc" || die
+ # idle
+ if use tk; then
+ ln -s "../../../bin/idle${PYVER}" \
+ "${scriptdir}/idle" || die
+ fi
+
+ # python2* is no longer wrapped, so just symlink it
+ local pymajor=${PYVER%.*}
+ dosym "python${PYVER}" "/usr/bin/python${pymajor}"
+ dosym "python${PYVER}-config" "/usr/bin/python${pymajor}-config"
+}
diff --git a/dev-lang/python/python-3.10.0_rc1_p2.ebuild b/dev-lang/python/python-3.10.0_rc1_p2.ebuild
index 7c0200703675..871bbbb0eba6 100644
--- a/dev-lang/python/python-3.10.0_rc1_p2.ebuild
+++ b/dev-lang/python/python-3.10.0_rc1_p2.ebuild
@@ -24,7 +24,7 @@ S="${WORKDIR}/${MY_P}"
LICENSE="PSF-2"
SLOT="${PYVER}"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
-IUSE="bluetooth build examples gdbm hardened ipv6 +ncurses +readline +sqlite +ssl test tk wininst +xml"
+IUSE="bluetooth build examples gdbm hardened +ncurses +readline +sqlite +ssl test tk wininst +xml"
RESTRICT="!test? ( test )"
# Do not add a dependency on dev-lang/python to this ebuild.
@@ -167,7 +167,7 @@ src_configure() {
--enable-shared
--without-static-libpython
- $(use_enable ipv6)
+ --enable-ipv6
--infodir='${prefix}/share/info'
--mandir='${prefix}/share/man'
--with-computed-gotos
diff --git a/dev-lang/python/python-3.6.14_p1.ebuild b/dev-lang/python/python-3.6.14_p1.ebuild
index c375dd63ae3a..03a62d2284c3 100644
--- a/dev-lang/python/python-3.6.14_p1.ebuild
+++ b/dev-lang/python/python-3.6.14_p1.ebuild
@@ -22,8 +22,8 @@ S="${WORKDIR}/${MY_P}"
LICENSE="PSF-2"
SLOT="${PYVER}/${PYVER}m"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
-IUSE="bluetooth build examples gdbm hardened ipv6 +ncurses +readline +sqlite +ssl test +threads tk wininst +xml"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 sparc ~x86"
+IUSE="bluetooth build examples gdbm hardened +ncurses +readline +sqlite +ssl test tk wininst +xml"
RESTRICT="!test? ( test )"
# Do not add a dependency on dev-lang/python to this ebuild.
@@ -151,8 +151,8 @@ src_configure() {
--with-fpectl
--enable-shared
- $(use_enable ipv6)
- $(use_with threads)
+ --enable-ipv6
+ --with-threads
--infodir='${prefix}/share/info'
--mandir='${prefix}/share/man'
--with-computed-gotos
@@ -166,7 +166,7 @@ src_configure() {
OPT="" econf "${myeconfargs[@]}"
- if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
+ if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
eerror "configure has detected that the sem_open function is broken."
eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
die "Broken sem_open function (bug 496328)"
@@ -269,7 +269,6 @@ src_install() {
use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
- use threads || rm -r "${libdir}/multiprocessing" || die
use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die
dodoc Misc/{ACKS,HISTORY,NEWS}
diff --git a/dev-lang/python/python-3.7.11_p1.ebuild b/dev-lang/python/python-3.7.11_p1.ebuild
index c021a50070f4..e7c8d34a2314 100644
--- a/dev-lang/python/python-3.7.11_p1.ebuild
+++ b/dev-lang/python/python-3.7.11_p1.ebuild
@@ -22,8 +22,8 @@ S="${WORKDIR}/${MY_P}"
LICENSE="PSF-2"
SLOT="${PYVER}/${PYVER}m"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
-IUSE="bluetooth build examples gdbm hardened ipv6 +ncurses +readline +sqlite +ssl test tk wininst +xml"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc ~x86"
+IUSE="bluetooth build examples gdbm hardened +ncurses +readline +sqlite +ssl test tk wininst +xml"
RESTRICT="!test? ( test )"
# Do not add a dependency on dev-lang/python to this ebuild.
@@ -145,7 +145,7 @@ src_configure() {
ac_cv_header_stropts_h=no
--enable-shared
- $(use_enable ipv6)
+ --enable-ipv6
--infodir='${prefix}/share/info'
--mandir='${prefix}/share/man'
--with-computed-gotos
diff --git a/dev-lang/python/python-3.8.12.ebuild b/dev-lang/python/python-3.8.12.ebuild
index 427838727282..c03124f0fa59 100644
--- a/dev-lang/python/python-3.8.12.ebuild
+++ b/dev-lang/python/python-3.8.12.ebuild
@@ -23,8 +23,8 @@ S="${WORKDIR}/${MY_P}"
LICENSE="PSF-2"
SLOT="${PYVER}"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
-IUSE="bluetooth build examples gdbm hardened ipv6 +ncurses +readline +sqlite +ssl test tk wininst +xml"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc ~x86"
+IUSE="bluetooth build examples gdbm hardened +ncurses +readline +sqlite +ssl test tk wininst +xml"
RESTRICT="!test? ( test )"
# Do not add a dependency on dev-lang/python to this ebuild.
@@ -153,7 +153,7 @@ src_configure() {
ac_cv_header_stropts_h=no
--enable-shared
- $(use_enable ipv6)
+ --enable-ipv6
--infodir='${prefix}/share/info'
--mandir='${prefix}/share/man'
--with-computed-gotos
diff --git a/dev-lang/python/python-3.9.6_p2.ebuild b/dev-lang/python/python-3.9.6_p2.ebuild
index 682541d34485..8eada9fae62c 100644
--- a/dev-lang/python/python-3.9.6_p2.ebuild
+++ b/dev-lang/python/python-3.9.6_p2.ebuild
@@ -23,8 +23,8 @@ S="${WORKDIR}/${MY_P}"
LICENSE="PSF-2"
SLOT="${PYVER}"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
-IUSE="bluetooth build examples gdbm hardened ipv6 +ncurses +readline +sqlite +ssl test tk wininst +xml"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 sparc ~x86"
+IUSE="bluetooth build examples gdbm hardened +ncurses +readline +sqlite +ssl test tk wininst +xml"
RESTRICT="!test? ( test )"
# Do not add a dependency on dev-lang/python to this ebuild.
@@ -164,7 +164,7 @@ src_configure() {
ac_cv_header_stropts_h=no
--enable-shared
- $(use_enable ipv6)
+ --enable-ipv6
--infodir='${prefix}/share/info'
--mandir='${prefix}/share/man'
--with-computed-gotos
diff --git a/dev-lang/python/python-3.9.7.ebuild b/dev-lang/python/python-3.9.7.ebuild
new file mode 100644
index 000000000000..27fbaaa34a57
--- /dev/null
+++ b/dev-lang/python/python-3.9.7.ebuild
@@ -0,0 +1,344 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+WANT_LIBTOOL="none"
+
+inherit autotools check-reqs flag-o-matic multiprocessing pax-utils \
+ python-utils-r1 toolchain-funcs verify-sig
+
+MY_PV=${PV/_rc/rc}
+MY_P="Python-${MY_PV%_p*}"
+PYVER=$(ver_cut 1-2)
+PATCHSET="python-gentoo-patches-${MY_PV}"
+
+DESCRIPTION="An interpreted, interactive, object-oriented programming language"
+HOMEPAGE="https://www.python.org/"
+SRC_URI="https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz
+ https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz
+ verify-sig? (
+ https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz.asc
+ )"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="PSF-2"
+SLOT="${PYVER}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="bluetooth build examples gdbm hardened +ncurses +readline +sqlite +ssl test tk wininst +xml"
+RESTRICT="!test? ( test )"
+
+# Do not add a dependency on dev-lang/python to this ebuild.
+# If you need to apply a patch which requires python for bootstrapping, please
+# run the bootstrap code on your dev box and include the results in the
+# patchset. See bug 447752.
+
+RDEPEND="app-arch/bzip2:=
+ app-arch/xz-utils:=
+ dev-libs/libffi:=
+ sys-apps/util-linux:=
+ >=sys-libs/zlib-1.1.3:=
+ virtual/libcrypt:=
+ virtual/libintl
+ gdbm? ( sys-libs/gdbm:=[berkdb] )
+ ncurses? ( >=sys-libs/ncurses-5.2:= )
+ readline? ( >=sys-libs/readline-4.1:= )
+ sqlite? ( >=dev-db/sqlite-3.3.8:3= )
+ ssl? ( >=dev-libs/openssl-1.1.1:= )
+ tk? (
+ >=dev-lang/tcl-8.0:=
+ >=dev-lang/tk-8.0:=
+ dev-tcltk/blt:=
+ dev-tcltk/tix
+ )
+ xml? ( >=dev-libs/expat-2.1:= )"
+# bluetooth requires headers from bluez
+DEPEND="${RDEPEND}
+ bluetooth? ( net-wireless/bluez )
+ test? ( app-arch/xz-utils[extra-filters(+)] )"
+BDEPEND="
+ virtual/pkgconfig
+ sys-devel/autoconf-archive
+ verify-sig? ( app-crypt/openpgp-keys-python )
+ !sys-devel/gcc[libffi(-)]"
+RDEPEND+=" !build? ( app-misc/mime-types )"
+
+VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc
+
+# large file tests involve a 2.5G file being copied (duplicated)
+CHECKREQS_DISK_BUILD=5500M
+
+pkg_pretend() {
+ use test && check-reqs_pkg_pretend
+}
+
+pkg_setup() {
+ use test && check-reqs_pkg_setup
+}
+
+src_unpack() {
+ if use verify-sig; then
+ verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc}
+ fi
+ default
+}
+
+src_prepare() {
+ # Ensure that internal copies of expat, libffi and zlib are not used.
+ rm -fr Modules/expat || die
+ rm -fr Modules/_ctypes/libffi* || die
+ rm -fr Modules/zlib || die
+
+ local PATCHES=(
+ "${WORKDIR}/${PATCHSET}"
+ )
+
+ default
+
+ sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
+ setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
+
+ # force correct number of jobs
+ # https://bugs.gentoo.org/737660
+ local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
+ sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die
+ sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die
+
+ eautoreconf
+}
+
+src_configure() {
+ local disable
+ # disable automagic bluetooth headers detection
+ use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
+ use gdbm || disable+=" gdbm"
+ use ncurses || disable+=" _curses _curses_panel"
+ use readline || disable+=" readline"
+ use sqlite || disable+=" _sqlite3"
+ use ssl || export PYTHON_DISABLE_SSL="1"
+ use tk || disable+=" _tkinter"
+ use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
+ export PYTHON_DISABLE_MODULES="${disable}"
+
+ if ! use xml; then
+ ewarn "You have configured Python without XML support."
+ ewarn "This is NOT a recommended configuration as you"
+ ewarn "may face problems parsing any XML documents."
+ fi
+
+ if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
+ einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
+ fi
+
+ if [[ "$(gcc-major-version)" -ge 4 ]]; then
+ append-flags -fwrapv
+ fi
+
+ filter-flags -malign-double
+
+ # https://bugs.gentoo.org/show_bug.cgi?id=50309
+ if is-flagq -O3; then
+ is-flagq -fstack-protector-all && replace-flags -O3 -O2
+ use hardened && replace-flags -O3 -O2
+ fi
+
+ # https://bugs.gentoo.org/700012
+ if is-flagq -flto || is-flagq '-flto=*'; then
+ append-cflags $(test-flags-CC -ffat-lto-objects)
+ fi
+
+ # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
+ tc-export CXX
+
+ # Fix implicit declarations on cross and prefix builds. Bug #674070.
+ use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
+
+ local dbmliborder
+ if use gdbm; then
+ dbmliborder+="${dbmliborder:+:}gdbm"
+ fi
+
+ local myeconfargs=(
+ # glibc-2.30 removes it; since we can't cleanly force-rebuild
+ # Python on glibc upgrade, remove it proactively to give
+ # a chance for users rebuilding python before glibc
+ ac_cv_header_stropts_h=no
+
+ --enable-shared
+ --enable-ipv6
+ --infodir='${prefix}/share/info'
+ --mandir='${prefix}/share/man'
+ --with-computed-gotos
+ --with-dbmliborder="${dbmliborder}"
+ --with-libc=
+ --enable-loadable-sqlite-extensions
+ --without-ensurepip
+ --with-system-expat
+ --with-system-ffi
+ )
+
+ OPT="" econf "${myeconfargs[@]}"
+
+ if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
+ eerror "configure has detected that the sem_open function is broken."
+ eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
+ die "Broken sem_open function (bug 496328)"
+ fi
+}
+
+src_compile() {
+ # Ensure sed works as expected
+ # https://bugs.gentoo.org/594768
+ local -x LC_ALL=C
+
+ emake CPPFLAGS= CFLAGS= LDFLAGS=
+
+ # Work around bug 329499. See also bug 413751 and 457194.
+ if has_version dev-libs/libffi[pax-kernel]; then
+ pax-mark E python
+ else
+ pax-mark m python
+ fi
+}
+
+src_test() {
+ # Tests will not work when cross compiling.
+ if tc-is-cross-compiler; then
+ elog "Disabling tests due to crosscompiling."
+ return
+ fi
+
+ # Skip failing tests.
+ local skipped_tests="gdb"
+
+ for test in ${skipped_tests}; do
+ mv "${S}"/Lib/test/test_${test}.py "${T}"
+ done
+
+ # bug 660358
+ local -x COLUMNS=80
+ local -x PYTHONDONTWRITEBYTECODE=
+
+ local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
+
+ emake test EXTRATESTOPTS="-u-network -j${jobs}" \
+ CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
+ local result=$?
+
+ for test in ${skipped_tests}; do
+ mv "${T}/test_${test}.py" "${S}"/Lib/test
+ done
+
+ elog "The following tests have been skipped:"
+ for test in ${skipped_tests}; do
+ elog "test_${test}.py"
+ done
+
+ elog "If you would like to run them, you may:"
+ elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'"
+ elog "and run the tests separately."
+
+ if [[ ${result} -ne 0 ]]; then
+ die "emake test failed"
+ fi
+}
+
+src_install() {
+ local libdir=${ED}/usr/lib/python${PYVER}
+
+ emake DESTDIR="${D}" altinstall
+
+ # Remove static library
+ rm "${ED}"/usr/$(get_libdir)/libpython*.a || die
+
+ sed \
+ -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
+ -e "s/\(PY_LDFLAGS=\).*/\1/" \
+ -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed"
+
+ # Fix collisions between different slots of Python.
+ rm "${ED}/usr/$(get_libdir)/libpython3.so" || die
+
+ # Cheap hack to get version with ABIFLAGS
+ local abiver=$(cd "${ED}/usr/include"; echo python*)
+ if [[ ${abiver} != python${PYVER} ]]; then
+ # Replace python3.X with a symlink to python3.Xm
+ rm "${ED}/usr/bin/python${PYVER}" || die
+ dosym "${abiver}" "/usr/bin/python${PYVER}"
+ # Create python3.X-config symlink
+ dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
+ # Create python-3.5m.pc symlink
+ dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
+ fi
+
+ # python seems to get rebuilt in src_install (bug 569908)
+ # Work around it for now.
+ if has_version dev-libs/libffi[pax-kernel]; then
+ pax-mark E "${ED}/usr/bin/${abiver}"
+ else
+ pax-mark m "${ED}/usr/bin/${abiver}"
+ fi
+
+ use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
+ use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
+
+ dodoc Misc/{ACKS,HISTORY,NEWS}
+
+ if use examples; then
+ docinto examples
+ find Tools -name __pycache__ -exec rm -fr {} + || die
+ dodoc -r Tools
+ fi
+ insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
+ local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
+ emake --no-print-directory -s -f - 2>/dev/null)
+ newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
+
+ newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
+ newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
+ sed \
+ -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
+ -e "s:@PYDOC@:pydoc${PYVER}:" \
+ -i "${ED}/etc/conf.d/pydoc-${PYVER}" \
+ "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed"
+
+ local -x EPYTHON=python${PYVER}
+ # if not using a cross-compiler, use the fresh binary
+ if ! tc-is-cross-compiler; then
+ local -x PYTHON=./python
+ local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
+ else
+ local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
+ fi
+
+ echo "EPYTHON='${EPYTHON}'" > epython.py || die
+ python_domodule epython.py
+
+ # python-exec wrapping support
+ local pymajor=${PYVER%.*}
+ local scriptdir=${D}$(python_get_scriptdir)
+ mkdir -p "${scriptdir}" || die
+ # python and pythonX
+ ln -s "../../../bin/${abiver}" \
+ "${scriptdir}/python${pymajor}" || die
+ ln -s "python${pymajor}" "${scriptdir}/python" || die
+ # python-config and pythonX-config
+ # note: we need to create a wrapper rather than symlinking it due
+ # to some random dirname(argv[0]) magic performed by python-config
+ cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die
+ #!/bin/sh
+ exec "${abiver}-config" "\${@}"
+ EOF
+ chmod +x "${scriptdir}/python${pymajor}-config" || die
+ ln -s "python${pymajor}-config" \
+ "${scriptdir}/python-config" || die
+ # 2to3, pydoc
+ ln -s "../../../bin/2to3-${PYVER}" \
+ "${scriptdir}/2to3" || die
+ ln -s "../../../bin/pydoc${PYVER}" \
+ "${scriptdir}/pydoc" || die
+ # idle
+ if use tk; then
+ ln -s "../../../bin/idle${PYVER}" \
+ "${scriptdir}/idle" || die
+ fi
+}