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: Tue, 30 Nov 2021 00:11:08
Message-Id: 1638231033.a752898c01ae41aab430663c0df6ad2ade3366cf.mgorny@gentoo
1 commit: a752898c01ae41aab430663c0df6ad2ade3366cf
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Tue Nov 30 00:10:33 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 30 00:10:33 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a752898c
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 | 9 -
13 dev-lang/python/python-3.11.0_alpha1.ebuild | 349 ----------------------------
14 dev-lang/python/python-3.6.14_p1.ebuild | 337 ---------------------------
15 dev-lang/python/python-3.9.7_p1.ebuild | 348 ---------------------------
16 4 files changed, 1043 deletions(-)
17
18 diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
19 index 73cc0ebffde0..0a3258758432 100644
20 --- a/dev-lang/python/Manifest
21 +++ b/dev-lang/python/Manifest
22 @@ -2,32 +2,23 @@ DIST Python-2.7.18.tar.xz 12854736 BLAKE2B 060a621c91dd8e3d321aec99d44c17aa67381
23 DIST Python-2.7.18.tar.xz.asc 833 BLAKE2B 1d98770e46171971fb99994508d238c01d2755281d2f94353314014d9e83e0ec5f0b3e3950ea1fdf5fce9ba6b8f55312355845c2a3fc4291c27ee56fe6215448 SHA512 c2a5f5a52f47dec52460ad3275758d4e5de6e7075c3def4353c988d74d563a39b42cae2d5eb24e2a23a6247cef69100f91620b11a49c2359fbf99b203c9cbda8
24 DIST Python-3.10.0.tar.xz 18726176 BLAKE2B 77143edf733cadf7e52327a58782f0617b1dd0d132cf58e0f26d37a454bb97f82e7931118a6a71f22779d9b6ec4efca974c43c19a6338b4b24a9fd616b60cc89 SHA512 82b2729afc7d72a80882f199970667dce7d971a2e5ecfe6cf84f7b68612ab2caf6ed6d7a8cb81f24ea85cb0816464bb2e8b2e6884eda62fa40742edc674193bd
25 DIST Python-3.10.0.tar.xz.asc 833 BLAKE2B 295df19932ea076bb1a50acb38782055ff34fb235df0380fa361727eedb3ca68aeca2a31419de5b05ce128c2e21ad04605c226e7a61d508a17607f615e46e570 SHA512 67236e02bc49da1423717cb54216b745f613ba2fc4b372a4aa15a36ab15fe69d9b9087070382957d480df7576d13056caedcd979fb56531799a1190b822f673d
26 -DIST Python-3.11.0a1.tar.xz 18678136 BLAKE2B 1a28fdc2bbbb60896240b4a7bc361f060205dae51fa2d0e4f981752d81c14f1a28ebef09960ea82d5158e874d0e335ee45f69d968f7433ce4c0d02978ad39c95 SHA512 3705fa3d05fccd491fba981c9495d5b36793f284a39b267a5ff7b25c7f08de84bbd5afe200296cedd1cc55f495fd3efc55d7b34910e1be1a785ce5772b857d7a
27 -DIST Python-3.11.0a1.tar.xz.asc 833 BLAKE2B f5c6064e8b9de17bc22d60b0ae52a9aa887823a9a52fc8fff1e9d29e05c4c1392841a7c492fe69b426be4ee945f0cbfed7ec0d31604e488458d6c61583a051dd SHA512 b9d1542f215b5633835d21de0311d324c62e53b7afc525c00d26c863740fd01cc8c18a6ecb0a8ce8d38bf543cebdb64f0930f9201a8968dbbedf58fe9ad4c05c
28 DIST Python-3.11.0a2.tar.xz 18714064 BLAKE2B 54680f117b639fdebbe1300df4d4fcc43099d30d146861577eee7ad5d9a7de43b54bec0f058db58d4d7067a8ab31cbe344a276c837dddcd3df9105d2a5aa615f SHA512 9a7c4d2be0cdf5801aaf6ec6337390a2f0e711badf0e0e35bcf0e5c98f652c68cf523afb991e87f4a1d1604eed3d19c56654d55922986ab27234e82675b20391
29 DIST Python-3.11.0a2.tar.xz.asc 833 BLAKE2B f3714b71fc1e167e2d5a9989003159606a5eb5288f6d44c5332d7fe101be79e411f035ad1fcc3acd930f9e02377ed8c45f6b981827405dc501b8b074b5eb3dcf SHA512 617181a854c884c6d3a79368000ca82430bc391573ae3a1b25f69939bce3d2d365e8ca7166d941856a78f3598ab4e7720a144ecb6c3a9de1aff5928799c2988d
30 -DIST Python-3.6.14.tar.xz 17218148 BLAKE2B efe655cb907ffa678ca135f88ba9d867e523969ad82dbc09ffb6d8d383824a4b43c525e156a3c35484a526b4b3ea755109e5ef15d17852d44e3351c307fc5e91 SHA512 15b82b7285db97cb27a6fcd57ce9e258fdf8dbdb2f00e22e4331161b8557c8244342546c4143e84c72730759e0276770396b6ca5bb7cf87310cca8e175423006
31 -DIST Python-3.6.14.tar.xz.asc 833 BLAKE2B 81c79dca5728b21b8c2badcaa1242836f1cf13984bb755463cfe9e4fd96a02ebf31f1a9239759a937c6d6a04c18bfc682a82cb0ab2e5a473de153423a7248c9c SHA512 600bf504f2c0d3ce7d1e8e953b4f27a7a7c996b7b9cd70efb876178fa5424130bff5414d5ac7deb8b45103ed417fd40d830613db39750d35a0c967c8fdfea50d
32 DIST Python-3.6.15.tar.xz 17223796 BLAKE2B c139c6f93ea70ad898d5626dfa964280a14de9676f0d9d55668ad91618b1ba330874cbba8d6526a87e53b585ff34e3bf242613ca3fb17ee60f362a9676306c7d SHA512 f1894d704c91669d94ec83b5631288bf1e0c73ddcf33cea0977575f262eb672caebc8ac00e34e9b99c321c19cc9a71d6081fa957bb8e23cf5bfba50f345145ef
33 DIST Python-3.6.15.tar.xz.asc 833 BLAKE2B c910f2367ed947ff6b33380bf8fee318c65d6e5fb0c4a847fd8f2761bbae81dec07b729b31eca060916264b6a0ccf5c52ca72181b3db79751df7697a426a8939 SHA512 cdc93e5d8fb2b5b48a1560a55bba4680adea10e35c8c38b4c51cfd2f6ba54ab2a5d4e5f71b78b889f98cf8ad9d598e0f4e019d50cc16f7db57f9d292a860fcfd
34 DIST Python-3.7.12.tar.xz 17401916 BLAKE2B f01b5cc54cd0ffe2e8756767c624dda8d2fbf24e90f22a16b5a406dad995ef218613db10f0b3fb2da0ece50ccb02c8a8e007ceb0842ce9e93ee9df7348ef1528 SHA512 e1a5942908c1d1469c0ab129fb4287d4ba6eb2a030e88fd71c043fe187a1bc86c00878dab29147199617a361a0c60d9e720fe3bc58bc7bc4cc8ec4bb50c7ea2a
35 DIST Python-3.7.12.tar.xz.asc 833 BLAKE2B 587fcf019f4b07b811834d7279b9861eb709731a431be9cbe8f5b868ac72b6d9a4de8b24e3fefd6b339813299514a0ac12b5f627acd04c185ff8dea22a044723 SHA512 a47003dd5c784eca4e3c34dc8705d1171043e060f3a97e4dd63ce4aec2bceac56d7e808924d63b2a38f9a020bf799cf29e5055fb444b9b2c3f03976d47122355
36 DIST Python-3.8.12.tar.xz 18443568 BLAKE2B 73413aee7a31347ac4342718a54d23d4036220262c4cd41cd50b06c3b1698d52d11cf7ac2c781b919f2cdb0dcb6397d623c463dcdcd1edca99abbbce239a3c6e SHA512 2f93fe5ff83f470c7b6a1b7f29f499a2a010fabd649e9fe65ad3fbfa21b6e1966e77c9b7ac012d978159bc3fe63fec2d64bc6982fc2ee1714d3fa0e47631f279
37 DIST Python-3.8.12.tar.xz.asc 833 BLAKE2B 33f59aa667555832ee510d2a7295079f34a3983dfa84beab20b33ec691ea3eecfcc4a62591fe233fc30622d0236ee69a3d41b8922ee2f4c632df3523d565c3ec SHA512 ef552b716a721f410abb14387594c8b0ddc65ce4b8a6ae6bf920c1db2ea9ddf6bbf547e93d3716495ae31848eb1049aae4257016e888393681bbfb6f6529bc12
38 -DIST Python-3.9.7.tar.xz 19123232 BLAKE2B 69dfba6974c8c74de1b71977d28cad4d7c26615695f48a99444d2eb83d657b4bd8d22e7f6e94b1b2dcbcc5605c0aee08c609b9564e306f48588e2a7f471209b2 SHA512 55139776ab58a40f9e1e70613d7071d559ef9e51e32a77791422aac134322c21a49f0348c42813214b69789c589367eae43e16d4ae838a73daf37617e966b735
39 -DIST Python-3.9.7.tar.xz.asc 833 BLAKE2B 2d9c47e47d9a625e393a8b456dd5b10dd485fc13ca7c236b5fd304c373879bea8ab3c67ff99c3a81350443f6ccba20718466a221a05faada6b82cfe92943fdbf SHA512 7ff9f845f520efab3b4a0e95da3ffe055ee5777a4173a5b2cc1fd2419dc2b4faf30d1e711e372df36e34bc971ecfcde88a7cd815cfe2d8080ccb575a1ae8e101
40 DIST Python-3.9.8.tar.xz 19149464 BLAKE2B 739eb22bae8b44cf5be9a24ca6ecacb80eaca65684abf1fef18b7adcac9adede2eff60e8a9ac5db2672511d180d6079c39e2ff2901ab454c0876ae8e1bfe96cc SHA512 5d5b46a242525b2e6a7f9c69c63c6d7cd985e1443a7d9b716107e75f14fef7b5c9c2e5e8a90adbbbf5f7a8b90a483d01e18c1732470e6e54b611b5aba9f99fe1
41 DIST Python-3.9.8.tar.xz.asc 833 BLAKE2B ec94293d0d28398b425a0a6cd502f6540b23f6788874160216d0575fe23a4ad8e5636c5d4deae7bc193d00bd18aff12f935a6ea807786a87f041046d6693fd20 SHA512 1329a8e114feb010bb3618472cddd9fdea59fc38e9583002eb457e1c0cf1716bd7c0d51887e91b9eef09c3977879aa4be9909e5997be7dfdcca08ca04794bfaf
42 DIST Python-3.9.9.tar.xz 19144372 BLAKE2B 3a144ca5e4b11b2fd09d05a4a40ddf3f622c077338602c519b21ea827c96e0f14ab97563c0a9d306ae4a5c3f44753573a07474dc084fb364d24b2128bb378ddd SHA512 0ab29fb9a7ecb808bd08d84d28908d5a934e0f021853da0f7a9c94670eb30c8dbbc233d461afdb3995b0de59275ef7e1de43e82d7f848802cbd6e6e50b7b25a6
43 DIST Python-3.9.9.tar.xz.asc 833 BLAKE2B 41d05ee1ec256f0cab4e9d3540877783745f0f30e3f1177d01096b352341a90893c5c9523926bed8176bd304cbb1fd6619be3b4e375103874eac5e5ebc113135 SHA512 84fb739c60216ab9a7a487a0ec4039a7e85c7684ef1f71d8b3bc415ff2ae284f79474103ae05385502bc2510401f8cfb33d84dccf5d0ea9a0dd62528519d935f
44 DIST python-gentoo-patches-2.7.18_p13.tar.xz 33296 BLAKE2B 91b711458aff4f6337ee1b34aff58d7edda6725644a64c9320076a1e04c816729ed163d82333cfe4dfef379a9ad5ef50ba00abdbbfed4503b0f92c8f0b7ca683 SHA512 97f3657a4a95e8492aa710801b974a56e6dd4636e475aea45cbbe76e7ae32d00f07b05769887f05e49cb0df8584ac9499a7ce842bad77f837a7c869f9b769b07
45 DIST python-gentoo-patches-3.10.0_p1.tar.xz 10068 BLAKE2B 1c9817b449831559f0a0b722c02a5f55d94b3dfde98e5882c1403fe24a4addf7074ab39c09b91cff6fd7ace2e4b6e8ed899d9a0b9ffd6612ce315c4c192bd309 SHA512 39aa41dbf17b6dc5255491c75031a3dae6962b44125e426dbfdce365a6533c5dae9856b1fff8016a189124b7cff72d2665ce99da344c2f9dff005ba685e8c2c4
46 -DIST python-gentoo-patches-3.11.0a1.tar.xz 9468 BLAKE2B 9bbc0c41d366752d2481c19070d71c27f88fd605e35e62f6b86498cb537051e92972f3c3f7b234485fd07e2a6ac4e4d6701e03e7893897531da58fbaaa609e76 SHA512 a06274c8c1d772121ac9570125eea12a4e53bcac030b8f4f3c5c76d68fc475df3f073a4dffe55614ced9cf031c7581e428b1cee67078c63d4f41e0a51e372e41
47 DIST python-gentoo-patches-3.11.0a2.tar.xz 8472 BLAKE2B 440e31d70895a537bb89099cec440bd5de56cc3ddb65d71483f5f82eeb253fe4a99f87c41b8ad28ed039ffaa3eb48674de15b9e031572fd81aba4c1c79ad2ec0 SHA512 f87a7550fa20027c870500babcc8893c2c4dcaf68a25d8096e0edfa1f473fefbd0117bd847514f2784fe22cb0027b3b269c7bc7d7395c1f96932a56d02bfd404
48 -DIST python-gentoo-patches-3.6.14_p1.tar.xz 16576 BLAKE2B 902a9073e6d3e40cfba105680d9947b64a4bfa1632381bc71afbd2691350dccb36f498bf17ac7dfc8ce331dfc3fb7e3cdd539cea3f5e9db1c49210ad4d124182 SHA512 4aa354f1ca8d9bb3c30b666ef61cac8380741342102aeb9ea77cc06ae62179f595acc1c2e6321e9c2395abbc3fbc649ecc93b80443d139859924524989539992
49 DIST python-gentoo-patches-3.6.15.tar.xz 15300 BLAKE2B f49fd96f6ad1a1c94fea6b83acd229a81754b86061e243044ead4b9a9d5122a2e43b270b68722c359c084c05a566a3ad70aa46588ab7a005ee560ee118b92b8b SHA512 cc33491a33f3f1d990cf494d53b91b74db761142e8aebe1bd4b128ef10a268ff945e5ba08daad39cee095612a8e52265d6988873ecf9c073377cbbc10735aa39
50 DIST python-gentoo-patches-3.7.12_p1.tar.xz 19112 BLAKE2B e9964244af3db544dd6e96d85ca4bc24d7131b48eda85df5bafa3fb36474a024cecbbf4b27324e1f35f76ae6a1aed31dd7896e831b79b574b45a4371afcc7e5b SHA512 9ec996c2904f99bd6651ed1b700eabd91f2b82b1e9e0f3d9572243886a9c7139bf8ac2af04169485d3ca6339e1a87044cba203f6f0aee9609d2a1d53c812548d
51 DIST python-gentoo-patches-3.8.12_p1.tar.xz 16632 BLAKE2B cce7a41d020af1ffc55a01ef67b20bcb16c68adbccc1e44ef166d1707e817ed6c3bae70f84c56553f27bca449015e273014c0be73bc2f9b4e25844ddce385486 SHA512 4621727c2e9cc1c5519e021210e16a97e7167ea831445dfdd07f5b0ed642b5919834244111708a971ce098b10b439797e1c76827eccab803f801052c671f1ae6
52 -DIST python-gentoo-patches-3.9.7_p1.tar.xz 14444 BLAKE2B c976beb1205b0b777ff3375f538758bf28443bcf4c953fe161545791763da043e32582c398ec8151478afc40e53f963e080d29420066305c12963c953887e4b8 SHA512 283c8975885f9306e46a0047219f3a70e1000f3401affb0b55cde976be6fb6df2f1c13f4e05a479e72e0731d683fef9b22413f7cd320298295a31b19c8915b3d
53 DIST python-gentoo-patches-3.9.8.tar.xz 13192 BLAKE2B 995bead7e87b1d2eb9984012065c0f752d51e5a78dd9019270e071f83660cdab71c39e5be0104919f5af9089dede71d9c918a521f76e67c6ef1aeab5ffb58991 SHA512 80dfa3766bb5546924a5fccf4f469ce409cb8a4b0873c3d2fb737b3eb27b7c2b29337e0179624bbe077273b8e475f7921d6479ca7eb8e31ba423d0cea2f3d1cf
54 DIST python-gentoo-patches-3.9.9.tar.xz 13200 BLAKE2B 672e3b79094cbc791988639a5dde4c9e5622e91bef4310d26838716c65763ca69a12c6afef2f19487f4389974af009896e452c19783b0a491072d13f893af7e9 SHA512 3cd4ddd070ab48d9978e1136d237fc24030fd3ce6704371ce99815702a45d839ee26c7e9552b004661827759edd30222434e4166f9ee16f873ad4783c83f723f
55
56 diff --git a/dev-lang/python/python-3.11.0_alpha1.ebuild b/dev-lang/python/python-3.11.0_alpha1.ebuild
57 deleted file mode 100644
58 index 782b19ee1cf7..000000000000
59 --- a/dev-lang/python/python-3.11.0_alpha1.ebuild
60 +++ /dev/null
61 @@ -1,349 +0,0 @@
62 -# Copyright 1999-2021 Gentoo Authors
63 -# Distributed under the terms of the GNU General Public License v2
64 -
65 -EAPI="7"
66 -WANT_LIBTOOL="none"
67 -
68 -inherit autotools check-reqs flag-o-matic multiprocessing pax-utils \
69 - python-utils-r1 toolchain-funcs verify-sig
70 -
71 -MY_PV=${PV/_alpha/a}
72 -MY_P="Python-${MY_PV%_p*}"
73 -PYVER=$(ver_cut 1-2)
74 -PATCHSET="python-gentoo-patches-${MY_PV}"
75 -
76 -DESCRIPTION="An interpreted, interactive, object-oriented programming language"
77 -HOMEPAGE="https://www.python.org/"
78 -SRC_URI="https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz
79 - https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz
80 - verify-sig? (
81 - https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz.asc
82 - )"
83 -S="${WORKDIR}/${MY_P}"
84 -
85 -LICENSE="PSF-2"
86 -SLOT="${PYVER}"
87 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
88 -IUSE="bluetooth build examples gdbm hardened +ncurses +readline +sqlite +ssl test tk wininst +xml"
89 -RESTRICT="!test? ( test )"
90 -
91 -# Do not add a dependency on dev-lang/python to this ebuild.
92 -# If you need to apply a patch which requires python for bootstrapping, please
93 -# run the bootstrap code on your dev box and include the results in the
94 -# patchset. See bug 447752.
95 -
96 -RDEPEND="app-arch/bzip2:=
97 - app-arch/xz-utils:=
98 - dev-libs/libffi:=
99 - sys-apps/util-linux:=
100 - >=sys-libs/zlib-1.1.3:=
101 - virtual/libcrypt:=
102 - virtual/libintl
103 - gdbm? ( sys-libs/gdbm:=[berkdb] )
104 - ncurses? ( >=sys-libs/ncurses-5.2:= )
105 - readline? ( >=sys-libs/readline-4.1:= )
106 - sqlite? ( >=dev-db/sqlite-3.3.8:3= )
107 - ssl? ( >=dev-libs/openssl-1.1.1:= )
108 - tk? (
109 - >=dev-lang/tcl-8.0:=
110 - >=dev-lang/tk-8.0:=
111 - dev-tcltk/blt:=
112 - dev-tcltk/tix
113 - )
114 - xml? ( >=dev-libs/expat-2.1:= )
115 - !!<sys-apps/sandbox-2.21"
116 -# bluetooth requires headers from bluez
117 -DEPEND="${RDEPEND}
118 - bluetooth? ( net-wireless/bluez )
119 - test? ( app-arch/xz-utils[extra-filters(+)] )"
120 -# autoconf-archive needed to eautoreconf
121 -BDEPEND="
122 - sys-devel/autoconf-archive
123 - virtual/awk
124 - virtual/pkgconfig
125 - verify-sig? ( app-crypt/openpgp-keys-python )
126 - !sys-devel/gcc[libffi(-)]"
127 -RDEPEND+=" !build? ( app-misc/mime-types )"
128 -
129 -VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc
130 -
131 -# large file tests involve a 2.5G file being copied (duplicated)
132 -CHECKREQS_DISK_BUILD=5500M
133 -
134 -pkg_pretend() {
135 - use test && check-reqs_pkg_pretend
136 -}
137 -
138 -pkg_setup() {
139 - use test && check-reqs_pkg_setup
140 -}
141 -
142 -src_unpack() {
143 - if use verify-sig; then
144 - verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc}
145 - fi
146 - default
147 -}
148 -
149 -src_prepare() {
150 - # Ensure that internal copies of expat, libffi and zlib are not used.
151 - rm -fr Modules/expat || die
152 - rm -fr Modules/_ctypes/libffi* || die
153 - rm -fr Modules/zlib || die
154 -
155 - local PATCHES=(
156 - "${WORKDIR}/${PATCHSET}"
157 - )
158 -
159 - default
160 -
161 - sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
162 - setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
163 -
164 - # force correct number of jobs
165 - # https://bugs.gentoo.org/737660
166 - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
167 - sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die
168 - sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die
169 -
170 - eautoreconf
171 -}
172 -
173 -src_configure() {
174 - local disable
175 - # disable automagic bluetooth headers detection
176 - use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
177 - use gdbm || disable+=" gdbm"
178 - use ncurses || disable+=" _curses _curses_panel"
179 - use readline || disable+=" readline"
180 - use sqlite || disable+=" _sqlite3"
181 - use ssl || export PYTHON_DISABLE_SSL="1"
182 - use tk || disable+=" _tkinter"
183 - use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
184 - export PYTHON_DISABLE_MODULES="${disable}"
185 -
186 - if ! use xml; then
187 - ewarn "You have configured Python without XML support."
188 - ewarn "This is NOT a recommended configuration as you"
189 - ewarn "may face problems parsing any XML documents."
190 - fi
191 -
192 - if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
193 - einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
194 - fi
195 -
196 - if [[ "$(gcc-major-version)" -ge 4 ]]; then
197 - append-flags -fwrapv
198 - fi
199 -
200 - filter-flags -malign-double
201 -
202 - # https://bugs.gentoo.org/show_bug.cgi?id=50309
203 - if is-flagq -O3; then
204 - is-flagq -fstack-protector-all && replace-flags -O3 -O2
205 - use hardened && replace-flags -O3 -O2
206 - fi
207 -
208 - # https://bugs.gentoo.org/700012
209 - if is-flagq -flto || is-flagq '-flto=*'; then
210 - append-cflags $(test-flags-CC -ffat-lto-objects)
211 - fi
212 -
213 - # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
214 - tc-export CXX
215 -
216 - # Fix implicit declarations on cross and prefix builds. Bug #674070.
217 - use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
218 -
219 - local dbmliborder
220 - if use gdbm; then
221 - dbmliborder+="${dbmliborder:+:}gdbm"
222 - fi
223 -
224 - local myeconfargs=(
225 - # glibc-2.30 removes it; since we can't cleanly force-rebuild
226 - # Python on glibc upgrade, remove it proactively to give
227 - # a chance for users rebuilding python before glibc
228 - ac_cv_header_stropts_h=no
229 -
230 - --enable-shared
231 - --without-static-libpython
232 - --enable-ipv6
233 - --infodir='${prefix}/share/info'
234 - --mandir='${prefix}/share/man'
235 - --with-computed-gotos
236 - --with-dbmliborder="${dbmliborder}"
237 - --with-libc=
238 - --enable-loadable-sqlite-extensions
239 - --without-ensurepip
240 - --with-system-expat
241 - --with-system-ffi
242 - )
243 -
244 - OPT="" econf "${myeconfargs[@]}"
245 -
246 - if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
247 - eerror "configure has detected that the sem_open function is broken."
248 - eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
249 - die "Broken sem_open function (bug 496328)"
250 - fi
251 -}
252 -
253 -src_compile() {
254 - # Ensure sed works as expected
255 - # https://bugs.gentoo.org/594768
256 - local -x LC_ALL=C
257 - # Prevent using distutils bundled by setuptools.
258 - # https://bugs.gentoo.org/823728
259 - export SETUPTOOLS_USE_DISTUTILS=stdlib
260 -
261 - emake CPPFLAGS= CFLAGS= LDFLAGS=
262 -
263 - # Work around bug 329499. See also bug 413751 and 457194.
264 - if has_version dev-libs/libffi[pax-kernel]; then
265 - pax-mark E python
266 - else
267 - pax-mark m python
268 - fi
269 -}
270 -
271 -src_test() {
272 - # Tests will not work when cross compiling.
273 - if tc-is-cross-compiler; then
274 - elog "Disabling tests due to crosscompiling."
275 - return
276 - fi
277 -
278 - # Skip failing tests.
279 - local skipped_tests="gdb"
280 -
281 - for test in ${skipped_tests}; do
282 - mv "${S}"/Lib/test/test_${test}.py "${T}"
283 - done
284 -
285 - # bug 660358
286 - local -x COLUMNS=80
287 - local -x PYTHONDONTWRITEBYTECODE=
288 - addpredict /usr/lib/python3.11/site-packages
289 -
290 - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
291 -
292 - emake test EXTRATESTOPTS="-u-network -j${jobs}" \
293 - CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
294 - local result=$?
295 -
296 - for test in ${skipped_tests}; do
297 - mv "${T}/test_${test}.py" "${S}"/Lib/test
298 - done
299 -
300 - elog "The following tests have been skipped:"
301 - for test in ${skipped_tests}; do
302 - elog "test_${test}.py"
303 - done
304 -
305 - elog "If you would like to run them, you may:"
306 - elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'"
307 - elog "and run the tests separately."
308 -
309 - if [[ ${result} -ne 0 ]]; then
310 - die "emake test failed"
311 - fi
312 -}
313 -
314 -src_install() {
315 - local libdir=${ED}/usr/lib/python${PYVER}
316 -
317 - emake DESTDIR="${D}" altinstall
318 -
319 - sed \
320 - -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
321 - -e "s/\(PY_LDFLAGS=\).*/\1/" \
322 - -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed"
323 -
324 - # Fix collisions between different slots of Python.
325 - rm "${ED}/usr/$(get_libdir)/libpython3.so" || die
326 -
327 - # Cheap hack to get version with ABIFLAGS
328 - local abiver=$(cd "${ED}/usr/include"; echo python*)
329 - if [[ ${abiver} != python${PYVER} ]]; then
330 - # Replace python3.X with a symlink to python3.Xm
331 - rm "${ED}/usr/bin/python${PYVER}" || die
332 - dosym "${abiver}" "/usr/bin/python${PYVER}"
333 - # Create python3.X-config symlink
334 - dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
335 - # Create python-3.5m.pc symlink
336 - dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
337 - fi
338 -
339 - # python seems to get rebuilt in src_install (bug 569908)
340 - # Work around it for now.
341 - if has_version dev-libs/libffi[pax-kernel]; then
342 - pax-mark E "${ED}/usr/bin/${abiver}"
343 - else
344 - pax-mark m "${ED}/usr/bin/${abiver}"
345 - fi
346 -
347 - use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
348 - use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
349 -
350 - dodoc Misc/{ACKS,HISTORY,NEWS}
351 -
352 - if use examples; then
353 - docinto examples
354 - find Tools -name __pycache__ -exec rm -fr {} + || die
355 - dodoc -r Tools
356 - fi
357 - insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
358 - local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
359 - emake --no-print-directory -s -f - 2>/dev/null)
360 - newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
361 -
362 - newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
363 - newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
364 - sed \
365 - -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
366 - -e "s:@PYDOC@:pydoc${PYVER}:" \
367 - -i "${ED}/etc/conf.d/pydoc-${PYVER}" \
368 - "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed"
369 -
370 - local -x EPYTHON=python${PYVER}
371 - # if not using a cross-compiler, use the fresh binary
372 - if ! tc-is-cross-compiler; then
373 - local -x PYTHON=./python
374 - local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
375 - else
376 - local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
377 - fi
378 -
379 - echo "EPYTHON='${EPYTHON}'" > epython.py || die
380 - python_domodule epython.py
381 -
382 - # python-exec wrapping support
383 - local pymajor=${PYVER%.*}
384 - local scriptdir=${D}$(python_get_scriptdir)
385 - mkdir -p "${scriptdir}" || die
386 - # python and pythonX
387 - ln -s "../../../bin/${abiver}" \
388 - "${scriptdir}/python${pymajor}" || die
389 - ln -s "python${pymajor}" "${scriptdir}/python" || die
390 - # python-config and pythonX-config
391 - # note: we need to create a wrapper rather than symlinking it due
392 - # to some random dirname(argv[0]) magic performed by python-config
393 - cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die
394 - #!/bin/sh
395 - exec "${abiver}-config" "\${@}"
396 - EOF
397 - chmod +x "${scriptdir}/python${pymajor}-config" || die
398 - ln -s "python${pymajor}-config" \
399 - "${scriptdir}/python-config" || die
400 - # 2to3, pydoc
401 - ln -s "../../../bin/2to3-${PYVER}" \
402 - "${scriptdir}/2to3" || die
403 - ln -s "../../../bin/pydoc${PYVER}" \
404 - "${scriptdir}/pydoc" || die
405 - # idle
406 - if use tk; then
407 - ln -s "../../../bin/idle${PYVER}" \
408 - "${scriptdir}/idle" || die
409 - fi
410 -}
411
412 diff --git a/dev-lang/python/python-3.6.14_p1.ebuild b/dev-lang/python/python-3.6.14_p1.ebuild
413 deleted file mode 100644
414 index c6bd3292a583..000000000000
415 --- a/dev-lang/python/python-3.6.14_p1.ebuild
416 +++ /dev/null
417 @@ -1,337 +0,0 @@
418 -# Copyright 1999-2021 Gentoo Authors
419 -# Distributed under the terms of the GNU General Public License v2
420 -
421 -EAPI="7"
422 -WANT_LIBTOOL="none"
423 -
424 -inherit autotools flag-o-matic multiprocessing pax-utils \
425 - python-utils-r1 toolchain-funcs verify-sig
426 -
427 -MY_P="Python-${PV%_p*}"
428 -PYVER=$(ver_cut 1-2)
429 -PATCHSET="python-gentoo-patches-${PV}"
430 -
431 -DESCRIPTION="An interpreted, interactive, object-oriented programming language"
432 -HOMEPAGE="https://www.python.org/"
433 -SRC_URI="https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz
434 - https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz
435 - verify-sig? (
436 - https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz.asc
437 - )"
438 -S="${WORKDIR}/${MY_P}"
439 -
440 -LICENSE="PSF-2"
441 -SLOT="${PYVER}/${PYVER}m"
442 -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 sparc x86"
443 -IUSE="bluetooth build examples gdbm hardened +ncurses +readline +sqlite +ssl test tk wininst +xml"
444 -RESTRICT="!test? ( test )"
445 -
446 -# Do not add a dependency on dev-lang/python to this ebuild.
447 -# If you need to apply a patch which requires python for bootstrapping, please
448 -# run the bootstrap code on your dev box and include the results in the
449 -# patchset. See bug 447752.
450 -
451 -RDEPEND="app-arch/bzip2:=
452 - app-arch/xz-utils:=
453 - dev-libs/libffi:=
454 - >=sys-libs/zlib-1.1.3:=
455 - virtual/libcrypt:=
456 - virtual/libintl
457 - gdbm? ( sys-libs/gdbm:=[berkdb] )
458 - ncurses? ( >=sys-libs/ncurses-5.2:= )
459 - readline? ( >=sys-libs/readline-4.1:= )
460 - sqlite? ( >=dev-db/sqlite-3.3.8:3= )
461 - ssl? ( dev-libs/openssl:= )
462 - tk? (
463 - >=dev-lang/tcl-8.0:=
464 - >=dev-lang/tk-8.0:=
465 - dev-tcltk/blt:=
466 - dev-tcltk/tix
467 - )
468 - xml? ( >=dev-libs/expat-2.1:= )"
469 -# bluetooth requires headers from bluez
470 -DEPEND="${RDEPEND}
471 - bluetooth? ( net-wireless/bluez )
472 - test? ( app-arch/xz-utils[extra-filters(+)] )"
473 -BDEPEND="
474 - virtual/awk
475 - virtual/pkgconfig
476 - verify-sig? ( app-crypt/openpgp-keys-python )
477 - !sys-devel/gcc[libffi(-)]"
478 -RDEPEND+=" !build? ( app-misc/mime-types )"
479 -
480 -VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc
481 -
482 -src_unpack() {
483 - if use verify-sig; then
484 - verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc}
485 - fi
486 - default
487 -}
488 -
489 -src_prepare() {
490 - # Ensure that internal copies of expat, libffi and zlib are not used.
491 - rm -fr Modules/expat || die
492 - rm -fr Modules/_ctypes/libffi* || die
493 - rm -fr Modules/zlib || die
494 -
495 - local PATCHES=(
496 - "${WORKDIR}/${PATCHSET}"
497 - )
498 -
499 - default
500 -
501 - sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
502 - Lib/distutils/command/install.py \
503 - Lib/distutils/sysconfig.py \
504 - Lib/site.py \
505 - Lib/sysconfig.py \
506 - Lib/test/test_site.py \
507 - Makefile.pre.in \
508 - Modules/Setup.dist \
509 - Modules/getpath.c \
510 - configure.ac \
511 - setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
512 -
513 - # force correct number of jobs
514 - # https://bugs.gentoo.org/737660
515 - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
516 - sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die
517 -
518 - eautoreconf
519 -}
520 -
521 -src_configure() {
522 - local disable
523 - # disable automagic bluetooth headers detection
524 - use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
525 - use gdbm || disable+=" gdbm"
526 - use ncurses || disable+=" _curses _curses_panel"
527 - use readline || disable+=" readline"
528 - use sqlite || disable+=" _sqlite3"
529 - use ssl || export PYTHON_DISABLE_SSL="1"
530 - use tk || disable+=" _tkinter"
531 - use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
532 - export PYTHON_DISABLE_MODULES="${disable}"
533 -
534 - if ! use xml; then
535 - ewarn "You have configured Python without XML support."
536 - ewarn "This is NOT a recommended configuration as you"
537 - ewarn "may face problems parsing any XML documents."
538 - fi
539 -
540 - if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
541 - einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
542 - fi
543 -
544 - if [[ "$(gcc-major-version)" -ge 4 ]]; then
545 - append-flags -fwrapv
546 - fi
547 -
548 - filter-flags -malign-double
549 -
550 - # https://bugs.gentoo.org/show_bug.cgi?id=50309
551 - if is-flagq -O3; then
552 - is-flagq -fstack-protector-all && replace-flags -O3 -O2
553 - use hardened && replace-flags -O3 -O2
554 - fi
555 -
556 - # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
557 - tc-export CXX
558 -
559 - local dbmliborder
560 - if use gdbm; then
561 - dbmliborder+="${dbmliborder:+:}gdbm"
562 - fi
563 -
564 - local myeconfargs=(
565 - # glibc-2.30 removes it; since we can't cleanly force-rebuild
566 - # Python on glibc upgrade, remove it proactively to give
567 - # a chance for users rebuilding python before glibc
568 - ac_cv_header_stropts_h=no
569 -
570 - --with-fpectl
571 - --enable-shared
572 - --enable-ipv6
573 - --with-threads
574 - --infodir='${prefix}/share/info'
575 - --mandir='${prefix}/share/man'
576 - --with-computed-gotos
577 - --with-dbmliborder="${dbmliborder}"
578 - --with-libc=
579 - --enable-loadable-sqlite-extensions
580 - --without-ensurepip
581 - --with-system-expat
582 - --with-system-ffi
583 - )
584 -
585 - OPT="" econf "${myeconfargs[@]}"
586 -
587 - if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
588 - eerror "configure has detected that the sem_open function is broken."
589 - eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
590 - die "Broken sem_open function (bug 496328)"
591 - fi
592 -}
593 -
594 -src_compile() {
595 - # Ensure sed works as expected
596 - # https://bugs.gentoo.org/594768
597 - local -x LC_ALL=C
598 -
599 - emake CPPFLAGS= CFLAGS= LDFLAGS=
600 -
601 - # Work around bug 329499. See also bug 413751 and 457194.
602 - if has_version dev-libs/libffi[pax-kernel]; then
603 - pax-mark E python
604 - else
605 - pax-mark m python
606 - fi
607 -}
608 -
609 -src_test() {
610 - # Tests will not work when cross compiling.
611 - if tc-is-cross-compiler; then
612 - elog "Disabling tests due to crosscompiling."
613 - return
614 - fi
615 -
616 - # Skip failing tests.
617 - local skipped_tests="gdb faulthandler"
618 -
619 - for test in ${skipped_tests}; do
620 - mv "${S}"/Lib/test/test_${test}.py "${T}"
621 - done
622 -
623 - # bug 660358
624 - local -x COLUMNS=80
625 - local -x PYTHONDONTWRITEBYTECODE=
626 -
627 - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
628 -
629 - emake test EXTRATESTOPTS="-u-network -j${jobs}" \
630 - CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
631 - local result=$?
632 -
633 - for test in ${skipped_tests}; do
634 - mv "${T}/test_${test}.py" "${S}"/Lib/test
635 - done
636 -
637 - elog "The following tests have been skipped:"
638 - for test in ${skipped_tests}; do
639 - elog "test_${test}.py"
640 - done
641 -
642 - elog "If you would like to run them, you may:"
643 - elog "cd '${EPREFIX}/usr/$(get_libdir)/python${PYVER}/test'"
644 - elog "and run the tests separately."
645 -
646 - if [[ ${result} -ne 0 ]]; then
647 - die "emake test failed"
648 - fi
649 -}
650 -
651 -src_install() {
652 - local libdir=${ED}/usr/$(get_libdir)/python${PYVER}
653 -
654 - emake DESTDIR="${D}" altinstall
655 -
656 - # Remove static library
657 - rm "${ED}"/usr/$(get_libdir)/libpython*.a || die
658 -
659 - sed \
660 - -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
661 - -e "s/\(PY_LDFLAGS=\).*/\1/" \
662 - -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed"
663 -
664 - # Fix collisions between different slots of Python.
665 - rm "${ED}/usr/$(get_libdir)/libpython3.so" || die
666 -
667 - # Cheap hack to get version with ABIFLAGS
668 - local abiver=$(cd "${ED}/usr/include"; echo python*)
669 - if [[ ${abiver} != python${PYVER} ]]; then
670 - # Replace python3.X with a symlink to python3.Xm
671 - rm "${ED}/usr/bin/python${PYVER}" || die
672 - dosym "${abiver}" "/usr/bin/python${PYVER}"
673 - # Create python3.X-config symlink
674 - dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
675 - # Create python-3.5m.pc symlink
676 - dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
677 - fi
678 -
679 - # python seems to get rebuilt in src_install (bug 569908)
680 - # Work around it for now.
681 - if has_version dev-libs/libffi[pax-kernel]; then
682 - pax-mark E "${ED}/usr/bin/${abiver}"
683 - else
684 - pax-mark m "${ED}/usr/bin/${abiver}"
685 - fi
686 -
687 - use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
688 - use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
689 -
690 - use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die
691 -
692 - dodoc Misc/{ACKS,HISTORY,NEWS}
693 -
694 - if use examples; then
695 - docinto examples
696 - find Tools -name __pycache__ -exec rm -fr {} + || die
697 - dodoc -r Tools
698 - fi
699 - insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
700 - local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
701 - emake --no-print-directory -s -f - 2>/dev/null)
702 - newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
703 -
704 - newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
705 - newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
706 - sed \
707 - -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
708 - -e "s:@PYDOC@:pydoc${PYVER}:" \
709 - -i "${ED}/etc/conf.d/pydoc-${PYVER}" \
710 - "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed"
711 -
712 - local -x EPYTHON=python${PYVER}
713 - # if not using a cross-compiler, use the fresh binary
714 - if ! tc-is-cross-compiler; then
715 - local -x PYTHON=./python
716 - local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
717 - else
718 - local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
719 - fi
720 -
721 - echo "EPYTHON='${EPYTHON}'" > epython.py || die
722 - python_domodule epython.py
723 -
724 - # python-exec wrapping support
725 - local pymajor=${PYVER%.*}
726 - local scriptdir=${D}$(python_get_scriptdir)
727 - mkdir -p "${scriptdir}" || die
728 - # python and pythonX
729 - ln -s "../../../bin/${abiver}" \
730 - "${scriptdir}/python${pymajor}" || die
731 - ln -s "python${pymajor}" "${scriptdir}/python" || die
732 - # python-config and pythonX-config
733 - # note: we need to create a wrapper rather than symlinking it due
734 - # to some random dirname(argv[0]) magic performed by python-config
735 - cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die
736 - #!/bin/sh
737 - exec "${abiver}-config" "\${@}"
738 - EOF
739 - chmod +x "${scriptdir}/python${pymajor}-config" || die
740 - ln -s "python${pymajor}-config" \
741 - "${scriptdir}/python-config" || die
742 - # 2to3, pydoc, pyvenv
743 - ln -s "../../../bin/2to3-${PYVER}" \
744 - "${scriptdir}/2to3" || die
745 - ln -s "../../../bin/pydoc${PYVER}" \
746 - "${scriptdir}/pydoc" || die
747 - ln -s "../../../bin/pyvenv-${PYVER}" \
748 - "${scriptdir}/pyvenv" || die
749 - # idle
750 - if use tk; then
751 - ln -s "../../../bin/idle${PYVER}" \
752 - "${scriptdir}/idle" || die
753 - fi
754 -}
755
756 diff --git a/dev-lang/python/python-3.9.7_p1.ebuild b/dev-lang/python/python-3.9.7_p1.ebuild
757 deleted file mode 100644
758 index 68e7ee9cc370..000000000000
759 --- a/dev-lang/python/python-3.9.7_p1.ebuild
760 +++ /dev/null
761 @@ -1,348 +0,0 @@
762 -# Copyright 1999-2021 Gentoo Authors
763 -# Distributed under the terms of the GNU General Public License v2
764 -
765 -EAPI="7"
766 -WANT_LIBTOOL="none"
767 -
768 -inherit autotools check-reqs flag-o-matic multiprocessing pax-utils \
769 - python-utils-r1 toolchain-funcs verify-sig
770 -
771 -MY_PV=${PV/_rc/rc}
772 -MY_P="Python-${MY_PV%_p*}"
773 -PYVER=$(ver_cut 1-2)
774 -PATCHSET="python-gentoo-patches-${MY_PV}"
775 -
776 -DESCRIPTION="An interpreted, interactive, object-oriented programming language"
777 -HOMEPAGE="https://www.python.org/"
778 -SRC_URI="https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz
779 - https://dev.gentoo.org/~floppym/python/${PATCHSET}.tar.xz
780 - verify-sig? (
781 - https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz.asc
782 - )"
783 -S="${WORKDIR}/${MY_P}"
784 -
785 -LICENSE="PSF-2"
786 -SLOT="${PYVER}"
787 -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
788 -IUSE="bluetooth build examples gdbm hardened +ncurses +readline +sqlite +ssl test tk wininst +xml"
789 -RESTRICT="!test? ( test )"
790 -
791 -# Do not add a dependency on dev-lang/python to this ebuild.
792 -# If you need to apply a patch which requires python for bootstrapping, please
793 -# run the bootstrap code on your dev box and include the results in the
794 -# patchset. See bug 447752.
795 -
796 -RDEPEND="app-arch/bzip2:=
797 - app-arch/xz-utils:=
798 - dev-libs/libffi:=
799 - sys-apps/util-linux:=
800 - >=sys-libs/zlib-1.1.3:=
801 - virtual/libcrypt:=
802 - virtual/libintl
803 - gdbm? ( sys-libs/gdbm:=[berkdb] )
804 - ncurses? ( >=sys-libs/ncurses-5.2:= )
805 - readline? ( >=sys-libs/readline-4.1:= )
806 - sqlite? ( >=dev-db/sqlite-3.3.8:3= )
807 - ssl? ( >=dev-libs/openssl-1.1.1:= )
808 - tk? (
809 - >=dev-lang/tcl-8.0:=
810 - >=dev-lang/tk-8.0:=
811 - dev-tcltk/blt:=
812 - dev-tcltk/tix
813 - )
814 - xml? ( >=dev-libs/expat-2.1:= )"
815 -# bluetooth requires headers from bluez
816 -DEPEND="${RDEPEND}
817 - bluetooth? ( net-wireless/bluez )
818 - test? ( app-arch/xz-utils[extra-filters(+)] )"
819 -BDEPEND="
820 - virtual/awk
821 - virtual/pkgconfig
822 - sys-devel/autoconf-archive
823 - verify-sig? ( app-crypt/openpgp-keys-python )
824 - !sys-devel/gcc[libffi(-)]"
825 -RDEPEND+=" !build? ( app-misc/mime-types )"
826 -
827 -VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc
828 -
829 -# large file tests involve a 2.5G file being copied (duplicated)
830 -CHECKREQS_DISK_BUILD=5500M
831 -
832 -pkg_pretend() {
833 - use test && check-reqs_pkg_pretend
834 -}
835 -
836 -pkg_setup() {
837 - use test && check-reqs_pkg_setup
838 -}
839 -
840 -src_unpack() {
841 - if use verify-sig; then
842 - verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc}
843 - fi
844 - default
845 -}
846 -
847 -src_prepare() {
848 - # Ensure that internal copies of expat, libffi and zlib are not used.
849 - rm -fr Modules/expat || die
850 - rm -fr Modules/_ctypes/libffi* || die
851 - rm -fr Modules/zlib || die
852 -
853 - local PATCHES=(
854 - "${WORKDIR}/${PATCHSET}"
855 - )
856 -
857 - default
858 -
859 - sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
860 - setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
861 -
862 - # force correct number of jobs
863 - # https://bugs.gentoo.org/737660
864 - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
865 - sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die
866 - sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die
867 -
868 - eautoreconf
869 -}
870 -
871 -src_configure() {
872 - local disable
873 - # disable automagic bluetooth headers detection
874 - use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
875 - use gdbm || disable+=" gdbm"
876 - use ncurses || disable+=" _curses _curses_panel"
877 - use readline || disable+=" readline"
878 - use sqlite || disable+=" _sqlite3"
879 - use ssl || export PYTHON_DISABLE_SSL="1"
880 - use tk || disable+=" _tkinter"
881 - use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
882 - export PYTHON_DISABLE_MODULES="${disable}"
883 -
884 - if ! use xml; then
885 - ewarn "You have configured Python without XML support."
886 - ewarn "This is NOT a recommended configuration as you"
887 - ewarn "may face problems parsing any XML documents."
888 - fi
889 -
890 - if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
891 - einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
892 - fi
893 -
894 - if [[ "$(gcc-major-version)" -ge 4 ]]; then
895 - append-flags -fwrapv
896 - fi
897 -
898 - filter-flags -malign-double
899 -
900 - # https://bugs.gentoo.org/show_bug.cgi?id=50309
901 - if is-flagq -O3; then
902 - is-flagq -fstack-protector-all && replace-flags -O3 -O2
903 - use hardened && replace-flags -O3 -O2
904 - fi
905 -
906 - # https://bugs.gentoo.org/700012
907 - if is-flagq -flto || is-flagq '-flto=*'; then
908 - append-cflags $(test-flags-CC -ffat-lto-objects)
909 - fi
910 -
911 - # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
912 - tc-export CXX
913 -
914 - # Fix implicit declarations on cross and prefix builds. Bug #674070.
915 - use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
916 -
917 - local dbmliborder
918 - if use gdbm; then
919 - dbmliborder+="${dbmliborder:+:}gdbm"
920 - fi
921 -
922 - local myeconfargs=(
923 - # glibc-2.30 removes it; since we can't cleanly force-rebuild
924 - # Python on glibc upgrade, remove it proactively to give
925 - # a chance for users rebuilding python before glibc
926 - ac_cv_header_stropts_h=no
927 -
928 - --enable-shared
929 - --enable-ipv6
930 - --infodir='${prefix}/share/info'
931 - --mandir='${prefix}/share/man'
932 - --with-computed-gotos
933 - --with-dbmliborder="${dbmliborder}"
934 - --with-libc=
935 - --enable-loadable-sqlite-extensions
936 - --without-ensurepip
937 - --with-system-expat
938 - --with-system-ffi
939 - )
940 -
941 - OPT="" econf "${myeconfargs[@]}"
942 -
943 - if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
944 - eerror "configure has detected that the sem_open function is broken."
945 - eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
946 - die "Broken sem_open function (bug 496328)"
947 - fi
948 -}
949 -
950 -src_compile() {
951 - # Ensure sed works as expected
952 - # https://bugs.gentoo.org/594768
953 - local -x LC_ALL=C
954 - # Prevent using distutils bundled by setuptools.
955 - # https://bugs.gentoo.org/823728
956 - export SETUPTOOLS_USE_DISTUTILS=stdlib
957 -
958 - emake CPPFLAGS= CFLAGS= LDFLAGS=
959 -
960 - # Work around bug 329499. See also bug 413751 and 457194.
961 - if has_version dev-libs/libffi[pax-kernel]; then
962 - pax-mark E python
963 - else
964 - pax-mark m python
965 - fi
966 -}
967 -
968 -src_test() {
969 - # Tests will not work when cross compiling.
970 - if tc-is-cross-compiler; then
971 - elog "Disabling tests due to crosscompiling."
972 - return
973 - fi
974 -
975 - # Skip failing tests.
976 - local skipped_tests="gdb"
977 -
978 - for test in ${skipped_tests}; do
979 - mv "${S}"/Lib/test/test_${test}.py "${T}"
980 - done
981 -
982 - # bug 660358
983 - local -x COLUMNS=80
984 - local -x PYTHONDONTWRITEBYTECODE=
985 -
986 - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
987 -
988 - emake test EXTRATESTOPTS="-u-network -j${jobs}" \
989 - CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
990 - local result=$?
991 -
992 - for test in ${skipped_tests}; do
993 - mv "${T}/test_${test}.py" "${S}"/Lib/test
994 - done
995 -
996 - elog "The following tests have been skipped:"
997 - for test in ${skipped_tests}; do
998 - elog "test_${test}.py"
999 - done
1000 -
1001 - elog "If you would like to run them, you may:"
1002 - elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'"
1003 - elog "and run the tests separately."
1004 -
1005 - if [[ ${result} -ne 0 ]]; then
1006 - die "emake test failed"
1007 - fi
1008 -}
1009 -
1010 -src_install() {
1011 - local libdir=${ED}/usr/lib/python${PYVER}
1012 -
1013 - emake DESTDIR="${D}" altinstall
1014 -
1015 - # Remove static library
1016 - rm "${ED}"/usr/$(get_libdir)/libpython*.a || die
1017 -
1018 - sed \
1019 - -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
1020 - -e "s/\(PY_LDFLAGS=\).*/\1/" \
1021 - -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed"
1022 -
1023 - # Fix collisions between different slots of Python.
1024 - rm "${ED}/usr/$(get_libdir)/libpython3.so" || die
1025 -
1026 - # Cheap hack to get version with ABIFLAGS
1027 - local abiver=$(cd "${ED}/usr/include"; echo python*)
1028 - if [[ ${abiver} != python${PYVER} ]]; then
1029 - # Replace python3.X with a symlink to python3.Xm
1030 - rm "${ED}/usr/bin/python${PYVER}" || die
1031 - dosym "${abiver}" "/usr/bin/python${PYVER}"
1032 - # Create python3.X-config symlink
1033 - dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
1034 - # Create python-3.5m.pc symlink
1035 - dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc"
1036 - fi
1037 -
1038 - # python seems to get rebuilt in src_install (bug 569908)
1039 - # Work around it for now.
1040 - if has_version dev-libs/libffi[pax-kernel]; then
1041 - pax-mark E "${ED}/usr/bin/${abiver}"
1042 - else
1043 - pax-mark m "${ED}/usr/bin/${abiver}"
1044 - fi
1045 -
1046 - use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
1047 - use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
1048 -
1049 - dodoc Misc/{ACKS,HISTORY,NEWS}
1050 -
1051 - if use examples; then
1052 - docinto examples
1053 - find Tools -name __pycache__ -exec rm -fr {} + || die
1054 - dodoc -r Tools
1055 - fi
1056 - insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
1057 - local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
1058 - emake --no-print-directory -s -f - 2>/dev/null)
1059 - newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
1060 -
1061 - newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
1062 - newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
1063 - sed \
1064 - -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
1065 - -e "s:@PYDOC@:pydoc${PYVER}:" \
1066 - -i "${ED}/etc/conf.d/pydoc-${PYVER}" \
1067 - "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed"
1068 -
1069 - local -x EPYTHON=python${PYVER}
1070 - # if not using a cross-compiler, use the fresh binary
1071 - if ! tc-is-cross-compiler; then
1072 - local -x PYTHON=./python
1073 - local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD}
1074 - else
1075 - local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
1076 - fi
1077 -
1078 - echo "EPYTHON='${EPYTHON}'" > epython.py || die
1079 - python_domodule epython.py
1080 -
1081 - # python-exec wrapping support
1082 - local pymajor=${PYVER%.*}
1083 - local scriptdir=${D}$(python_get_scriptdir)
1084 - mkdir -p "${scriptdir}" || die
1085 - # python and pythonX
1086 - ln -s "../../../bin/${abiver}" \
1087 - "${scriptdir}/python${pymajor}" || die
1088 - ln -s "python${pymajor}" "${scriptdir}/python" || die
1089 - # python-config and pythonX-config
1090 - # note: we need to create a wrapper rather than symlinking it due
1091 - # to some random dirname(argv[0]) magic performed by python-config
1092 - cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die
1093 - #!/bin/sh
1094 - exec "${abiver}-config" "\${@}"
1095 - EOF
1096 - chmod +x "${scriptdir}/python${pymajor}-config" || die
1097 - ln -s "python${pymajor}-config" \
1098 - "${scriptdir}/python-config" || die
1099 - # 2to3, pydoc
1100 - ln -s "../../../bin/2to3-${PYVER}" \
1101 - "${scriptdir}/2to3" || die
1102 - ln -s "../../../bin/pydoc${PYVER}" \
1103 - "${scriptdir}/pydoc" || die
1104 - # idle
1105 - if use tk; then
1106 - ln -s "../../../bin/idle${PYVER}" \
1107 - "${scriptdir}/idle" || die
1108 - fi
1109 -}