1 |
commit: 80f7f7c3791f59bc1fab83e0addc47113e25d774 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Sep 6 18:07:35 2022 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Sep 6 18:15:48 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=80f7f7c3 |
7 |
|
8 |
dev-lang/python: Bump 3.10.7 |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
dev-lang/python/Manifest | 3 + |
13 |
dev-lang/python/python-3.10.7.ebuild | 407 +++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 410 insertions(+) |
15 |
|
16 |
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest |
17 |
index 0df801ec94a8..b01dec30e4ec 100644 |
18 |
--- a/dev-lang/python/Manifest |
19 |
+++ b/dev-lang/python/Manifest |
20 |
@@ -2,6 +2,8 @@ DIST Python-2.7.18.tar.xz 12854736 BLAKE2B 060a621c91dd8e3d321aec99d44c17aa67381 |
21 |
DIST Python-2.7.18.tar.xz.asc 833 BLAKE2B 1d98770e46171971fb99994508d238c01d2755281d2f94353314014d9e83e0ec5f0b3e3950ea1fdf5fce9ba6b8f55312355845c2a3fc4291c27ee56fe6215448 SHA512 c2a5f5a52f47dec52460ad3275758d4e5de6e7075c3def4353c988d74d563a39b42cae2d5eb24e2a23a6247cef69100f91620b11a49c2359fbf99b203c9cbda8 |
22 |
DIST Python-3.10.6.tar.xz 19600672 BLAKE2B b21398f68e13cf8464077aa2c7f08d9044198cc3d2e2829d12239d420c1c922cbad8427f3e0fae3fe62a4b8ebb7db7eff441266eff82f0c78d7a98a62d8e64c3 SHA512 f2bf424bf4f4caa524ee1248b431e8e06d0745c3fc3ba457710d75f3698e653733feb4b059cd124f1de2a9e851c30d847f567aa47abef12898c9dc8a6507b476 |
23 |
DIST Python-3.10.6.tar.xz.asc 833 BLAKE2B ea6546c01a4fbfe3f3e56b2f980da53f0692d9c638534bd25fb96a0f657424f979b6a82a01c77c05ddfded30441b4a0348cc407d5b29290ffc653a508ca32ec8 SHA512 9288e2f62f2e8c8208ad176372261545a64e675d737bb616403bcd888bc91177909257632e4cc0b5d688d612bea38a274030ec6989dc7d56c03064e32ad9903e |
24 |
+DIST Python-3.10.7.tar.xz 19618696 BLAKE2B 45e38e8b8a87ea5c041998a9be5e8fb25c2b57c1f26823833518b06bbf8795b30256fae71ff2175ec53e7af51bf383e6f5109d8fabe370e4aa5f6fc61821c889 SHA512 dc3432d72ee7382617318c9645204876d13bb61d4caf3fbbb65e6b14897261123c743049657c95e159e5566daf4dcde613d2e393f025de758f610b44eb958313 |
25 |
+DIST Python-3.10.7.tar.xz.asc 833 BLAKE2B 201ef40872ac8dc8886128b98fc13a0b14ab80db03ec467933fef0356f4a8728679eb77ae1044c51653cf3bd81e93f0a00f59c6f852e75499af95b34f2d6607d SHA512 a65d152d87870de763de3384a1c0ff0309068a2af0fcdfa39a6f968a52b59c56229553cf6a955ec0af1d3db5bf4641c4e91d6150764548d2e9fb0e9a01ab759d |
26 |
DIST Python-3.11.0rc1.tar.xz 19815524 BLAKE2B 7dae240dbed052667b46927ccbb483a717b0fe0ba199721d526354d1b89a6dd2842ab0f6c3b078385e4acb7557d06f252d61aacb07d70c7f5598ed91567d2053 SHA512 2a72ea59277f8115e418ced671969fc0d5ba271c7740f70c665a4b450a59d7752278d061bd59f136dacfa608ed167f983c6589b214a973b1b63ea2115ea298bb |
27 |
DIST Python-3.11.0rc1.tar.xz.asc 833 BLAKE2B da46a0ab62ef3f2b7a7921294a0d775ca6ab254e3229338232b3d11107aa1d74adc21911678f08f44cc1cd9184beada00d4b60dde60722ef91a247367b13e191 SHA512 d4cffc90c2ed7b8ea7228a21f7ac902a92f27003f1420ad751b1691de950974ea174cb0471b6e19ed1548dc5382012fa9ad5fcf83c34646c7ea2d73c88799e38 |
28 |
DIST Python-3.8.13.tar.xz 19023016 BLAKE2B d3cb8624496e56d93d34f2aa5082746869a99210197529bc19e6a9d265f4ce246e0e83a3528a7602a28aac8855bf84e6bf6495b85e9202fcf04ef90600cb5e43 SHA512 5c732b5d21b189b99a0e9ccd3ae59466bed60a930d5d3f437a262d38f0797b776cecbf12a1852eaebcfb638a6f2e28e471cc2ebf94237cc728144be21842cb81 |
29 |
@@ -12,6 +14,7 @@ DIST python-gentoo-patches-2.7.18_p15.tar.xz 34956 BLAKE2B d173f276dd9c0ce31004d |
30 |
DIST python-gentoo-patches-3.10.6_p2.tar.xz 12040 BLAKE2B 75c93fab19137a966b3775308bc20142f4d3648bbb9364e82c4eaffae93beda54011192881c52b85d2e2493a06cfe2a90f50675609908c3d5ebdb0103fe41644 SHA512 7e451a8a18a62592c2cd7b2db71065b77256960f43e172a0d7856b22b69138dcb1552f53b39bec14585a761cfe729c81613551c1b616fe1ec8d2b59856b11453 |
31 |
DIST python-gentoo-patches-3.10.6_p3.tar.xz 26712 BLAKE2B 701a7a4da1a09f71dee8fdf924a45e030b8ae93e469a2789b28b904d2fd6b011589fb940eb0c262e8b19005af523a2f66075d053fb60892d6ebd473159fce718 SHA512 ed43ba18735ddf72c434bfe905894d156a144a77f9fb8266378d384e840b376c6220859d8d1af83f304293368bf1dd45881316c1797ba25d618a064daaacab17 |
32 |
DIST python-gentoo-patches-3.10.6_p4.tar.xz 28612 BLAKE2B 197ef33c3086cb9efaf09868145826e2889f61d6fb207df8b60ac6cfc4ca637c8a87fd10afa2d8a7a47ae81bcf0ae589085c694523e1ca6f85acdc4e517b7d07 SHA512 8bd0aa8f7a775d12914d542dbb04c7b555055228002dd826a815255d4a35392e09c44d560cc5da7df1feae98e2f73e8fbf476e2811ae5269f91120c11cbb6291 |
33 |
+DIST python-gentoo-patches-3.10.7.tar.xz 12040 BLAKE2B fcbf07894376fff4145534d592c97a5be6b361e9754c548ae483a388916acca8e7ff6c6cab1344d36af52974166590c82bf548e681401a6d2e5604f3e4ae9e23 SHA512 d67e16fc19afed997ac383284afa08fc079cf8128b457a8a5d15218ae7d6718f81e88bed60207f10318fa7ce7a415d0645655b5610d7b2087383fbd07d0ef2c6 |
34 |
DIST python-gentoo-patches-3.11.0rc1.tar.xz 4384 BLAKE2B 31bcdc055bfaf3434dbb02543aaf66910eaccd01808d9a0e57bf7cb3b097fc0046c00ac44737d9c37e3b6d074c524f4dd3ab439a741e66d74a0425889ecaead5 SHA512 05b044e2d8f881c471528600ee300bfd9cf5160609dfb3d7cbdb8e43f47b681542582a85de97e28e6a3b89a3fb6c8d7398e029d31e20cea9c5a2a71700382d4e |
35 |
DIST python-gentoo-patches-3.11.0rc1_p1.tar.xz 19584 BLAKE2B 33c87e2e7141fa5cdf343df8cf30e8e0bd37fdfc7b4d84564b1131c57db27b5886184fd1291b2a898efafec60da5c01d16dce8b3c8792df7df15793d767d74cd SHA512 dc5547622a17bc899dfa7f55a4705f780fd3b731ccdb2c0a87e3d71b4490a32b54683ff862f412e2ac3480f0e84acf2e88176ecf89a8d62b97454e51258696ea |
36 |
DIST python-gentoo-patches-3.11.0rc1_p2.tar.xz 21580 BLAKE2B 188a3b2e5bc0d067dac20a7d5bfe3149eeac062bdb29972b0d0a8b24238aa21eb2f2a797b57f6ded80cb85d255f6cc1e6336d57c3e5f43d2b8aa890e7d35ef50 SHA512 fbc740b7e8161d4878cc91d9ee66026ae51082f2b18d77dc40167bfab4891e7b811fa4920ddf5c5a27d8ddc84a0220ccb1b3612744818084da321188ada09563 |
37 |
|
38 |
diff --git a/dev-lang/python/python-3.10.7.ebuild b/dev-lang/python/python-3.10.7.ebuild |
39 |
new file mode 100644 |
40 |
index 000000000000..b919f0692412 |
41 |
--- /dev/null |
42 |
+++ b/dev-lang/python/python-3.10.7.ebuild |
43 |
@@ -0,0 +1,407 @@ |
44 |
+# Copyright 1999-2022 Gentoo Authors |
45 |
+# Distributed under the terms of the GNU General Public License v2 |
46 |
+ |
47 |
+EAPI="7" |
48 |
+WANT_LIBTOOL="none" |
49 |
+ |
50 |
+inherit autotools check-reqs flag-o-matic multiprocessing pax-utils |
51 |
+inherit python-utils-r1 toolchain-funcs verify-sig |
52 |
+ |
53 |
+MY_PV=${PV/_rc/rc} |
54 |
+MY_P="Python-${MY_PV%_p*}" |
55 |
+PYVER=$(ver_cut 1-2) |
56 |
+PATCHSET="python-gentoo-patches-${MY_PV}" |
57 |
+ |
58 |
+DESCRIPTION="An interpreted, interactive, object-oriented programming language" |
59 |
+HOMEPAGE=" |
60 |
+ https://www.python.org/ |
61 |
+ https://github.com/python/cpython/ |
62 |
+" |
63 |
+SRC_URI=" |
64 |
+ https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz |
65 |
+ https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz |
66 |
+ verify-sig? ( |
67 |
+ https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz.asc |
68 |
+ ) |
69 |
+" |
70 |
+S="${WORKDIR}/${MY_P}" |
71 |
+ |
72 |
+LICENSE="PSF-2" |
73 |
+SLOT="${PYVER}" |
74 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" |
75 |
+IUSE=" |
76 |
+ bluetooth build +ensurepip examples gdbm hardened libedit lto |
77 |
+ +ncurses pgo +readline +sqlite +ssl test tk +xml |
78 |
+" |
79 |
+RESTRICT="!test? ( test )" |
80 |
+ |
81 |
+# Do not add a dependency on dev-lang/python to this ebuild. |
82 |
+# If you need to apply a patch which requires python for bootstrapping, please |
83 |
+# run the bootstrap code on your dev box and include the results in the |
84 |
+# patchset. See bug 447752. |
85 |
+ |
86 |
+RDEPEND=" |
87 |
+ app-arch/bzip2:= |
88 |
+ app-arch/xz-utils:= |
89 |
+ dev-lang/python-exec[python_targets_python3_10(-)] |
90 |
+ dev-libs/libffi:= |
91 |
+ sys-apps/util-linux:= |
92 |
+ >=sys-libs/zlib-1.1.3:= |
93 |
+ virtual/libcrypt:= |
94 |
+ virtual/libintl |
95 |
+ ensurepip? ( dev-python/ensurepip-wheels ) |
96 |
+ gdbm? ( sys-libs/gdbm:=[berkdb] ) |
97 |
+ ncurses? ( >=sys-libs/ncurses-5.2:= ) |
98 |
+ readline? ( |
99 |
+ !libedit? ( >=sys-libs/readline-4.1:= ) |
100 |
+ libedit? ( dev-libs/libedit:= ) |
101 |
+ ) |
102 |
+ sqlite? ( >=dev-db/sqlite-3.3.8:3= ) |
103 |
+ ssl? ( >=dev-libs/openssl-1.1.1:= ) |
104 |
+ tk? ( |
105 |
+ >=dev-lang/tcl-8.0:= |
106 |
+ >=dev-lang/tk-8.0:= |
107 |
+ dev-tcltk/blt:= |
108 |
+ dev-tcltk/tix |
109 |
+ ) |
110 |
+ xml? ( >=dev-libs/expat-2.1:= ) |
111 |
+ !!<sys-apps/sandbox-2.21 |
112 |
+" |
113 |
+# bluetooth requires headers from bluez |
114 |
+DEPEND=" |
115 |
+ ${RDEPEND} |
116 |
+ bluetooth? ( net-wireless/bluez ) |
117 |
+ test? ( app-arch/xz-utils[extra-filters(+)] ) |
118 |
+" |
119 |
+# autoconf-archive needed to eautoreconf |
120 |
+BDEPEND=" |
121 |
+ sys-devel/autoconf-archive |
122 |
+ virtual/awk |
123 |
+ virtual/pkgconfig |
124 |
+ verify-sig? ( sec-keys/openpgp-keys-python ) |
125 |
+" |
126 |
+RDEPEND+=" |
127 |
+ !build? ( app-misc/mime-types ) |
128 |
+" |
129 |
+ |
130 |
+VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc |
131 |
+ |
132 |
+# large file tests involve a 2.5G file being copied (duplicated) |
133 |
+CHECKREQS_DISK_BUILD=5500M |
134 |
+ |
135 |
+QA_PKGCONFIG_VERSION=${PYVER} |
136 |
+ |
137 |
+pkg_pretend() { |
138 |
+ use test && check-reqs_pkg_pretend |
139 |
+} |
140 |
+ |
141 |
+pkg_setup() { |
142 |
+ use test && check-reqs_pkg_setup |
143 |
+} |
144 |
+ |
145 |
+src_unpack() { |
146 |
+ if use verify-sig; then |
147 |
+ verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc} |
148 |
+ fi |
149 |
+ default |
150 |
+} |
151 |
+ |
152 |
+src_prepare() { |
153 |
+ # Ensure that internal copies of expat and libffi are not used. |
154 |
+ rm -r Modules/expat || die |
155 |
+ rm -r Modules/_ctypes/libffi* || die |
156 |
+ |
157 |
+ local PATCHES=( |
158 |
+ "${WORKDIR}/${PATCHSET}" |
159 |
+ ) |
160 |
+ |
161 |
+ default |
162 |
+ |
163 |
+ # https://bugs.gentoo.org/850151 |
164 |
+ sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" setup.py || die |
165 |
+ |
166 |
+ # force the correct number of jobs |
167 |
+ # https://bugs.gentoo.org/737660 |
168 |
+ local jobs=$(makeopts_jobs) |
169 |
+ sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die |
170 |
+ sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die |
171 |
+ |
172 |
+ eautoreconf |
173 |
+} |
174 |
+ |
175 |
+src_configure() { |
176 |
+ # disable automagic bluetooth headers detection |
177 |
+ if ! use bluetooth; then |
178 |
+ local -x ac_cv_header_bluetooth_bluetooth_h=no |
179 |
+ fi |
180 |
+ local disable |
181 |
+ use gdbm || disable+=" gdbm" |
182 |
+ use ncurses || disable+=" _curses _curses_panel" |
183 |
+ use readline || disable+=" readline" |
184 |
+ use sqlite || disable+=" _sqlite3" |
185 |
+ use ssl || export PYTHON_DISABLE_SSL="1" |
186 |
+ use tk || disable+=" _tkinter" |
187 |
+ use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. |
188 |
+ export PYTHON_DISABLE_MODULES="${disable}" |
189 |
+ |
190 |
+ if ! use xml; then |
191 |
+ ewarn "You have configured Python without XML support." |
192 |
+ ewarn "This is NOT a recommended configuration as you" |
193 |
+ ewarn "may face problems parsing any XML documents." |
194 |
+ fi |
195 |
+ |
196 |
+ if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then |
197 |
+ einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" |
198 |
+ fi |
199 |
+ |
200 |
+ append-flags -fwrapv |
201 |
+ filter-flags -malign-double |
202 |
+ |
203 |
+ # https://bugs.gentoo.org/700012 |
204 |
+ if is-flagq -flto || is-flagq '-flto=*'; then |
205 |
+ append-cflags $(test-flags-CC -ffat-lto-objects) |
206 |
+ fi |
207 |
+ |
208 |
+ # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. |
209 |
+ # PKG_CONFIG needed for cross. |
210 |
+ tc-export CXX PKG_CONFIG |
211 |
+ |
212 |
+ # Fix implicit declarations on cross and prefix builds. Bug #674070. |
213 |
+ if use ncurses; then |
214 |
+ append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw |
215 |
+ fi |
216 |
+ |
217 |
+ local dbmliborder= |
218 |
+ if use gdbm; then |
219 |
+ dbmliborder+="${dbmliborder:+:}gdbm" |
220 |
+ fi |
221 |
+ |
222 |
+ if use pgo; then |
223 |
+ local profile_task_flags=( |
224 |
+ -m test |
225 |
+ "-j$(makeopts_jobs)" |
226 |
+ --pgo-extended |
227 |
+ -x test_gdb |
228 |
+ -u-network |
229 |
+ |
230 |
+ # All of these seem to occasionally hang for PGO inconsistently |
231 |
+ # They'll even hang here but be fine in src_test sometimes. |
232 |
+ # bug #828535 (and related: bug #788022) |
233 |
+ -x test_asyncio |
234 |
+ -x test_httpservers |
235 |
+ -x test_logging |
236 |
+ -x test_multiprocessing_fork |
237 |
+ -x test_socket |
238 |
+ -x test_xmlrpc |
239 |
+ ) |
240 |
+ |
241 |
+ if has_version "app-arch/rpm" ; then |
242 |
+ # Avoid sandbox failure (attempts to write to /var/lib/rpm) |
243 |
+ profile_task_flags+=( |
244 |
+ -x test_distutils |
245 |
+ ) |
246 |
+ fi |
247 |
+ local -x PROFILE_TASK="${profile_task_flags[*]}" |
248 |
+ fi |
249 |
+ |
250 |
+ local myeconfargs=( |
251 |
+ # glibc-2.30 removes it; since we can't cleanly force-rebuild |
252 |
+ # Python on glibc upgrade, remove it proactively to give |
253 |
+ # a chance for users rebuilding python before glibc |
254 |
+ ac_cv_header_stropts_h=no |
255 |
+ |
256 |
+ --enable-shared |
257 |
+ --without-static-libpython |
258 |
+ --enable-ipv6 |
259 |
+ --infodir='${prefix}/share/info' |
260 |
+ --mandir='${prefix}/share/man' |
261 |
+ --with-computed-gotos |
262 |
+ --with-dbmliborder="${dbmliborder}" |
263 |
+ --with-libc= |
264 |
+ --enable-loadable-sqlite-extensions |
265 |
+ --without-ensurepip |
266 |
+ --with-system-expat |
267 |
+ --with-system-ffi |
268 |
+ --with-wheel-pkg-dir="${EPREFIX}"/usr/lib/python/ensurepip |
269 |
+ |
270 |
+ $(use_with lto) |
271 |
+ $(use_enable pgo optimizations) |
272 |
+ $(use_with readline readline "$(usex libedit editline readline)") |
273 |
+ ) |
274 |
+ |
275 |
+ # disable implicit optimization/debugging flags |
276 |
+ local -x OPT= |
277 |
+ # pass system CFLAGS & LDFLAGS as _NODIST, otherwise they'll get |
278 |
+ # propagated to sysconfig for built extensions |
279 |
+ local -x CFLAGS_NODIST=${CFLAGS} |
280 |
+ local -x LDFLAGS_NODIST=${LDFLAGS} |
281 |
+ local -x CFLAGS= LDFLAGS= |
282 |
+ |
283 |
+ econf "${myeconfargs[@]}" |
284 |
+ |
285 |
+ if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then |
286 |
+ eerror "configure has detected that the sem_open function is broken." |
287 |
+ eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." |
288 |
+ die "Broken sem_open function (bug 496328)" |
289 |
+ fi |
290 |
+ |
291 |
+ # install epython.py as part of stdlib |
292 |
+ echo "EPYTHON='python${PYVER}'" > Lib/epython.py || die |
293 |
+} |
294 |
+ |
295 |
+src_compile() { |
296 |
+ # Ensure sed works as expected |
297 |
+ # https://bugs.gentoo.org/594768 |
298 |
+ local -x LC_ALL=C |
299 |
+ # Prevent using distutils bundled by setuptools. |
300 |
+ # https://bugs.gentoo.org/823728 |
301 |
+ export SETUPTOOLS_USE_DISTUTILS=stdlib |
302 |
+ |
303 |
+ # Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't |
304 |
+ # end up writing bytecode & violating sandbox. |
305 |
+ # bug #831897 |
306 |
+ local -x _PYTHONDONTWRITEBYTECODE=${PYTHONDONTWRITEBYTECODE} |
307 |
+ |
308 |
+ if use pgo ; then |
309 |
+ # bug 660358 |
310 |
+ local -x COLUMNS=80 |
311 |
+ local -x PYTHONDONTWRITEBYTECODE= |
312 |
+ |
313 |
+ addpredict /usr/lib/python3.10/site-packages |
314 |
+ fi |
315 |
+ |
316 |
+ # also need to clear the flags explicitly here or they end up |
317 |
+ # in _sysconfigdata* |
318 |
+ emake CPPFLAGS= CFLAGS= LDFLAGS= |
319 |
+ |
320 |
+ # Restore saved value from above. |
321 |
+ local -x PYTHONDONTWRITEBYTECODE=${_PYTHONDONTWRITEBYTECODE} |
322 |
+ |
323 |
+ # Work around bug 329499. See also bug 413751 and 457194. |
324 |
+ if has_version dev-libs/libffi[pax-kernel]; then |
325 |
+ pax-mark E python |
326 |
+ else |
327 |
+ pax-mark m python |
328 |
+ fi |
329 |
+} |
330 |
+ |
331 |
+src_test() { |
332 |
+ # Tests will not work when cross compiling. |
333 |
+ if tc-is-cross-compiler; then |
334 |
+ elog "Disabling tests due to crosscompiling." |
335 |
+ return |
336 |
+ fi |
337 |
+ |
338 |
+ local test_opts=( |
339 |
+ -u-network |
340 |
+ -j "$(makeopts_jobs)" |
341 |
+ |
342 |
+ # fails |
343 |
+ -x test_gdb |
344 |
+ ) |
345 |
+ |
346 |
+ if use sparc ; then |
347 |
+ # bug #788022 |
348 |
+ test_opts+=( |
349 |
+ -x test_multiprocessing_fork |
350 |
+ -x test_multiprocessing_forkserver |
351 |
+ ) |
352 |
+ fi |
353 |
+ |
354 |
+ # bug 660358 |
355 |
+ local -x COLUMNS=80 |
356 |
+ local -x PYTHONDONTWRITEBYTECODE= |
357 |
+ # workaround https://bugs.gentoo.org/775416 |
358 |
+ addwrite /usr/lib/python3.10/site-packages |
359 |
+ |
360 |
+ emake test EXTRATESTOPTS="${test_opts[*]}" \ |
361 |
+ CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty || die "emake test failed" |
362 |
+} |
363 |
+ |
364 |
+src_install() { |
365 |
+ local libdir=${ED}/usr/lib/python${PYVER} |
366 |
+ |
367 |
+ emake DESTDIR="${D}" altinstall |
368 |
+ |
369 |
+ # Fix collisions between different slots of Python. |
370 |
+ rm "${ED}/usr/$(get_libdir)/libpython3.so" || die |
371 |
+ |
372 |
+ # Cheap hack to get version with ABIFLAGS |
373 |
+ local abiver=$(cd "${ED}/usr/include"; echo python*) |
374 |
+ if [[ ${abiver} != python${PYVER} ]]; then |
375 |
+ # Replace python3.X with a symlink to python3.Xm |
376 |
+ rm "${ED}/usr/bin/python${PYVER}" || die |
377 |
+ dosym "${abiver}" "/usr/bin/python${PYVER}" |
378 |
+ # Create python3.X-config symlink |
379 |
+ dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" |
380 |
+ # Create python-3.5m.pc symlink |
381 |
+ dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" |
382 |
+ fi |
383 |
+ |
384 |
+ # python seems to get rebuilt in src_install (bug 569908) |
385 |
+ # Work around it for now. |
386 |
+ if has_version dev-libs/libffi[pax-kernel]; then |
387 |
+ pax-mark E "${ED}/usr/bin/${abiver}" |
388 |
+ else |
389 |
+ pax-mark m "${ED}/usr/bin/${abiver}" |
390 |
+ fi |
391 |
+ |
392 |
+ rm -r "${libdir}"/ensurepip/_bundled || die |
393 |
+ if ! use ensurepip; then |
394 |
+ rm -r "${libdir}"/ensurepip || die |
395 |
+ fi |
396 |
+ if ! use sqlite; then |
397 |
+ rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die |
398 |
+ fi |
399 |
+ if ! use tk; then |
400 |
+ rm -r "${ED}/usr/bin/idle${PYVER}" || die |
401 |
+ rm -r "${libdir}/"{idlelib,tkinter,test/test_tk*} || die |
402 |
+ fi |
403 |
+ |
404 |
+ dodoc Misc/{ACKS,HISTORY,NEWS} |
405 |
+ |
406 |
+ if use examples; then |
407 |
+ docinto examples |
408 |
+ find Tools -name __pycache__ -exec rm -fr {} + || die |
409 |
+ dodoc -r Tools |
410 |
+ fi |
411 |
+ insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 |
412 |
+ local libname=$( |
413 |
+ printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | |
414 |
+ emake --no-print-directory -s -f - 2>/dev/null |
415 |
+ ) |
416 |
+ newins Tools/gdb/libpython.py "${libname}"-gdb.py |
417 |
+ |
418 |
+ newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER} |
419 |
+ newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER} |
420 |
+ sed \ |
421 |
+ -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \ |
422 |
+ -e "s:@PYDOC@:pydoc${PYVER}:" \ |
423 |
+ -i "${ED}/etc/conf.d/pydoc-${PYVER}" \ |
424 |
+ "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed" |
425 |
+ |
426 |
+ # python-exec wrapping support |
427 |
+ local pymajor=${PYVER%.*} |
428 |
+ local EPYTHON=python${PYVER} |
429 |
+ local scriptdir=${D}$(python_get_scriptdir) |
430 |
+ mkdir -p "${scriptdir}" || die |
431 |
+ # python and pythonX |
432 |
+ ln -s "../../../bin/${abiver}" "${scriptdir}/python${pymajor}" || die |
433 |
+ ln -s "python${pymajor}" "${scriptdir}/python" || die |
434 |
+ # python-config and pythonX-config |
435 |
+ # note: we need to create a wrapper rather than symlinking it due |
436 |
+ # to some random dirname(argv[0]) magic performed by python-config |
437 |
+ cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die |
438 |
+ #!/bin/sh |
439 |
+ exec "${abiver}-config" "\${@}" |
440 |
+ EOF |
441 |
+ chmod +x "${scriptdir}/python${pymajor}-config" || die |
442 |
+ ln -s "python${pymajor}-config" "${scriptdir}/python-config" || die |
443 |
+ # 2to3, pydoc |
444 |
+ ln -s "../../../bin/2to3-${PYVER}" "${scriptdir}/2to3" || die |
445 |
+ ln -s "../../../bin/pydoc${PYVER}" "${scriptdir}/pydoc" || die |
446 |
+ # idle |
447 |
+ if use tk; then |
448 |
+ ln -s "../../../bin/idle${PYVER}" "${scriptdir}/idle" || die |
449 |
+ fi |
450 |
+} |