1 |
commit: 854cf9fadd3298c66e69a72067b85c12ec9d3d7a |
2 |
Author: orbea <orbea <AT> riseup <DOT> net> |
3 |
AuthorDate: Wed Mar 15 19:09:20 2023 +0000 |
4 |
Commit: Quentin Retornaz <gentoo <AT> retornaz <DOT> com> |
5 |
CommitDate: Thu Mar 16 21:50:26 2023 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=854cf9fa |
7 |
|
8 |
dev-lang/python: Remove old versions |
9 |
|
10 |
Signed-off-by: orbea <orbea <AT> riseup.net> |
11 |
Closes: https://github.com/gentoo/libressl/pull/503 |
12 |
Signed-off-by: Quentin Retornaz <gentoo <AT> retornaz.com> |
13 |
|
14 |
dev-lang/python/Manifest | 7 - |
15 |
dev-lang/python/python-3.10.9-r1.ebuild | 487 ------------------------------ |
16 |
dev-lang/python/python-3.11.1-r1.ebuild | 519 -------------------------------- |
17 |
dev-lang/python/python-3.9.16_p1.ebuild | 485 ----------------------------- |
18 |
4 files changed, 1498 deletions(-) |
19 |
|
20 |
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest |
21 |
index 8c6f56b..4f838cc 100644 |
22 |
--- a/dev-lang/python/Manifest |
23 |
+++ b/dev-lang/python/Manifest |
24 |
@@ -2,18 +2,11 @@ DIST Python-2.7.18.tar.xz 12854736 BLAKE2B 060a621c91dd8e3d321aec99d44c17aa67381 |
25 |
DIST Python-2.7.18.tar.xz.asc 833 BLAKE2B 1d98770e46171971fb99994508d238c01d2755281d2f94353314014d9e83e0ec5f0b3e3950ea1fdf5fce9ba6b8f55312355845c2a3fc4291c27ee56fe6215448 SHA512 c2a5f5a52f47dec52460ad3275758d4e5de6e7075c3def4353c988d74d563a39b42cae2d5eb24e2a23a6247cef69100f91620b11a49c2359fbf99b203c9cbda8 |
26 |
DIST Python-3.10.10.tar.xz 19627028 BLAKE2B 57fc6869fa05586158a170c1892d93a3036823bfafb9484b9d70bca6cdc3e76f75357622eace4bde9a4c0ca62a1bb79665e5751b41655f9f4d7e345547013ad8 SHA512 f0aee65970a68287b34c4eafcf35c6fa09c81ba234ac356db16fbbc6c36417e4ac67071e616d118f5e192d541d7f177dcab5585b9780e842f656c09e01c37ced |
27 |
DIST Python-3.10.10.tar.xz.asc 833 BLAKE2B fd60e6268f7dd6676ea58bd7e80c513506ac9810c1a62ff060134207b0fd8e7b096d5f11f3cc536a1578144ff54c00bcb076d3c3f5889a69a898660dd280312b SHA512 591746d74c6123bf36c763b6e8e1de1554f02eeff30c855623ef0f12d3864d5573eb5efe96d6e142f24627c77b90738ada3456df4ad59bddcb008658f2ca8af9 |
28 |
-DIST Python-3.10.9.tar.xz 19612112 BLAKE2B ef2d063a9fbaf234aa4a47149cb184a0379dc403515df10249104a5092750cdaf22ad47916d34e17dd68fff1c30338c0375f4e4e3cc9bde33e0896c1c3ba655b SHA512 d66ea8adeb6dc4951e612175f8838b3092967ff275b7a3470f2d86f470036aa2221e722c3144d90bcd230b88efd53dde204213f72f703e524e4b833e2ccc68e2 |
29 |
-DIST Python-3.10.9.tar.xz.asc 833 BLAKE2B 8895c6cb5031b2463cc6ba3e0dc56bee40c2e99117c062f9c72f2b7adb0d5a49782b968abfc764117e8513bd12816915245677c25b1710e3dae3c9e26937c2b9 SHA512 525e166ede6836086de814c26fc880f41eaf1ed4bff6118f00342e42f7ab1c47148447ced1b565e146d3125fa06b5cd6b394a256bc61096766b26e07f18bbf10 |
30 |
-DIST Python-3.11.1.tar.xz 19856648 BLAKE2B 2a8942e7a145cfcc5b6932865ff9a1afd300bf2e6c4c915e88d0e849441196a3a4cacf94f3db87eaa7538872059085cf7eeff91c436f424448f85d4b180a6f24 SHA512 5edd70c881e083c96199c60471f18f9ebc4c97a2d45dc66f89e16d7c3638d8a5d2cbf2e84b1be3d7f1178ce9f7fa4197884385c1ee3618ff66a538f872f318ed |
31 |
-DIST Python-3.11.1.tar.xz.asc 833 BLAKE2B 27c6101b2022cb7bea3e6082f1554b31cceb8cabe720e4b19391f550e870588c4defd1552c580a7e063638b80e8b8f415e54a11cf40ae3b0f449500c2e9babc6 SHA512 81ed05c2adf38552bdc5ac761704f2720a646d56681a919a6bfa51f1a4b42cd14edb9c84d58664dbc8e7b561cd78d82ae6b10dda423e1fae543bc7fa4bf3f78e |
32 |
DIST Python-3.11.2.tar.xz 19893284 BLAKE2B 0cfb1fefcdd4c4baf5c34f74ab0600ac7cd40101d266c28f66f9d35bcfbf19d6c3ff2a5b0d357ee1d03061e06005ea3ee7b18adf878d32e197434b3da2b7d918 SHA512 5684ec7eae2dce26facc54d448ccdb6901bbfa1cab03abbe8fd34e4268a2b701daa13df15903349492447035be78380d473389e8703b4e910a65b088d2462e8b |
33 |
DIST Python-3.11.2.tar.xz.asc 833 BLAKE2B 15795836babd269424f1ff511073e27235827353383d15cac6a85406b967787840ca6c0f119faa1971a50ebb6699e6cdf0de095f428b868b57a91eb8dc6d5baa SHA512 9d9d1c6dd6e56a916c6861cd0e7e623a165b0845bafe0acfcae27b4fe10a6b7015844e6b3f8deded26a763c935e32f565b2e12beb20c43fda16c11eba8d282a1 |
34 |
DIST Python-3.9.16.tar.xz 19738796 BLAKE2B 70dedeb70d9d8f27e4f6db5106623e087c61d451c7a04639cf8d3503ad02d4d43f1b36d0cdf1131aefc9bf6e677e561227dd4baef2c2c3d2dbf6d3e7dc36bd94 SHA512 b5fd0afe131c82bbce6ddf887c59eef6945910d6a9a2bc87c0927f4e4a096bf9ca4d25bcb729c40f6ebb8a65fbe8bf7b0b97a7c4a8c9e551240eb4f34b878653 |
35 |
DIST Python-3.9.16.tar.xz.asc 833 BLAKE2B 416b4a4be06e101c5971c12a6f21229c425bcabaea58487e0d1b24d6dea318c58806ee43892fc704df8252670451bd6a4a2610c25672d3983ddb081fed34b92d SHA512 468959c36a3ec6136f57a39475fff4745a25be0cb5d3d58cf3e5faf0b9ce2d2a8b89f1f9fea1479c4c6ad12ac49e97c1cfd4291c978bb3d30df5a582ec315210 |
36 |
DIST python-gentoo-patches-2.7.18_p16.tar.xz 35448 BLAKE2B 0139c0944f62f9cdd236f6a8557e0ed19704c7d72869af1cb7d8bd3e646a746cd4a0201e1b44232a5e78ef49f254db20b0d0271bf744fbfd4fe0f1e99b8f3e6c SHA512 810be590d0e06fab4b2165e6852ca49662f09dcd7e20b47a29f613ad7653252c8dfac3f0eb228d77c8a914efa7c08788b2fbd552a4b47504f5fd0ec17450c48f |
37 |
DIST python-gentoo-patches-3.10.10_p3.tar.xz 14700 BLAKE2B 934462f437ffbf0b65e1cd63719121b7d551698e5ca9e67283a60f24151c6cf62eb0d31b16dad3b6e95da0dd6eac8c84c86332e42195f0f9dd7fbc4db52a3f9e SHA512 72e97a441463fff2760deb5557d2bbee82a5354b3db30e1ea34ea05bf349af0a46e0ff244e5ec212c8d2663ad79e660634733c3737ed853f5270c5c0427c902f |
38 |
-DIST python-gentoo-patches-3.10.9.tar.xz 12216 BLAKE2B ced4f951089c51ddaab6c62ade9d2c84f69e7e1baf2acf5247559534c7d0fb0e88dca1222f5bd2209b4e61f5aca17279b8054f269535dbc10de0786c2c5779f5 SHA512 2d01f0f3831beeba004517bb82f7d616f25f08e5c755409ecff79cd68e0a619b5bf6802fffd0e5f7f39f1d9d93e65b018b91cdeb337a5e47f1651f36bea0e96e |
39 |
-DIST python-gentoo-patches-3.11.1.tar.xz 7076 BLAKE2B 3ec45f7529d34eabc9d9ba7fa7f8dd51d8754d9758a605b61857a9fd80386a0357837c925263ad7b0e207ff916944b94cc0e03c0f59921f839d5e51d92f0e47e SHA512 4253dbfa057a91db584b92550e2d39d87986f33041233bc400dd0254cbd95415b33fc47b0fe997bb84192c755bc16d3d31941bba4c216ee4d65facf0b48c7862 |
40 |
DIST python-gentoo-patches-3.11.2_p2.tar.xz 8516 BLAKE2B 52bfdfac533ed53f32b8546c37a10b7019f3f0cd296b7929d3eb83fdc6a5e49c95515bb2ba56487b81e68701c586520db08e323ac1f49ef6f82da56010e21a28 SHA512 4388c0ae0bd25a002aed095d1db42076bcf6b7486955aa41c34ac41318e82eec686e8b9aac31ff766eed16edf3fb86fd333c448090240ba79bbc35e458a96dd0 |
41 |
-DIST python-gentoo-patches-3.9.16_p1.tar.xz 25564 BLAKE2B e6b7f20bb0457011d74f441d58eb0c9c4426a61bf0f8a2146f0180104c7b8b5054a04afc664374a17f3770d3ae94836099c362e841e4c00631a75fc56a2b352d SHA512 43f473dba8f6bd19c6a30f169ec8e8abb9eefe7d26c357884ee27cabf1b5876c079ea0e9454b9e52021d15f070e0a824e3366cfde20d57175f5f89774ee50a5b |
42 |
DIST python-gentoo-patches-3.9.16_p3.tar.xz 27160 BLAKE2B 5a41a6ff135c3aca02b19cf9a61f554ca224173854274b872ce85e8c71f25c678604e50b87bae40d4b5ac082731c143338fcc6ef47acebad2b59ce0b1d600f5d SHA512 1ace0a9e929769c29082fdec6845a476c07c13fbbff8726a7a592fda09da8b50c996638b4e4e40acccb15630a796074329adbcc9a004c4305952fa5b0dc4146c |
43 |
|
44 |
diff --git a/dev-lang/python/python-3.10.9-r1.ebuild b/dev-lang/python/python-3.10.9-r1.ebuild |
45 |
deleted file mode 100644 |
46 |
index 32e19e6..0000000 |
47 |
--- a/dev-lang/python/python-3.10.9-r1.ebuild |
48 |
+++ /dev/null |
49 |
@@ -1,487 +0,0 @@ |
50 |
-# Copyright 1999-2023 Gentoo Authors |
51 |
-# Distributed under the terms of the GNU General Public License v2 |
52 |
- |
53 |
-EAPI="7" |
54 |
-WANT_LIBTOOL="none" |
55 |
- |
56 |
-inherit autotools check-reqs flag-o-matic multiprocessing pax-utils |
57 |
-inherit prefix python-utils-r1 toolchain-funcs verify-sig |
58 |
- |
59 |
-MY_PV=${PV/_rc/rc} |
60 |
-MY_P="Python-${MY_PV%_p*}" |
61 |
-PYVER=$(ver_cut 1-2) |
62 |
-PATCHSET="python-gentoo-patches-${MY_PV}" |
63 |
- |
64 |
-DESCRIPTION="An interpreted, interactive, object-oriented programming language" |
65 |
-HOMEPAGE=" |
66 |
- https://www.python.org/ |
67 |
- https://github.com/python/cpython/ |
68 |
-" |
69 |
-SRC_URI=" |
70 |
- https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz |
71 |
- https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz |
72 |
- verify-sig? ( |
73 |
- https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz.asc |
74 |
- ) |
75 |
-" |
76 |
-S="${WORKDIR}/${MY_P}" |
77 |
- |
78 |
-LICENSE="PSF-2" |
79 |
-SLOT="${PYVER}" |
80 |
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" |
81 |
-IUSE=" |
82 |
- bluetooth build +ensurepip examples gdbm hardened libedit lto |
83 |
- +ncurses pgo +readline +sqlite +ssl test tk valgrind +xml |
84 |
-" |
85 |
-RESTRICT="!test? ( test )" |
86 |
- |
87 |
-# Do not add a dependency on dev-lang/python to this ebuild. |
88 |
-# If you need to apply a patch which requires python for bootstrapping, please |
89 |
-# run the bootstrap code on your dev box and include the results in the |
90 |
-# patchset. See bug 447752. |
91 |
- |
92 |
-RDEPEND=" |
93 |
- app-arch/bzip2:= |
94 |
- app-arch/xz-utils:= |
95 |
- dev-lang/python-exec[python_targets_python3_10(-)] |
96 |
- dev-libs/libffi:= |
97 |
- dev-python/gentoo-common |
98 |
- sys-apps/util-linux:= |
99 |
- >=sys-libs/zlib-1.1.3:= |
100 |
- virtual/libcrypt:= |
101 |
- virtual/libintl |
102 |
- ensurepip? ( dev-python/ensurepip-wheels ) |
103 |
- gdbm? ( sys-libs/gdbm:=[berkdb] ) |
104 |
- ncurses? ( >=sys-libs/ncurses-5.2:= ) |
105 |
- readline? ( |
106 |
- !libedit? ( >=sys-libs/readline-4.1:= ) |
107 |
- libedit? ( dev-libs/libedit:= ) |
108 |
- ) |
109 |
- sqlite? ( >=dev-db/sqlite-3.3.8:3= ) |
110 |
- ssl? ( >=dev-libs/openssl-1.1.1:= ) |
111 |
- tk? ( |
112 |
- >=dev-lang/tcl-8.0:= |
113 |
- >=dev-lang/tk-8.0:= |
114 |
- dev-tcltk/blt:= |
115 |
- dev-tcltk/tix |
116 |
- ) |
117 |
- xml? ( >=dev-libs/expat-2.1:= ) |
118 |
- !!<sys-apps/sandbox-2.21 |
119 |
-" |
120 |
-# bluetooth requires headers from bluez |
121 |
-DEPEND=" |
122 |
- ${RDEPEND} |
123 |
- bluetooth? ( net-wireless/bluez ) |
124 |
- valgrind? ( dev-util/valgrind ) |
125 |
- test? ( app-arch/xz-utils[extra-filters(+)] ) |
126 |
-" |
127 |
-# autoconf-archive needed to eautoreconf |
128 |
-BDEPEND=" |
129 |
- sys-devel/autoconf-archive |
130 |
- app-alternatives/awk |
131 |
- virtual/pkgconfig |
132 |
- verify-sig? ( sec-keys/openpgp-keys-python ) |
133 |
-" |
134 |
-RDEPEND+=" |
135 |
- !build? ( app-misc/mime-types ) |
136 |
-" |
137 |
- |
138 |
-VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc |
139 |
- |
140 |
-# large file tests involve a 2.5G file being copied (duplicated) |
141 |
-CHECKREQS_DISK_BUILD=5500M |
142 |
- |
143 |
-QA_PKGCONFIG_VERSION=${PYVER} |
144 |
- |
145 |
-pkg_pretend() { |
146 |
- use test && check-reqs_pkg_pretend |
147 |
-} |
148 |
- |
149 |
-pkg_setup() { |
150 |
- use test && check-reqs_pkg_setup |
151 |
-} |
152 |
- |
153 |
-src_unpack() { |
154 |
- if use verify-sig; then |
155 |
- verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc} |
156 |
- fi |
157 |
- default |
158 |
-} |
159 |
- |
160 |
-src_prepare() { |
161 |
- # Ensure that internal copies of expat and libffi are not used. |
162 |
- rm -r Modules/expat || die |
163 |
- rm -r Modules/_ctypes/libffi* || die |
164 |
- |
165 |
- local PATCHES=( |
166 |
- "${WORKDIR}/${PATCHSET}" |
167 |
- "${FILESDIR}"/${PN}-3.10.3-libressl.patch |
168 |
- ) |
169 |
- |
170 |
- default |
171 |
- |
172 |
- # https://bugs.gentoo.org/850151 |
173 |
- sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" setup.py || die |
174 |
- |
175 |
- # force the correct number of jobs |
176 |
- # https://bugs.gentoo.org/737660 |
177 |
- local jobs=$(makeopts_jobs) |
178 |
- sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die |
179 |
- sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die |
180 |
- |
181 |
- eautoreconf |
182 |
-} |
183 |
- |
184 |
-src_configure() { |
185 |
- # disable automagic bluetooth headers detection |
186 |
- if ! use bluetooth; then |
187 |
- local -x ac_cv_header_bluetooth_bluetooth_h=no |
188 |
- fi |
189 |
- local disable |
190 |
- use gdbm || disable+=" gdbm" |
191 |
- use ncurses || disable+=" _curses _curses_panel" |
192 |
- use readline || disable+=" readline" |
193 |
- use sqlite || disable+=" _sqlite3" |
194 |
- use ssl || export PYTHON_DISABLE_SSL="1" |
195 |
- use tk || disable+=" _tkinter" |
196 |
- use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. |
197 |
- export PYTHON_DISABLE_MODULES="${disable}" |
198 |
- |
199 |
- if ! use xml; then |
200 |
- ewarn "You have configured Python without XML support." |
201 |
- ewarn "This is NOT a recommended configuration as you" |
202 |
- ewarn "may face problems parsing any XML documents." |
203 |
- fi |
204 |
- |
205 |
- if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then |
206 |
- einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" |
207 |
- fi |
208 |
- |
209 |
- append-flags -fwrapv |
210 |
- filter-flags -malign-double |
211 |
- |
212 |
- # https://bugs.gentoo.org/700012 |
213 |
- if is-flagq -flto || is-flagq '-flto=*'; then |
214 |
- append-cflags $(test-flags-CC -ffat-lto-objects) |
215 |
- fi |
216 |
- |
217 |
- # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. |
218 |
- # PKG_CONFIG needed for cross. |
219 |
- tc-export CXX PKG_CONFIG |
220 |
- |
221 |
- local dbmliborder= |
222 |
- if use gdbm; then |
223 |
- dbmliborder+="${dbmliborder:+:}gdbm" |
224 |
- fi |
225 |
- |
226 |
- if use pgo; then |
227 |
- local profile_task_flags=( |
228 |
- -m test |
229 |
- "-j$(makeopts_jobs)" |
230 |
- --pgo-extended |
231 |
- -x test_gdb |
232 |
- -u-network |
233 |
- |
234 |
- # All of these seem to occasionally hang for PGO inconsistently |
235 |
- # They'll even hang here but be fine in src_test sometimes. |
236 |
- # bug #828535 (and related: bug #788022) |
237 |
- -x test_asyncio |
238 |
- -x test_httpservers |
239 |
- -x test_logging |
240 |
- -x test_multiprocessing_fork |
241 |
- -x test_socket |
242 |
- -x test_xmlrpc |
243 |
- ) |
244 |
- |
245 |
- if has_version "app-arch/rpm" ; then |
246 |
- # Avoid sandbox failure (attempts to write to /var/lib/rpm) |
247 |
- profile_task_flags+=( |
248 |
- -x test_distutils |
249 |
- ) |
250 |
- fi |
251 |
- local -x PROFILE_TASK="${profile_task_flags[*]}" |
252 |
- fi |
253 |
- |
254 |
- local myeconfargs=( |
255 |
- # glibc-2.30 removes it; since we can't cleanly force-rebuild |
256 |
- # Python on glibc upgrade, remove it proactively to give |
257 |
- # a chance for users rebuilding python before glibc |
258 |
- ac_cv_header_stropts_h=no |
259 |
- |
260 |
- --enable-shared |
261 |
- --without-static-libpython |
262 |
- --enable-ipv6 |
263 |
- --infodir='${prefix}/share/info' |
264 |
- --mandir='${prefix}/share/man' |
265 |
- --with-computed-gotos |
266 |
- --with-dbmliborder="${dbmliborder}" |
267 |
- --with-libc= |
268 |
- --enable-loadable-sqlite-extensions |
269 |
- --without-ensurepip |
270 |
- --with-system-expat |
271 |
- --with-system-ffi |
272 |
- --with-wheel-pkg-dir="${EPREFIX}"/usr/lib/python/ensurepip |
273 |
- |
274 |
- $(use_with lto) |
275 |
- $(use_enable pgo optimizations) |
276 |
- $(use_with readline readline "$(usex libedit editline readline)") |
277 |
- $(use_with valgrind) |
278 |
- ) |
279 |
- |
280 |
- # disable implicit optimization/debugging flags |
281 |
- local -x OPT= |
282 |
- |
283 |
- if tc-is-cross-compiler ; then |
284 |
- # Hack to workaround get_libdir not being able to handle CBUILD, bug #794181 |
285 |
- local cbuild_libdir=$(unset PKG_CONFIG_PATH ; $(tc-getBUILD_PKG_CONFIG) --keep-system-libs --libs-only-L libffi) |
286 |
- |
287 |
- # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get |
288 |
- # propagated to sysconfig for built extensions |
289 |
- local -x CFLAGS_NODIST=${CFLAGS_FOR_BUILD} |
290 |
- local -x LDFLAGS_NODIST=${LDFLAGS_FOR_BUILD} |
291 |
- local -x CFLAGS= LDFLAGS= |
292 |
- |
293 |
- # We need to build our own Python on CBUILD first, and feed it in. |
294 |
- # bug #847910 and bug #864911. |
295 |
- local myeconfargs_cbuild=( |
296 |
- "${myeconfargs[@]}" |
297 |
- |
298 |
- --libdir="${cbuild_libdir:2}" |
299 |
- |
300 |
- # Avoid needing to load the right libpython.so. |
301 |
- --disable-shared |
302 |
- |
303 |
- # As minimal as possible for the mini CBUILD Python |
304 |
- # we build just for cross. |
305 |
- --without-lto |
306 |
- --disable-optimizations |
307 |
- ) |
308 |
- |
309 |
- # Point the imminent CHOST build to the Python we just |
310 |
- # built for CBUILD. |
311 |
- export PATH="${WORKDIR}/${P}-${CBUILD}:${PATH}" |
312 |
- |
313 |
- mkdir "${WORKDIR}"/${P}-${CBUILD} || die |
314 |
- pushd "${WORKDIR}"/${P}-${CBUILD} &> /dev/null || die |
315 |
- # We disable _ctypes and _crypt for CBUILD because Python's setup.py can't handle locating |
316 |
- # libdir correctly for cross. |
317 |
- PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _ctypes _crypt" \ |
318 |
- ECONF_SOURCE="${S}" econf_build "${myeconfargs_cbuild[@]}" |
319 |
- |
320 |
- # Avoid as many dependencies as possible for the cross build. |
321 |
- cat >> Makefile <<-EOF || die |
322 |
- MODULE_NIS=disabled |
323 |
- MODULE__DBM=disabled |
324 |
- MODULE__GDBM=disabled |
325 |
- MODULE__DBM=disabled |
326 |
- MODULE__SQLITE3=disabled |
327 |
- MODULE__HASHLIB=disabled |
328 |
- MODULE__SSL=disabled |
329 |
- MODULE__CURSES=disabled |
330 |
- MODULE__CURSES_PANEL=disabled |
331 |
- MODULE_READLINE=disabled |
332 |
- MODULE__TKINTER=disabled |
333 |
- MODULE_PYEXPAT=disabled |
334 |
- MODULE_ZLIB=disabled |
335 |
- EOF |
336 |
- |
337 |
- # Unfortunately, we do have to build this immediately, and |
338 |
- # not in src_compile, because CHOST configure for Python |
339 |
- # will check the existence of the Python it was pointed to |
340 |
- # immediately. |
341 |
- PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _ctypes _crypt" emake |
342 |
- popd &> /dev/null || die |
343 |
- fi |
344 |
- |
345 |
- # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get |
346 |
- # propagated to sysconfig for built extensions |
347 |
- local -x CFLAGS_NODIST=${CFLAGS} |
348 |
- local -x LDFLAGS_NODIST=${LDFLAGS} |
349 |
- local -x CFLAGS= LDFLAGS= |
350 |
- |
351 |
- # Fix implicit declarations on cross and prefix builds. Bug #674070. |
352 |
- if use ncurses; then |
353 |
- append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw |
354 |
- fi |
355 |
- |
356 |
- hprefixify setup.py |
357 |
- econf "${myeconfargs[@]}" |
358 |
- |
359 |
- if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then |
360 |
- eerror "configure has detected that the sem_open function is broken." |
361 |
- eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." |
362 |
- die "Broken sem_open function (bug 496328)" |
363 |
- fi |
364 |
- |
365 |
- # install epython.py as part of stdlib |
366 |
- echo "EPYTHON='python${PYVER}'" > Lib/epython.py || die |
367 |
-} |
368 |
- |
369 |
-src_compile() { |
370 |
- # Ensure sed works as expected |
371 |
- # https://bugs.gentoo.org/594768 |
372 |
- local -x LC_ALL=C |
373 |
- # Prevent using distutils bundled by setuptools. |
374 |
- # https://bugs.gentoo.org/823728 |
375 |
- export SETUPTOOLS_USE_DISTUTILS=stdlib |
376 |
- |
377 |
- # Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't |
378 |
- # end up writing bytecode & violating sandbox. |
379 |
- # bug #831897 |
380 |
- local -x _PYTHONDONTWRITEBYTECODE=${PYTHONDONTWRITEBYTECODE} |
381 |
- |
382 |
- if use pgo ; then |
383 |
- # bug 660358 |
384 |
- local -x COLUMNS=80 |
385 |
- local -x PYTHONDONTWRITEBYTECODE= |
386 |
- |
387 |
- addpredict "/usr/lib/python${PYVER}/site-packages" |
388 |
- fi |
389 |
- |
390 |
- # also need to clear the flags explicitly here or they end up |
391 |
- # in _sysconfigdata* |
392 |
- emake CPPFLAGS= CFLAGS= LDFLAGS= |
393 |
- |
394 |
- # Restore saved value from above. |
395 |
- local -x PYTHONDONTWRITEBYTECODE=${_PYTHONDONTWRITEBYTECODE} |
396 |
- |
397 |
- # Work around bug 329499. See also bug 413751 and 457194. |
398 |
- if has_version dev-libs/libffi[pax-kernel]; then |
399 |
- pax-mark E python |
400 |
- else |
401 |
- pax-mark m python |
402 |
- fi |
403 |
-} |
404 |
- |
405 |
-src_test() { |
406 |
- # Tests will not work when cross compiling. |
407 |
- if tc-is-cross-compiler; then |
408 |
- elog "Disabling tests due to crosscompiling." |
409 |
- return |
410 |
- fi |
411 |
- |
412 |
- local test_opts=( |
413 |
- -u-network |
414 |
- -j "$(makeopts_jobs)" |
415 |
- |
416 |
- # fails |
417 |
- -x test_gdb |
418 |
- ) |
419 |
- |
420 |
- if use sparc ; then |
421 |
- # bug #788022 |
422 |
- test_opts+=( |
423 |
- -x test_multiprocessing_fork |
424 |
- -x test_multiprocessing_forkserver |
425 |
- ) |
426 |
- fi |
427 |
- |
428 |
- # workaround docutils breaking tests |
429 |
- cat > Lib/docutils.py <<-EOF || die |
430 |
- raise ImportError("Thou shalt not import!") |
431 |
- EOF |
432 |
- |
433 |
- # bug 660358 |
434 |
- local -x COLUMNS=80 |
435 |
- local -x PYTHONDONTWRITEBYTECODE= |
436 |
- # workaround https://bugs.gentoo.org/775416 |
437 |
- addwrite "/usr/lib/python${PYVER}/site-packages" |
438 |
- |
439 |
- nonfatal emake test EXTRATESTOPTS="${test_opts[*]}" \ |
440 |
- CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty |
441 |
- local ret=${?} |
442 |
- |
443 |
- rm Lib/docutils.py || die |
444 |
- |
445 |
- [[ ${ret} -eq 0 ]] || die "emake test failed" |
446 |
-} |
447 |
- |
448 |
-src_install() { |
449 |
- local libdir=${ED}/usr/lib/python${PYVER} |
450 |
- |
451 |
- emake DESTDIR="${D}" altinstall |
452 |
- |
453 |
- # Fix collisions between different slots of Python. |
454 |
- rm "${ED}/usr/$(get_libdir)/libpython3.so" || die |
455 |
- |
456 |
- # Cheap hack to get version with ABIFLAGS |
457 |
- local abiver=$(cd "${ED}/usr/include"; echo python*) |
458 |
- if [[ ${abiver} != python${PYVER} ]]; then |
459 |
- # Replace python3.X with a symlink to python3.Xm |
460 |
- rm "${ED}/usr/bin/python${PYVER}" || die |
461 |
- dosym "${abiver}" "/usr/bin/python${PYVER}" |
462 |
- # Create python3.X-config symlink |
463 |
- dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" |
464 |
- # Create python-3.5m.pc symlink |
465 |
- dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" |
466 |
- fi |
467 |
- |
468 |
- # python seems to get rebuilt in src_install (bug 569908) |
469 |
- # Work around it for now. |
470 |
- if has_version dev-libs/libffi[pax-kernel]; then |
471 |
- pax-mark E "${ED}/usr/bin/${abiver}" |
472 |
- else |
473 |
- pax-mark m "${ED}/usr/bin/${abiver}" |
474 |
- fi |
475 |
- |
476 |
- rm -r "${libdir}"/ensurepip/_bundled || die |
477 |
- if ! use ensurepip; then |
478 |
- rm -r "${libdir}"/ensurepip || die |
479 |
- fi |
480 |
- if ! use sqlite; then |
481 |
- rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die |
482 |
- fi |
483 |
- if ! use tk; then |
484 |
- rm -r "${ED}/usr/bin/idle${PYVER}" || die |
485 |
- rm -r "${libdir}/"{idlelib,tkinter,test/test_tk*} || die |
486 |
- fi |
487 |
- |
488 |
- ln -s ../python/EXTERNALLY-MANAGED "${libdir}/EXTERNALLY-MANAGED" || die |
489 |
- |
490 |
- dodoc Misc/{ACKS,HISTORY,NEWS} |
491 |
- |
492 |
- if use examples; then |
493 |
- docinto examples |
494 |
- find Tools -name __pycache__ -exec rm -fr {} + || die |
495 |
- dodoc -r Tools |
496 |
- fi |
497 |
- insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 |
498 |
- local libname=$( |
499 |
- printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | |
500 |
- emake --no-print-directory -s -f - 2>/dev/null |
501 |
- ) |
502 |
- newins Tools/gdb/libpython.py "${libname}"-gdb.py |
503 |
- |
504 |
- newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER} |
505 |
- newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER} |
506 |
- sed \ |
507 |
- -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \ |
508 |
- -e "s:@PYDOC@:pydoc${PYVER}:" \ |
509 |
- -i "${ED}/etc/conf.d/pydoc-${PYVER}" \ |
510 |
- "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed" |
511 |
- |
512 |
- # python-exec wrapping support |
513 |
- local pymajor=${PYVER%.*} |
514 |
- local EPYTHON=python${PYVER} |
515 |
- local scriptdir=${D}$(python_get_scriptdir) |
516 |
- mkdir -p "${scriptdir}" || die |
517 |
- # python and pythonX |
518 |
- ln -s "../../../bin/${abiver}" "${scriptdir}/python${pymajor}" || die |
519 |
- ln -s "python${pymajor}" "${scriptdir}/python" || die |
520 |
- # python-config and pythonX-config |
521 |
- # note: we need to create a wrapper rather than symlinking it due |
522 |
- # to some random dirname(argv[0]) magic performed by python-config |
523 |
- cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die |
524 |
- #!/bin/sh |
525 |
- exec "${abiver}-config" "\${@}" |
526 |
- EOF |
527 |
- chmod +x "${scriptdir}/python${pymajor}-config" || die |
528 |
- ln -s "python${pymajor}-config" "${scriptdir}/python-config" || die |
529 |
- # 2to3, pydoc |
530 |
- ln -s "../../../bin/2to3-${PYVER}" "${scriptdir}/2to3" || die |
531 |
- ln -s "../../../bin/pydoc${PYVER}" "${scriptdir}/pydoc" || die |
532 |
- # idle |
533 |
- if use tk; then |
534 |
- ln -s "../../../bin/idle${PYVER}" "${scriptdir}/idle" || die |
535 |
- fi |
536 |
-} |
537 |
|
538 |
diff --git a/dev-lang/python/python-3.11.1-r1.ebuild b/dev-lang/python/python-3.11.1-r1.ebuild |
539 |
deleted file mode 100644 |
540 |
index 12a6f8f..0000000 |
541 |
--- a/dev-lang/python/python-3.11.1-r1.ebuild |
542 |
+++ /dev/null |
543 |
@@ -1,519 +0,0 @@ |
544 |
-# Copyright 1999-2023 Gentoo Authors |
545 |
-# Distributed under the terms of the GNU General Public License v2 |
546 |
- |
547 |
-EAPI="7" |
548 |
-WANT_LIBTOOL="none" |
549 |
- |
550 |
-inherit autotools check-reqs flag-o-matic multiprocessing pax-utils |
551 |
-inherit prefix python-utils-r1 toolchain-funcs verify-sig |
552 |
- |
553 |
-MY_PV=${PV/_rc/rc} |
554 |
-MY_P="Python-${MY_PV%_p*}" |
555 |
-PYVER=$(ver_cut 1-2) |
556 |
-PATCHSET="python-gentoo-patches-${MY_PV}" |
557 |
- |
558 |
-DESCRIPTION="An interpreted, interactive, object-oriented programming language" |
559 |
-HOMEPAGE=" |
560 |
- https://www.python.org/ |
561 |
- https://github.com/python/cpython/ |
562 |
-" |
563 |
-SRC_URI=" |
564 |
- https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz |
565 |
- https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz |
566 |
- verify-sig? ( |
567 |
- https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz.asc |
568 |
- ) |
569 |
-" |
570 |
-S="${WORKDIR}/${MY_P}" |
571 |
- |
572 |
-LICENSE="PSF-2" |
573 |
-SLOT="${PYVER}" |
574 |
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" |
575 |
-IUSE=" |
576 |
- bluetooth build +ensurepip examples gdbm hardened libedit lto |
577 |
- +ncurses pgo +readline +sqlite +ssl test tk valgrind |
578 |
-" |
579 |
-RESTRICT="!test? ( test )" |
580 |
- |
581 |
-# Do not add a dependency on dev-lang/python to this ebuild. |
582 |
-# If you need to apply a patch which requires python for bootstrapping, please |
583 |
-# run the bootstrap code on your dev box and include the results in the |
584 |
-# patchset. See bug 447752. |
585 |
- |
586 |
-RDEPEND=" |
587 |
- app-arch/bzip2:= |
588 |
- app-arch/xz-utils:= |
589 |
- app-crypt/libb2 |
590 |
- >=dev-libs/expat-2.1:= |
591 |
- dev-libs/libffi:= |
592 |
- dev-python/gentoo-common |
593 |
- sys-apps/util-linux:= |
594 |
- >=sys-libs/zlib-1.1.3:= |
595 |
- virtual/libcrypt:= |
596 |
- virtual/libintl |
597 |
- ensurepip? ( dev-python/ensurepip-wheels ) |
598 |
- gdbm? ( sys-libs/gdbm:=[berkdb] ) |
599 |
- ncurses? ( >=sys-libs/ncurses-5.2:= ) |
600 |
- readline? ( |
601 |
- !libedit? ( >=sys-libs/readline-4.1:= ) |
602 |
- libedit? ( dev-libs/libedit:= ) |
603 |
- ) |
604 |
- sqlite? ( >=dev-db/sqlite-3.3.8:3= ) |
605 |
- ssl? ( >=dev-libs/openssl-1.1.1:= ) |
606 |
- tk? ( |
607 |
- >=dev-lang/tcl-8.0:= |
608 |
- >=dev-lang/tk-8.0:= |
609 |
- dev-tcltk/blt:= |
610 |
- dev-tcltk/tix |
611 |
- ) |
612 |
- !!<sys-apps/sandbox-2.21 |
613 |
-" |
614 |
-# bluetooth requires headers from bluez |
615 |
-DEPEND=" |
616 |
- ${RDEPEND} |
617 |
- bluetooth? ( net-wireless/bluez ) |
618 |
- test? ( app-arch/xz-utils[extra-filters(+)] ) |
619 |
- valgrind? ( dev-util/valgrind ) |
620 |
-" |
621 |
-# autoconf-archive needed to eautoreconf |
622 |
-BDEPEND=" |
623 |
- sys-devel/autoconf-archive |
624 |
- app-alternatives/awk |
625 |
- virtual/pkgconfig |
626 |
- verify-sig? ( sec-keys/openpgp-keys-python ) |
627 |
-" |
628 |
-RDEPEND+=" |
629 |
- !build? ( app-misc/mime-types ) |
630 |
-" |
631 |
-if [[ ${PV} != *_alpha* ]]; then |
632 |
- RDEPEND+=" |
633 |
- dev-lang/python-exec[python_targets_python${PYVER/./_}(-)] |
634 |
- " |
635 |
-fi |
636 |
- |
637 |
-VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc |
638 |
- |
639 |
-# large file tests involve a 2.5G file being copied (duplicated) |
640 |
-CHECKREQS_DISK_BUILD=5500M |
641 |
- |
642 |
-QA_PKGCONFIG_VERSION=${PYVER} |
643 |
- |
644 |
-pkg_pretend() { |
645 |
- use test && check-reqs_pkg_pretend |
646 |
-} |
647 |
- |
648 |
-pkg_setup() { |
649 |
- use test && check-reqs_pkg_setup |
650 |
-} |
651 |
- |
652 |
-src_unpack() { |
653 |
- if use verify-sig; then |
654 |
- verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc} |
655 |
- fi |
656 |
- default |
657 |
-} |
658 |
- |
659 |
-src_prepare() { |
660 |
- # Ensure that internal copies of expat and libffi are not used. |
661 |
- rm -r Modules/expat || die |
662 |
- rm -r Modules/_ctypes/libffi* || die |
663 |
- |
664 |
- local PATCHES=( |
665 |
- "${WORKDIR}/${PATCHSET}" |
666 |
- "${FILESDIR}"/${PN}-3.10.3-libressl.patch |
667 |
- ) |
668 |
- |
669 |
- default |
670 |
- |
671 |
- # https://bugs.gentoo.org/850151 |
672 |
- sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" setup.py || die |
673 |
- |
674 |
- # force the correct number of jobs |
675 |
- # https://bugs.gentoo.org/737660 |
676 |
- local jobs=$(makeopts_jobs) |
677 |
- sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die |
678 |
- sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die |
679 |
- |
680 |
- eautoreconf |
681 |
-} |
682 |
- |
683 |
-src_configure() { |
684 |
- local disable |
685 |
- # disable automagic bluetooth headers detection |
686 |
- if ! use bluetooth; then |
687 |
- local -x ac_cv_header_bluetooth_bluetooth_h=no |
688 |
- fi |
689 |
- |
690 |
- append-flags -fwrapv |
691 |
- filter-flags -malign-double |
692 |
- |
693 |
- # https://bugs.gentoo.org/700012 |
694 |
- if is-flagq -flto || is-flagq '-flto=*'; then |
695 |
- append-cflags $(test-flags-CC -ffat-lto-objects) |
696 |
- fi |
697 |
- |
698 |
- # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. |
699 |
- # PKG_CONFIG needed for cross. |
700 |
- tc-export CXX PKG_CONFIG |
701 |
- |
702 |
- local dbmliborder= |
703 |
- if use gdbm; then |
704 |
- dbmliborder+="${dbmliborder:+:}gdbm" |
705 |
- fi |
706 |
- |
707 |
- if use pgo; then |
708 |
- local profile_task_flags=( |
709 |
- -m test |
710 |
- "-j$(makeopts_jobs)" |
711 |
- --pgo-extended |
712 |
- -x test_gdb |
713 |
- -u-network |
714 |
- |
715 |
- # All of these seem to occasionally hang for PGO inconsistently |
716 |
- # They'll even hang here but be fine in src_test sometimes. |
717 |
- # bug #828535 (and related: bug #788022) |
718 |
- -x test_asyncio |
719 |
- -x test_httpservers |
720 |
- -x test_logging |
721 |
- -x test_multiprocessing_fork |
722 |
- -x test_socket |
723 |
- -x test_xmlrpc |
724 |
- ) |
725 |
- |
726 |
- if has_version "app-arch/rpm" ; then |
727 |
- # Avoid sandbox failure (attempts to write to /var/lib/rpm) |
728 |
- profile_task_flags+=( |
729 |
- -x test_distutils |
730 |
- ) |
731 |
- fi |
732 |
- local -x PROFILE_TASK="${profile_task_flags[*]}" |
733 |
- fi |
734 |
- |
735 |
- local myeconfargs=( |
736 |
- # glibc-2.30 removes it; since we can't cleanly force-rebuild |
737 |
- # Python on glibc upgrade, remove it proactively to give |
738 |
- # a chance for users rebuilding python before glibc |
739 |
- ac_cv_header_stropts_h=no |
740 |
- |
741 |
- # libressl doesn't find hashlib (From OpenBSD) |
742 |
- ac_cv_working_openssl_hashlib=yes |
743 |
- |
744 |
- --enable-shared |
745 |
- --without-static-libpython |
746 |
- --enable-ipv6 |
747 |
- --infodir='${prefix}/share/info' |
748 |
- --mandir='${prefix}/share/man' |
749 |
- --with-computed-gotos |
750 |
- --with-dbmliborder="${dbmliborder}" |
751 |
- --with-libc= |
752 |
- --enable-loadable-sqlite-extensions |
753 |
- --without-ensurepip |
754 |
- --with-system-expat |
755 |
- --with-system-ffi |
756 |
- --with-platlibdir=lib |
757 |
- --with-pkg-config=yes |
758 |
- --with-wheel-pkg-dir="${EPREFIX}"/usr/lib/python/ensurepip |
759 |
- |
760 |
- $(use_with lto) |
761 |
- $(use_enable pgo optimizations) |
762 |
- $(use_with readline readline "$(usex libedit editline readline)") |
763 |
- $(use_with valgrind) |
764 |
- ) |
765 |
- |
766 |
- # disable implicit optimization/debugging flags |
767 |
- local -x OPT= |
768 |
- |
769 |
- if tc-is-cross-compiler ; then |
770 |
- # Hack to workaround get_libdir not being able to handle CBUILD, bug #794181 |
771 |
- local cbuild_libdir=$(unset PKG_CONFIG_PATH ; $(tc-getBUILD_PKG_CONFIG) --keep-system-libs --libs-only-L libffi) |
772 |
- |
773 |
- # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get |
774 |
- # propagated to sysconfig for built extensions |
775 |
- local -x CFLAGS_NODIST=${CFLAGS_FOR_BUILD} |
776 |
- local -x LDFLAGS_NODIST=${LDFLAGS_FOR_BUILD} |
777 |
- local -x CFLAGS= LDFLAGS= |
778 |
- |
779 |
- # We need to build our own Python on CBUILD first, and feed it in. |
780 |
- # bug #847910 |
781 |
- local myeconfargs_cbuild=( |
782 |
- "${myeconfargs[@]}" |
783 |
- |
784 |
- --libdir="${cbuild_libdir:2}" |
785 |
- |
786 |
- # Avoid needing to load the right libpython.so. |
787 |
- --disable-shared |
788 |
- |
789 |
- # As minimal as possible for the mini CBUILD Python |
790 |
- # we build just for cross to satisfy --with-build-python. |
791 |
- --without-lto |
792 |
- --without-readline |
793 |
- --disable-optimizations |
794 |
- ) |
795 |
- |
796 |
- myeconfargs+=( |
797 |
- # Point the imminent CHOST build to the Python we just |
798 |
- # built for CBUILD. |
799 |
- --with-build-python="${WORKDIR}"/${P}-${CBUILD}/python |
800 |
- ) |
801 |
- |
802 |
- mkdir "${WORKDIR}"/${P}-${CBUILD} || die |
803 |
- pushd "${WORKDIR}"/${P}-${CBUILD} &> /dev/null || die |
804 |
- # We disable _ctypes and _crypt for CBUILD because Python's setup.py can't handle locating |
805 |
- # libdir correctly for cross. |
806 |
- PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _ctypes _crypt" \ |
807 |
- ECONF_SOURCE="${S}" econf_build "${myeconfargs_cbuild[@]}" |
808 |
- |
809 |
- # Avoid as many dependencies as possible for the cross build. |
810 |
- cat >> Makefile <<-EOF || die |
811 |
- MODULE_NIS_STATE=disabled |
812 |
- MODULE__DBM_STATE=disabled |
813 |
- MODULE__GDBM_STATE=disabled |
814 |
- MODULE__DBM_STATE=disabled |
815 |
- MODULE__SQLITE3_STATE=disabled |
816 |
- MODULE__HASHLIB_STATE=disabled |
817 |
- MODULE__SSL_STATE=disabled |
818 |
- MODULE__CURSES_STATE=disabled |
819 |
- MODULE__CURSES_PANEL_STATE=disabled |
820 |
- MODULE_READLINE_STATE=disabled |
821 |
- MODULE__TKINTER_STATE=disabled |
822 |
- MODULE_PYEXPAT_STATE=disabled |
823 |
- MODULE_ZLIB_STATE=disabled |
824 |
- EOF |
825 |
- |
826 |
- # Unfortunately, we do have to build this immediately, and |
827 |
- # not in src_compile, because CHOST configure for Python |
828 |
- # will check the existence of the --with-build-python value |
829 |
- # immediately. |
830 |
- PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _ctypes _crypt" emake |
831 |
- popd &> /dev/null || die |
832 |
- fi |
833 |
- |
834 |
- # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get |
835 |
- # propagated to sysconfig for built extensions |
836 |
- local -x CFLAGS_NODIST=${CFLAGS} |
837 |
- local -x LDFLAGS_NODIST=${LDFLAGS} |
838 |
- local -x CFLAGS= LDFLAGS= |
839 |
- |
840 |
- # Fix implicit declarations on cross and prefix builds. Bug #674070. |
841 |
- if use ncurses; then |
842 |
- append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw |
843 |
- fi |
844 |
- |
845 |
- hprefixify setup.py |
846 |
- econf "${myeconfargs[@]}" |
847 |
- |
848 |
- if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then |
849 |
- eerror "configure has detected that the sem_open function is broken." |
850 |
- eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." |
851 |
- die "Broken sem_open function (bug 496328)" |
852 |
- fi |
853 |
- |
854 |
- # force-disable modules we don't want built |
855 |
- local disable_modules=( NIS ) |
856 |
- use gdbm || disable_modules+=( _GDBM _DBM ) |
857 |
- use sqlite || disable_modules+=( _SQLITE3 ) |
858 |
- use ssl || disable_modules+=( _HASHLIB _SSL ) |
859 |
- use ncurses || disable_modules+=( _CURSES _CURSES_PANEL ) |
860 |
- use readline || disable_modules+=( READLINE ) |
861 |
- use tk || disable_modules+=( _TKINTER ) |
862 |
- |
863 |
- local mod |
864 |
- for mod in "${disable_modules[@]}"; do |
865 |
- echo "MODULE_${mod}_STATE=disabled" |
866 |
- done >> Makefile || die |
867 |
- |
868 |
- # install epython.py as part of stdlib |
869 |
- echo "EPYTHON='python${PYVER}'" > Lib/epython.py || die |
870 |
-} |
871 |
- |
872 |
-src_compile() { |
873 |
- # Ensure sed works as expected |
874 |
- # https://bugs.gentoo.org/594768 |
875 |
- local -x LC_ALL=C |
876 |
- # Prevent using distutils bundled by setuptools. |
877 |
- # https://bugs.gentoo.org/823728 |
878 |
- export SETUPTOOLS_USE_DISTUTILS=stdlib |
879 |
- export PYTHONSTRICTEXTENSIONBUILD=1 |
880 |
- |
881 |
- # Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't |
882 |
- # end up writing bytecode & violating sandbox. |
883 |
- # bug #831897 |
884 |
- local -x _PYTHONDONTWRITEBYTECODE=${PYTHONDONTWRITEBYTECODE} |
885 |
- |
886 |
- if use pgo ; then |
887 |
- # bug 660358 |
888 |
- local -x COLUMNS=80 |
889 |
- local -x PYTHONDONTWRITEBYTECODE= |
890 |
- |
891 |
- addpredict "/usr/lib/python${PYVER}/site-packages" |
892 |
- fi |
893 |
- |
894 |
- # also need to clear the flags explicitly here or they end up |
895 |
- # in _sysconfigdata* |
896 |
- emake CPPFLAGS= CFLAGS= LDFLAGS= |
897 |
- |
898 |
- # Restore saved value from above. |
899 |
- local -x PYTHONDONTWRITEBYTECODE=${_PYTHONDONTWRITEBYTECODE} |
900 |
- |
901 |
- # Work around bug 329499. See also bug 413751 and 457194. |
902 |
- if has_version dev-libs/libffi[pax-kernel]; then |
903 |
- pax-mark E python |
904 |
- else |
905 |
- pax-mark m python |
906 |
- fi |
907 |
-} |
908 |
- |
909 |
-src_test() { |
910 |
- # Tests will not work when cross compiling. |
911 |
- if tc-is-cross-compiler; then |
912 |
- elog "Disabling tests due to crosscompiling." |
913 |
- return |
914 |
- fi |
915 |
- |
916 |
- # this just happens to skip test_support.test_freeze that is broken |
917 |
- # without bundled expat |
918 |
- # TODO: get a proper skip for it upstream |
919 |
- local -x LOGNAME=buildbot |
920 |
- |
921 |
- local test_opts=( |
922 |
- -u-network |
923 |
- -j "$(makeopts_jobs)" |
924 |
- |
925 |
- # fails |
926 |
- -x test_gdb |
927 |
- ) |
928 |
- |
929 |
- if use sparc ; then |
930 |
- # bug #788022 |
931 |
- test_opts+=( |
932 |
- -x test_multiprocessing_fork |
933 |
- -x test_multiprocessing_forkserver |
934 |
- ) |
935 |
- fi |
936 |
- |
937 |
- # workaround docutils breaking tests |
938 |
- cat > Lib/docutils.py <<-EOF || die |
939 |
- raise ImportError("Thou shalt not import!") |
940 |
- EOF |
941 |
- |
942 |
- # bug 660358 |
943 |
- local -x COLUMNS=80 |
944 |
- local -x PYTHONDONTWRITEBYTECODE= |
945 |
- # workaround https://bugs.gentoo.org/775416 |
946 |
- addwrite "/usr/lib/python${PYVER}/site-packages" |
947 |
- |
948 |
- nonfatal emake test EXTRATESTOPTS="${test_opts[*]}" \ |
949 |
- CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty |
950 |
- local ret=${?} |
951 |
- |
952 |
- rm Lib/docutils.py || die |
953 |
- |
954 |
- [[ ${ret} -eq 0 ]] || die "emake test failed" |
955 |
-} |
956 |
- |
957 |
-src_install() { |
958 |
- local libdir=${ED}/usr/lib/python${PYVER} |
959 |
- |
960 |
- # -j1 hack for now for bug #843458 |
961 |
- emake -j1 DESTDIR="${D}" altinstall |
962 |
- |
963 |
- # Fix collisions between different slots of Python. |
964 |
- rm "${ED}/usr/$(get_libdir)/libpython3.so" || die |
965 |
- |
966 |
- # Cheap hack to get version with ABIFLAGS |
967 |
- local abiver=$(cd "${ED}/usr/include"; echo python*) |
968 |
- if [[ ${abiver} != python${PYVER} ]]; then |
969 |
- # Replace python3.X with a symlink to python3.Xm |
970 |
- rm "${ED}/usr/bin/python${PYVER}" || die |
971 |
- dosym "${abiver}" "/usr/bin/python${PYVER}" |
972 |
- # Create python3.X-config symlink |
973 |
- dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" |
974 |
- # Create python-3.5m.pc symlink |
975 |
- dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" |
976 |
- fi |
977 |
- |
978 |
- # python seems to get rebuilt in src_install (bug 569908) |
979 |
- # Work around it for now. |
980 |
- if has_version dev-libs/libffi[pax-kernel]; then |
981 |
- pax-mark E "${ED}/usr/bin/${abiver}" |
982 |
- else |
983 |
- pax-mark m "${ED}/usr/bin/${abiver}" |
984 |
- fi |
985 |
- |
986 |
- rm -r "${libdir}"/ensurepip/_bundled || die |
987 |
- if ! use ensurepip; then |
988 |
- rm -r "${libdir}"/ensurepip || die |
989 |
- fi |
990 |
- if ! use sqlite; then |
991 |
- rm -r "${libdir}/"sqlite3 || die |
992 |
- fi |
993 |
- if ! use tk; then |
994 |
- rm -r "${ED}/usr/bin/idle${PYVER}" || die |
995 |
- rm -r "${libdir}/"{idlelib,tkinter,test/test_tk*} || die |
996 |
- fi |
997 |
- |
998 |
- ln -s ../python/EXTERNALLY-MANAGED "${libdir}/EXTERNALLY-MANAGED" || die |
999 |
- |
1000 |
- dodoc Misc/{ACKS,HISTORY,NEWS} |
1001 |
- |
1002 |
- if use examples; then |
1003 |
- docinto examples |
1004 |
- find Tools -name __pycache__ -exec rm -fr {} + || die |
1005 |
- dodoc -r Tools |
1006 |
- fi |
1007 |
- insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 |
1008 |
- local libname=$( |
1009 |
- printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | |
1010 |
- emake --no-print-directory -s -f - 2>/dev/null |
1011 |
- ) |
1012 |
- newins Tools/gdb/libpython.py "${libname}"-gdb.py |
1013 |
- |
1014 |
- newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER} |
1015 |
- newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER} |
1016 |
- sed \ |
1017 |
- -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \ |
1018 |
- -e "s:@PYDOC@:pydoc${PYVER}:" \ |
1019 |
- -i "${ED}/etc/conf.d/pydoc-${PYVER}" \ |
1020 |
- "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed" |
1021 |
- |
1022 |
- # python-exec wrapping support |
1023 |
- local pymajor=${PYVER%.*} |
1024 |
- local EPYTHON=python${PYVER} |
1025 |
- local scriptdir=${D}$(python_get_scriptdir) |
1026 |
- mkdir -p "${scriptdir}" || die |
1027 |
- # python and pythonX |
1028 |
- ln -s "../../../bin/${abiver}" "${scriptdir}/python${pymajor}" || die |
1029 |
- ln -s "python${pymajor}" "${scriptdir}/python" || die |
1030 |
- # python-config and pythonX-config |
1031 |
- # note: we need to create a wrapper rather than symlinking it due |
1032 |
- # to some random dirname(argv[0]) magic performed by python-config |
1033 |
- cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die |
1034 |
- #!/bin/sh |
1035 |
- exec "${abiver}-config" "\${@}" |
1036 |
- EOF |
1037 |
- chmod +x "${scriptdir}/python${pymajor}-config" || die |
1038 |
- ln -s "python${pymajor}-config" "${scriptdir}/python-config" || die |
1039 |
- # 2to3, pydoc |
1040 |
- ln -s "../../../bin/2to3-${PYVER}" "${scriptdir}/2to3" || die |
1041 |
- ln -s "../../../bin/pydoc${PYVER}" "${scriptdir}/pydoc" || die |
1042 |
- # idle |
1043 |
- if use tk; then |
1044 |
- ln -s "../../../bin/idle${PYVER}" "${scriptdir}/idle" || die |
1045 |
- fi |
1046 |
-} |
1047 |
- |
1048 |
-pkg_postinst() { |
1049 |
- local v |
1050 |
- for v in ${REPLACING_VERSIONS}; do |
1051 |
- if ver_test "${v}" -lt 3.11.0_beta4-r2; then |
1052 |
- ewarn "Python 3.11.0b4 has changed its module ABI. The .pyc files" |
1053 |
- ewarn "installed previously are no longer valid and will be regenerated" |
1054 |
- ewarn "(or ignored) on the next import. This may cause sandbox failures" |
1055 |
- ewarn "when installing some packages and checksum mismatches when removing" |
1056 |
- ewarn "old versions. To actively prevent this, rebuild all packages" |
1057 |
- ewarn "installing Python 3.11 modules, e.g. using:" |
1058 |
- ewarn |
1059 |
- ewarn " emerge -1v /usr/lib/python3.11/site-packages" |
1060 |
- fi |
1061 |
- done |
1062 |
-} |
1063 |
|
1064 |
diff --git a/dev-lang/python/python-3.9.16_p1.ebuild b/dev-lang/python/python-3.9.16_p1.ebuild |
1065 |
deleted file mode 100644 |
1066 |
index cf5ee9b..0000000 |
1067 |
--- a/dev-lang/python/python-3.9.16_p1.ebuild |
1068 |
+++ /dev/null |
1069 |
@@ -1,485 +0,0 @@ |
1070 |
-# Copyright 1999-2023 Gentoo Authors |
1071 |
-# Distributed under the terms of the GNU General Public License v2 |
1072 |
- |
1073 |
-EAPI="7" |
1074 |
-WANT_LIBTOOL="none" |
1075 |
- |
1076 |
-inherit autotools check-reqs flag-o-matic multiprocessing pax-utils |
1077 |
-inherit prefix python-utils-r1 toolchain-funcs verify-sig |
1078 |
- |
1079 |
-MY_PV=${PV/_rc/rc} |
1080 |
-MY_P="Python-${MY_PV%_p*}" |
1081 |
-PYVER=$(ver_cut 1-2) |
1082 |
-PATCHSET="python-gentoo-patches-${MY_PV}" |
1083 |
- |
1084 |
-DESCRIPTION="An interpreted, interactive, object-oriented programming language" |
1085 |
-HOMEPAGE=" |
1086 |
- https://www.python.org/ |
1087 |
- https://github.com/python/cpython/ |
1088 |
-" |
1089 |
-SRC_URI=" |
1090 |
- https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz |
1091 |
- https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz |
1092 |
- verify-sig? ( |
1093 |
- https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz.asc |
1094 |
- ) |
1095 |
-" |
1096 |
-S="${WORKDIR}/${MY_P}" |
1097 |
- |
1098 |
-LICENSE="PSF-2" |
1099 |
-SLOT="${PYVER}" |
1100 |
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" |
1101 |
-IUSE=" |
1102 |
- bluetooth build +ensurepip examples gdbm hardened lto +ncurses pgo |
1103 |
- +readline +sqlite +ssl test tk valgrind +xml |
1104 |
-" |
1105 |
-RESTRICT="!test? ( test )" |
1106 |
- |
1107 |
-# Do not add a dependency on dev-lang/python to this ebuild. |
1108 |
-# If you need to apply a patch which requires python for bootstrapping, please |
1109 |
-# run the bootstrap code on your dev box and include the results in the |
1110 |
-# patchset. See bug 447752. |
1111 |
- |
1112 |
-RDEPEND=" |
1113 |
- app-arch/bzip2:= |
1114 |
- app-arch/xz-utils:= |
1115 |
- dev-lang/python-exec[python_targets_python3_9(-)] |
1116 |
- dev-libs/libffi:= |
1117 |
- dev-python/gentoo-common |
1118 |
- sys-apps/util-linux:= |
1119 |
- >=sys-libs/zlib-1.1.3:= |
1120 |
- virtual/libcrypt:= |
1121 |
- virtual/libintl |
1122 |
- ensurepip? ( dev-python/ensurepip-wheels ) |
1123 |
- gdbm? ( sys-libs/gdbm:=[berkdb] ) |
1124 |
- ncurses? ( >=sys-libs/ncurses-5.2:= ) |
1125 |
- readline? ( >=sys-libs/readline-4.1:= ) |
1126 |
- sqlite? ( >=dev-db/sqlite-3.3.8:3= ) |
1127 |
- ssl? ( >=dev-libs/openssl-1.1.1:= ) |
1128 |
- tk? ( |
1129 |
- >=dev-lang/tcl-8.0:= |
1130 |
- >=dev-lang/tk-8.0:= |
1131 |
- dev-tcltk/blt:= |
1132 |
- dev-tcltk/tix |
1133 |
- ) |
1134 |
- xml? ( >=dev-libs/expat-2.1:= ) |
1135 |
-" |
1136 |
-# bluetooth requires headers from bluez |
1137 |
-DEPEND=" |
1138 |
- ${RDEPEND} |
1139 |
- bluetooth? ( net-wireless/bluez ) |
1140 |
- test? ( app-arch/xz-utils[extra-filters(+)] ) |
1141 |
- valgrind? ( dev-util/valgrind ) |
1142 |
-" |
1143 |
-# autoconf-archive needed to eautoreconf |
1144 |
-BDEPEND=" |
1145 |
- sys-devel/autoconf-archive |
1146 |
- app-alternatives/awk |
1147 |
- virtual/pkgconfig |
1148 |
- verify-sig? ( sec-keys/openpgp-keys-python ) |
1149 |
-" |
1150 |
-RDEPEND+=" |
1151 |
- !build? ( app-misc/mime-types ) |
1152 |
-" |
1153 |
- |
1154 |
-VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc |
1155 |
- |
1156 |
-# large file tests involve a 2.5G file being copied (duplicated) |
1157 |
-CHECKREQS_DISK_BUILD=5500M |
1158 |
- |
1159 |
-QA_PKGCONFIG_VERSION=${PYVER} |
1160 |
- |
1161 |
-pkg_pretend() { |
1162 |
- use test && check-reqs_pkg_pretend |
1163 |
-} |
1164 |
- |
1165 |
-pkg_setup() { |
1166 |
- use test && check-reqs_pkg_setup |
1167 |
-} |
1168 |
- |
1169 |
-src_unpack() { |
1170 |
- if use verify-sig; then |
1171 |
- verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc} |
1172 |
- fi |
1173 |
- default |
1174 |
-} |
1175 |
- |
1176 |
-src_prepare() { |
1177 |
- # Ensure that internal copies of expat and libffi are not used. |
1178 |
- rm -r Modules/expat || die |
1179 |
- rm -r Modules/_ctypes/libffi* || die |
1180 |
- |
1181 |
- # Causes runtime issues with libressl |
1182 |
- rm "${WORKDIR}/${PATCHSET}"/0013-bpo-43998-Default-to-TLS-1.2-and-increase-cipher-sui.patch || die |
1183 |
- |
1184 |
- local PATCHES=( |
1185 |
- "${WORKDIR}/${PATCHSET}" |
1186 |
- "${FILESDIR}"/${PN}-3.9.9-r1-libressl.patch |
1187 |
- ) |
1188 |
- |
1189 |
- default |
1190 |
- |
1191 |
- # https://bugs.gentoo.org/850151 |
1192 |
- sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" setup.py || die |
1193 |
- |
1194 |
- # force the correct number of jobs |
1195 |
- # https://bugs.gentoo.org/737660 |
1196 |
- local jobs=$(makeopts_jobs) |
1197 |
- sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die |
1198 |
- sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die |
1199 |
- |
1200 |
- eautoreconf |
1201 |
-} |
1202 |
- |
1203 |
-src_configure() { |
1204 |
- # disable automagic bluetooth headers detection |
1205 |
- if ! use bluetooth; then |
1206 |
- local -x ac_cv_header_bluetooth_bluetooth_h=no |
1207 |
- fi |
1208 |
- local disable |
1209 |
- use gdbm || disable+=" gdbm" |
1210 |
- use ncurses || disable+=" _curses _curses_panel" |
1211 |
- use readline || disable+=" readline" |
1212 |
- use sqlite || disable+=" _sqlite3" |
1213 |
- use ssl || export PYTHON_DISABLE_SSL="1" |
1214 |
- use tk || disable+=" _tkinter" |
1215 |
- use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. |
1216 |
- export PYTHON_DISABLE_MODULES="${disable}" |
1217 |
- |
1218 |
- if ! use xml; then |
1219 |
- ewarn "You have configured Python without XML support." |
1220 |
- ewarn "This is NOT a recommended configuration as you" |
1221 |
- ewarn "may face problems parsing any XML documents." |
1222 |
- fi |
1223 |
- |
1224 |
- if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then |
1225 |
- einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" |
1226 |
- fi |
1227 |
- |
1228 |
- append-flags -fwrapv |
1229 |
- filter-flags -malign-double |
1230 |
- |
1231 |
- # https://bugs.gentoo.org/700012 |
1232 |
- if is-flagq -flto || is-flagq '-flto=*'; then |
1233 |
- append-cflags $(test-flags-CC -ffat-lto-objects) |
1234 |
- fi |
1235 |
- |
1236 |
- # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. |
1237 |
- # PKG_CONFIG needed for cross. |
1238 |
- tc-export CXX PKG_CONFIG |
1239 |
- |
1240 |
- local dbmliborder= |
1241 |
- if use gdbm; then |
1242 |
- dbmliborder+="${dbmliborder:+:}gdbm" |
1243 |
- fi |
1244 |
- |
1245 |
- if use pgo; then |
1246 |
- local profile_task_flags=( |
1247 |
- -m test |
1248 |
- "-j$(makeopts_jobs)" |
1249 |
- --pgo-extended |
1250 |
- -x test_gdb |
1251 |
- -u-network |
1252 |
- |
1253 |
- # All of these seem to occasionally hang for PGO inconsistently |
1254 |
- # They'll even hang here but be fine in src_test sometimes. |
1255 |
- # bug #828535 (and related: bug #788022) |
1256 |
- -x test_asyncio |
1257 |
- -x test_httpservers |
1258 |
- -x test_logging |
1259 |
- -x test_multiprocessing_fork |
1260 |
- -x test_socket |
1261 |
- -x test_xmlrpc |
1262 |
- ) |
1263 |
- |
1264 |
- if has_version "app-arch/rpm" ; then |
1265 |
- # Avoid sandbox failure (attempts to write to /var/lib/rpm) |
1266 |
- profile_task_flags+=( |
1267 |
- -x test_distutils |
1268 |
- ) |
1269 |
- fi |
1270 |
- local -x PROFILE_TASK="${profile_task_flags[*]}" |
1271 |
- fi |
1272 |
- |
1273 |
- local myeconfargs=( |
1274 |
- # glibc-2.30 removes it; since we can't cleanly force-rebuild |
1275 |
- # Python on glibc upgrade, remove it proactively to give |
1276 |
- # a chance for users rebuilding python before glibc |
1277 |
- ac_cv_header_stropts_h=no |
1278 |
- |
1279 |
- --enable-shared |
1280 |
- --enable-ipv6 |
1281 |
- --infodir='${prefix}/share/info' |
1282 |
- --mandir='${prefix}/share/man' |
1283 |
- --with-computed-gotos |
1284 |
- --with-dbmliborder="${dbmliborder}" |
1285 |
- --with-libc= |
1286 |
- --enable-loadable-sqlite-extensions |
1287 |
- --without-ensurepip |
1288 |
- --with-system-expat |
1289 |
- --with-system-ffi |
1290 |
- --with-wheel-pkg-dir="${EPREFIX}"/usr/lib/python/ensurepip |
1291 |
- |
1292 |
- $(use_with lto) |
1293 |
- $(use_enable pgo optimizations) |
1294 |
- $(use_with valgrind) |
1295 |
- ) |
1296 |
- |
1297 |
- # disable implicit optimization/debugging flags |
1298 |
- local -x OPT= |
1299 |
- |
1300 |
- if tc-is-cross-compiler ; then |
1301 |
- # Hack to workaround get_libdir not being able to handle CBUILD, bug #794181 |
1302 |
- local cbuild_libdir=$(unset PKG_CONFIG_PATH ; $(tc-getBUILD_PKG_CONFIG) --keep-system-libs --libs-only-L libffi) |
1303 |
- |
1304 |
- # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get |
1305 |
- # propagated to sysconfig for built extensions |
1306 |
- local -x CFLAGS_NODIST=${CFLAGS_FOR_BUILD} |
1307 |
- local -x LDFLAGS_NODIST=${LDFLAGS_FOR_BUILD} |
1308 |
- local -x CFLAGS= LDFLAGS= |
1309 |
- |
1310 |
- # We need to build our own Python on CBUILD first, and feed it in. |
1311 |
- # bug #847910 and bug #864911. |
1312 |
- local myeconfargs_cbuild=( |
1313 |
- "${myeconfargs[@]}" |
1314 |
- |
1315 |
- --libdir="${cbuild_libdir:2}" |
1316 |
- |
1317 |
- # Avoid needing to load the right libpython.so. |
1318 |
- --disable-shared |
1319 |
- |
1320 |
- # As minimal as possible for the mini CBUILD Python |
1321 |
- # we build just for cross. |
1322 |
- --without-lto |
1323 |
- --disable-optimizations |
1324 |
- ) |
1325 |
- |
1326 |
- # Point the imminent CHOST build to the Python we just |
1327 |
- # built for CBUILD. |
1328 |
- export PATH="${WORKDIR}/${P}-${CBUILD}:${PATH}" |
1329 |
- |
1330 |
- mkdir "${WORKDIR}"/${P}-${CBUILD} || die |
1331 |
- pushd "${WORKDIR}"/${P}-${CBUILD} &> /dev/null || die |
1332 |
- # We disable _ctypes and _crypt for CBUILD because Python's setup.py can't handle locating |
1333 |
- # libdir correctly for cross. |
1334 |
- PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _ctypes _crypt" \ |
1335 |
- ECONF_SOURCE="${S}" econf_build "${myeconfargs_cbuild[@]}" |
1336 |
- |
1337 |
- # Avoid as many dependencies as possible for the cross build. |
1338 |
- cat >> Makefile <<-EOF || die |
1339 |
- MODULE_NIS=disabled |
1340 |
- MODULE__DBM=disabled |
1341 |
- MODULE__GDBM=disabled |
1342 |
- MODULE__DBM=disabled |
1343 |
- MODULE__SQLITE3=disabled |
1344 |
- MODULE__HASHLIB=disabled |
1345 |
- MODULE__SSL=disabled |
1346 |
- MODULE__CURSES=disabled |
1347 |
- MODULE__CURSES_PANEL=disabled |
1348 |
- MODULE_READLINE=disabled |
1349 |
- MODULE__TKINTER=disabled |
1350 |
- MODULE_PYEXPAT=disabled |
1351 |
- MODULE_ZLIB=disabled |
1352 |
- EOF |
1353 |
- |
1354 |
- # Unfortunately, we do have to build this immediately, and |
1355 |
- # not in src_compile, because CHOST configure for Python |
1356 |
- # will check the existence of the Python it was pointed to |
1357 |
- # immediately. |
1358 |
- PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _ctypes _crypt" emake |
1359 |
- popd &> /dev/null || die |
1360 |
- fi |
1361 |
- |
1362 |
- # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get |
1363 |
- # propagated to sysconfig for built extensions |
1364 |
- local -x CFLAGS_NODIST=${CFLAGS} |
1365 |
- local -x LDFLAGS_NODIST=${LDFLAGS} |
1366 |
- local -x CFLAGS= LDFLAGS= |
1367 |
- |
1368 |
- # Fix implicit declarations on cross and prefix builds. Bug #674070. |
1369 |
- if use ncurses; then |
1370 |
- append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw |
1371 |
- fi |
1372 |
- |
1373 |
- hprefixify setup.py |
1374 |
- econf "${myeconfargs[@]}" |
1375 |
- |
1376 |
- if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then |
1377 |
- eerror "configure has detected that the sem_open function is broken." |
1378 |
- eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." |
1379 |
- die "Broken sem_open function (bug 496328)" |
1380 |
- fi |
1381 |
- |
1382 |
- # install epython.py as part of stdlib |
1383 |
- echo "EPYTHON='python${PYVER}'" > Lib/epython.py || die |
1384 |
-} |
1385 |
- |
1386 |
-src_compile() { |
1387 |
- # Ensure sed works as expected |
1388 |
- # https://bugs.gentoo.org/594768 |
1389 |
- local -x LC_ALL=C |
1390 |
- # Prevent using distutils bundled by setuptools. |
1391 |
- # https://bugs.gentoo.org/823728 |
1392 |
- export SETUPTOOLS_USE_DISTUTILS=stdlib |
1393 |
- |
1394 |
- # Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't |
1395 |
- # end up writing bytecode & violating sandbox. |
1396 |
- # bug #831897 |
1397 |
- local -x _PYTHONDONTWRITEBYTECODE=${PYTHONDONTWRITEBYTECODE} |
1398 |
- |
1399 |
- if use pgo ; then |
1400 |
- # bug 660358 |
1401 |
- local -x COLUMNS=80 |
1402 |
- local -x PYTHONDONTWRITEBYTECODE= |
1403 |
- |
1404 |
- addpredict "/usr/lib/python${PYVER}/site-packages" |
1405 |
- fi |
1406 |
- |
1407 |
- # also need to clear the flags explicitly here or they end up |
1408 |
- # in _sysconfigdata* |
1409 |
- emake CPPFLAGS= CFLAGS= LDFLAGS= |
1410 |
- |
1411 |
- # Restore saved value from above. |
1412 |
- local -x PYTHONDONTWRITEBYTECODE=${_PYTHONDONTWRITEBYTECODE} |
1413 |
- |
1414 |
- # Work around bug 329499. See also bug 413751 and 457194. |
1415 |
- if has_version dev-libs/libffi[pax-kernel]; then |
1416 |
- pax-mark E python |
1417 |
- else |
1418 |
- pax-mark m python |
1419 |
- fi |
1420 |
-} |
1421 |
- |
1422 |
-src_test() { |
1423 |
- # Tests will not work when cross compiling. |
1424 |
- if tc-is-cross-compiler; then |
1425 |
- elog "Disabling tests due to crosscompiling." |
1426 |
- return |
1427 |
- fi |
1428 |
- |
1429 |
- local test_opts=( |
1430 |
- -u-network |
1431 |
- -j "$(makeopts_jobs)" |
1432 |
- |
1433 |
- # fails |
1434 |
- -x test_gdb |
1435 |
- ) |
1436 |
- |
1437 |
- if use sparc ; then |
1438 |
- # bug #788022 |
1439 |
- test_opts+=( |
1440 |
- -x test_multiprocessing_fork |
1441 |
- -x test_multiprocessing_forkserver |
1442 |
- ) |
1443 |
- fi |
1444 |
- |
1445 |
- # workaround docutils breaking tests |
1446 |
- cat > Lib/docutils.py <<-EOF || die |
1447 |
- raise ImportError("Thou shalt not import!") |
1448 |
- EOF |
1449 |
- |
1450 |
- # bug 660358 |
1451 |
- local -x COLUMNS=80 |
1452 |
- local -x PYTHONDONTWRITEBYTECODE= |
1453 |
- |
1454 |
- nonfatal emake test EXTRATESTOPTS="${test_opts[*]}" \ |
1455 |
- CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty |
1456 |
- local ret=${?} |
1457 |
- |
1458 |
- rm Lib/docutils.py || die |
1459 |
- |
1460 |
- [[ ${ret} -eq 0 ]] || die "emake test failed" |
1461 |
-} |
1462 |
- |
1463 |
-src_install() { |
1464 |
- local libdir=${ED}/usr/lib/python${PYVER} |
1465 |
- |
1466 |
- emake DESTDIR="${D}" altinstall |
1467 |
- |
1468 |
- # Remove static library |
1469 |
- rm "${ED}"/usr/$(get_libdir)/libpython*.a || die |
1470 |
- |
1471 |
- # Fix collisions between different slots of Python. |
1472 |
- rm "${ED}/usr/$(get_libdir)/libpython3.so" || die |
1473 |
- |
1474 |
- # Cheap hack to get version with ABIFLAGS |
1475 |
- local abiver=$(cd "${ED}/usr/include"; echo python*) |
1476 |
- if [[ ${abiver} != python${PYVER} ]]; then |
1477 |
- # Replace python3.X with a symlink to python3.Xm |
1478 |
- rm "${ED}/usr/bin/python${PYVER}" || die |
1479 |
- dosym "${abiver}" "/usr/bin/python${PYVER}" |
1480 |
- # Create python3.X-config symlink |
1481 |
- dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" |
1482 |
- # Create python-3.5m.pc symlink |
1483 |
- dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" |
1484 |
- fi |
1485 |
- |
1486 |
- # python seems to get rebuilt in src_install (bug 569908) |
1487 |
- # Work around it for now. |
1488 |
- if has_version dev-libs/libffi[pax-kernel]; then |
1489 |
- pax-mark E "${ED}/usr/bin/${abiver}" |
1490 |
- else |
1491 |
- pax-mark m "${ED}/usr/bin/${abiver}" |
1492 |
- fi |
1493 |
- |
1494 |
- rm -r "${libdir}"/ensurepip/_bundled || die |
1495 |
- if ! use ensurepip; then |
1496 |
- rm -r "${libdir}"/ensurepip || die |
1497 |
- fi |
1498 |
- if ! use sqlite; then |
1499 |
- rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die |
1500 |
- fi |
1501 |
- if ! use tk; then |
1502 |
- rm -r "${ED}/usr/bin/idle${PYVER}" || die |
1503 |
- rm -r "${libdir}/"{idlelib,tkinter,test/test_tk*} || die |
1504 |
- fi |
1505 |
- |
1506 |
- ln -s ../python/EXTERNALLY-MANAGED "${libdir}/EXTERNALLY-MANAGED" || die |
1507 |
- |
1508 |
- dodoc Misc/{ACKS,HISTORY,NEWS} |
1509 |
- |
1510 |
- if use examples; then |
1511 |
- docinto examples |
1512 |
- find Tools -name __pycache__ -exec rm -fr {} + || die |
1513 |
- dodoc -r Tools |
1514 |
- fi |
1515 |
- insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 |
1516 |
- local libname=$( |
1517 |
- printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | |
1518 |
- emake --no-print-directory -s -f - 2>/dev/null |
1519 |
- ) |
1520 |
- newins Tools/gdb/libpython.py "${libname}"-gdb.py |
1521 |
- |
1522 |
- newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER} |
1523 |
- newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER} |
1524 |
- sed \ |
1525 |
- -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \ |
1526 |
- -e "s:@PYDOC@:pydoc${PYVER}:" \ |
1527 |
- -i "${ED}/etc/conf.d/pydoc-${PYVER}" \ |
1528 |
- "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed" |
1529 |
- |
1530 |
- # python-exec wrapping support |
1531 |
- local pymajor=${PYVER%.*} |
1532 |
- local EPYTHON=python${PYVER} |
1533 |
- local scriptdir=${D}$(python_get_scriptdir) |
1534 |
- mkdir -p "${scriptdir}" || die |
1535 |
- # python and pythonX |
1536 |
- ln -s "../../../bin/${abiver}" "${scriptdir}/python${pymajor}" || die |
1537 |
- ln -s "python${pymajor}" "${scriptdir}/python" || die |
1538 |
- # python-config and pythonX-config |
1539 |
- # note: we need to create a wrapper rather than symlinking it due |
1540 |
- # to some random dirname(argv[0]) magic performed by python-config |
1541 |
- cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die |
1542 |
- #!/bin/sh |
1543 |
- exec "${abiver}-config" "\${@}" |
1544 |
- EOF |
1545 |
- chmod +x "${scriptdir}/python${pymajor}-config" || die |
1546 |
- ln -s "python${pymajor}-config" "${scriptdir}/python-config" || die |
1547 |
- # 2to3, pydoc |
1548 |
- ln -s "../../../bin/2to3-${PYVER}" "${scriptdir}/2to3" || die |
1549 |
- ln -s "../../../bin/pydoc${PYVER}" "${scriptdir}/pydoc" || die |
1550 |
- # idle |
1551 |
- if use tk; then |
1552 |
- ln -s "../../../bin/idle${PYVER}" "${scriptdir}/idle" || die |
1553 |
- fi |
1554 |
-} |