1 |
commit: c217858299b467264ffe93ccbb0a9d7db307cbf7 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jan 15 08:11:00 2022 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jan 15 09:52:09 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c2178582 |
7 |
|
8 |
dev-lang/python: Bump to 3.10.2 |
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.2.ebuild | 381 +++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 384 insertions(+) |
15 |
|
16 |
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest |
17 |
index 834e907de725..afda926b044b 100644 |
18 |
--- a/dev-lang/python/Manifest |
19 |
+++ b/dev-lang/python/Manifest |
20 |
@@ -4,6 +4,8 @@ DIST Python-3.10.0.tar.xz 18726176 BLAKE2B 77143edf733cadf7e52327a58782f0617b1dd |
21 |
DIST Python-3.10.0.tar.xz.asc 833 BLAKE2B 295df19932ea076bb1a50acb38782055ff34fb235df0380fa361727eedb3ca68aeca2a31419de5b05ce128c2e21ad04605c226e7a61d508a17607f615e46e570 SHA512 67236e02bc49da1423717cb54216b745f613ba2fc4b372a4aa15a36ab15fe69d9b9087070382957d480df7576d13056caedcd979fb56531799a1190b822f673d |
22 |
DIST Python-3.10.1.tar.xz 18775460 BLAKE2B d2dbf875ef5f9cee6dfd66e2d2489b884813c6a4eb3ef4da25713361efebb9ab271dc7050de25d4b07808bd3fd510700975c733ca8f283caa7426d16f273a93d SHA512 1c559e33f1252e51bafb941c380de16f142c0735858363c84cb8dbed6767843de3af126889c2826ffb94bd4777d7cdfc31040301c8c74de56af52b80b1aa9e76 |
23 |
DIST Python-3.10.1.tar.xz.asc 833 BLAKE2B a5678c522b486a246993616ee36ddb3f74a093fb5729d8d2da3cfc4de5c3e1fcf3f4f55504b7bbf929050204d22a89ff3c7750b599034a3d5c941666f54fcad4 SHA512 645d5f40e6e80a590923a48763f20dea7da3f3eea5825bb79e08618d81d1b8eee0ddee2b57503321a584280536e0671e4913e5ad450568fbbb44509c01d3907d |
24 |
+DIST Python-3.10.2.tar.xz 18780936 BLAKE2B ce202f7b45858b88ffdefe8217422fa9dccccc58000c6f3d40c9791d28ab58f67fa033b5102cacaf0ccec5524510becec9870c9bf5238b78203a0a354e8f526c SHA512 215a7159face84788fe547c1e2689b8d0ae510275157cf01636bef2902d0ff465f844eb0328c9f39fd1cd03a1d1736d4cf258992f2788e492a801a372032c08b |
25 |
+DIST Python-3.10.2.tar.xz.asc 833 BLAKE2B ff3b1f8c1c62e75a00ac70bbe3a2e87406f0f44fba8bfa1ea5c0d8b8175a8720af62c57664bf50fa5f7ec7caeeb2669c17917e457daf43755f1583e92eb410ba SHA512 086aeaa999d3005cc1f9057d90230c7a9e65d80f436febf16b0e8ba6f49645870ef21170ca1af50c8e2f51e6f46338cfad73a2d91320ad4a3315a2ae87eb70b4 |
26 |
DIST Python-3.11.0a3.tar.xz 18775072 BLAKE2B 5d1650e2258d0f9fe4d5b3ab09b94e2269844a44a20f7b6425097755200fb022d3c1df8a59bf147dfd7759766769ca9c88d3c202667ff275c02a3a73eb79daa8 SHA512 69fe7a4c80ab4e7674685b072b9dea435dc7968306a1ce8b1356a1bb9b998ed6b9e35c17b5ecae3c490f5c71f524fa791bd996431d5dac550773cf5e8362a7ba |
27 |
DIST Python-3.11.0a3.tar.xz.asc 833 BLAKE2B ed366bd939f7168b0ef41ef991ee74c142f4e8d8118fcc67c149f7ac5e70488fe1e9822ad79eb47576749902f4c28edd4584ade1aa2796376335c54b323a64ef SHA512 890d9092d2a155d65588f3a8f34e93b6e3e549b0507af856ffae1fbb3a2f3f1446f6bc69684c23116bed4e3a547a331173e83c3d52a7bff8caa368f955fe293d |
28 |
DIST Python-3.11.0a4.tar.xz 18805548 BLAKE2B 3315ee4392c3a7312273c705779415f5456e3d19d5e7b4008a67b4ea68a9d8aac2ecb06524b856a3522723f628ff687b01f2a5a48a04c24b4883ba357c30d685 SHA512 721ed64f3fde360e9eae6d8f8a046091c7c08f14c860572ac868132dffa4ae0a46f3f57a3872fcc096551a66e4fa3b1c87f77baa52d8524da026bbdaa74837ec |
29 |
@@ -21,6 +23,7 @@ DIST Python-3.9.9.tar.xz.asc 833 BLAKE2B 41d05ee1ec256f0cab4e9d3540877783745f0f3 |
30 |
DIST python-gentoo-patches-2.7.18_p13.tar.xz 33296 BLAKE2B 91b711458aff4f6337ee1b34aff58d7edda6725644a64c9320076a1e04c816729ed163d82333cfe4dfef379a9ad5ef50ba00abdbbfed4503b0f92c8f0b7ca683 SHA512 97f3657a4a95e8492aa710801b974a56e6dd4636e475aea45cbbe76e7ae32d00f07b05769887f05e49cb0df8584ac9499a7ce842bad77f837a7c869f9b769b07 |
31 |
DIST python-gentoo-patches-3.10.0_p1.tar.xz 10068 BLAKE2B 1c9817b449831559f0a0b722c02a5f55d94b3dfde98e5882c1403fe24a4addf7074ab39c09b91cff6fd7ace2e4b6e8ed899d9a0b9ffd6612ce315c4c192bd309 SHA512 39aa41dbf17b6dc5255491c75031a3dae6962b44125e426dbfdce365a6533c5dae9856b1fff8016a189124b7cff72d2665ce99da344c2f9dff005ba685e8c2c4 |
32 |
DIST python-gentoo-patches-3.10.1.tar.xz 8580 BLAKE2B 58d165c6c21a6736787d77d5bbeb770adff7f3729a47f62d0b7c4f0982c15c6a50b326be33638f3fca5574936cbce35d26e9ce0868faa3b5a3412b30586b066a SHA512 f86adf4e5195b1eb13cedbf24c1956964ce56745f0524a62b1e7c6baf74c6f1802e05cf4c08519b147579945c0526ff0a0ffc01cfb4372c0ec4f403b25e81012 |
33 |
+DIST python-gentoo-patches-3.10.2.tar.xz 8584 BLAKE2B 4328b21d7b8b0e39d0d6761c3a52cb5369aff7dfa890a1496fe5c01720bd9d8ef38d915188ad6079158104f8acf5847e220d58c092a9682615aa366dce9f20d2 SHA512 063c53022525cea988a9a27643bf0b2b5e674259de487826ee3b3cbca50c369857908d53cee9be59adf09db7ac0dcaed65639c40204ff4519b812b215de588a6 |
34 |
DIST python-gentoo-patches-3.11.0a3.tar.xz 3656 BLAKE2B a80380a2a64822bb63ceeec80c58d5482c4d2719d50e8091fe2a6deb199de3f22a4d794a76cb95792cc5b49567176a6e2e8bfc213e593782ec7f4211d2e00837 SHA512 71247cedf34cd195237d1eaae9cd3a24159e9631b726bf2e4d22840d0f166b12557657eba0686df7b8a8d272c52a584827ea4b7b62e1ce3b56eda4d9a2e05927 |
35 |
DIST python-gentoo-patches-3.11.0a4.tar.xz 3652 BLAKE2B 19beab7c85e93414f392f2fda89a5ec0fc0a8339bf3804cb88c349cbb57b2c2cd6338d59307a950abe387958cbe7d3b958a73004b5fc51788235660aed3dea6a SHA512 97745cc7dd9c0849f1e5cc577322878f831e7af0b45ef6d23e0cee1b02879386bbf22d84ff73b8a5f70f2b193788f3dff003ddc248bd8ea19779c371fe706bdc |
36 |
DIST python-gentoo-patches-3.6.15.tar.xz 15300 BLAKE2B f49fd96f6ad1a1c94fea6b83acd229a81754b86061e243044ead4b9a9d5122a2e43b270b68722c359c084c05a566a3ad70aa46588ab7a005ee560ee118b92b8b SHA512 cc33491a33f3f1d990cf494d53b91b74db761142e8aebe1bd4b128ef10a268ff945e5ba08daad39cee095612a8e52265d6988873ecf9c073377cbbc10735aa39 |
37 |
|
38 |
diff --git a/dev-lang/python/python-3.10.2.ebuild b/dev-lang/python/python-3.10.2.ebuild |
39 |
new file mode 100644 |
40 |
index 000000000000..b5252e5268cc |
41 |
--- /dev/null |
42 |
+++ b/dev-lang/python/python-3.10.2.ebuild |
43 |
@@ -0,0 +1,381 @@ |
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 |
+ 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="https://www.python.org/" |
60 |
+SRC_URI="https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz |
61 |
+ https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz |
62 |
+ verify-sig? ( |
63 |
+ https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz.asc |
64 |
+ )" |
65 |
+S="${WORKDIR}/${MY_P}" |
66 |
+ |
67 |
+LICENSE="PSF-2" |
68 |
+SLOT="${PYVER}" |
69 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" |
70 |
+IUSE="bluetooth build examples gdbm hardened libedit lto +ncurses pgo +readline +sqlite +ssl test tk wininst +xml" |
71 |
+RESTRICT="!test? ( test )" |
72 |
+ |
73 |
+# Do not add a dependency on dev-lang/python to this ebuild. |
74 |
+# If you need to apply a patch which requires python for bootstrapping, please |
75 |
+# run the bootstrap code on your dev box and include the results in the |
76 |
+# patchset. See bug 447752. |
77 |
+ |
78 |
+RDEPEND="app-arch/bzip2:= |
79 |
+ app-arch/xz-utils:= |
80 |
+ dev-lang/python-exec[python_targets_python3_10(-)] |
81 |
+ dev-libs/libffi:= |
82 |
+ sys-apps/util-linux:= |
83 |
+ >=sys-libs/zlib-1.1.3:= |
84 |
+ virtual/libcrypt:= |
85 |
+ virtual/libintl |
86 |
+ gdbm? ( sys-libs/gdbm:=[berkdb] ) |
87 |
+ ncurses? ( >=sys-libs/ncurses-5.2:= ) |
88 |
+ readline? ( |
89 |
+ !libedit? ( >=sys-libs/readline-4.1:= ) |
90 |
+ libedit? ( dev-libs/libedit:= ) |
91 |
+ ) |
92 |
+ sqlite? ( >=dev-db/sqlite-3.3.8:3= ) |
93 |
+ ssl? ( >=dev-libs/openssl-1.1.1:= ) |
94 |
+ tk? ( |
95 |
+ >=dev-lang/tcl-8.0:= |
96 |
+ >=dev-lang/tk-8.0:= |
97 |
+ dev-tcltk/blt:= |
98 |
+ dev-tcltk/tix |
99 |
+ ) |
100 |
+ xml? ( >=dev-libs/expat-2.1:= ) |
101 |
+ !!<sys-apps/sandbox-2.21" |
102 |
+# bluetooth requires headers from bluez |
103 |
+DEPEND="${RDEPEND} |
104 |
+ bluetooth? ( net-wireless/bluez ) |
105 |
+ test? ( app-arch/xz-utils[extra-filters(+)] )" |
106 |
+# autoconf-archive needed to eautoreconf |
107 |
+BDEPEND=" |
108 |
+ sys-devel/autoconf-archive |
109 |
+ virtual/awk |
110 |
+ virtual/pkgconfig |
111 |
+ verify-sig? ( sec-keys/openpgp-keys-python ) |
112 |
+ !sys-devel/gcc[libffi(-)]" |
113 |
+RDEPEND+=" !build? ( app-misc/mime-types )" |
114 |
+ |
115 |
+VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc |
116 |
+ |
117 |
+# large file tests involve a 2.5G file being copied (duplicated) |
118 |
+CHECKREQS_DISK_BUILD=5500M |
119 |
+ |
120 |
+pkg_pretend() { |
121 |
+ use test && check-reqs_pkg_pretend |
122 |
+} |
123 |
+ |
124 |
+pkg_setup() { |
125 |
+ use test && check-reqs_pkg_setup |
126 |
+} |
127 |
+ |
128 |
+src_unpack() { |
129 |
+ if use verify-sig; then |
130 |
+ verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc} |
131 |
+ fi |
132 |
+ default |
133 |
+} |
134 |
+ |
135 |
+src_prepare() { |
136 |
+ # Ensure that internal copies of expat, libffi and zlib are not used. |
137 |
+ rm -fr Modules/expat || die |
138 |
+ rm -fr Modules/_ctypes/libffi* || die |
139 |
+ rm -fr Modules/zlib || die |
140 |
+ |
141 |
+ local PATCHES=( |
142 |
+ "${WORKDIR}/${PATCHSET}" |
143 |
+ ) |
144 |
+ |
145 |
+ default |
146 |
+ |
147 |
+ sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ |
148 |
+ setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" |
149 |
+ |
150 |
+ # force correct number of jobs |
151 |
+ # https://bugs.gentoo.org/737660 |
152 |
+ local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") |
153 |
+ sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die |
154 |
+ sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die |
155 |
+ |
156 |
+ eautoreconf |
157 |
+} |
158 |
+ |
159 |
+src_configure() { |
160 |
+ local disable |
161 |
+ # disable automagic bluetooth headers detection |
162 |
+ use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no |
163 |
+ use gdbm || disable+=" gdbm" |
164 |
+ use ncurses || disable+=" _curses _curses_panel" |
165 |
+ use readline || disable+=" readline" |
166 |
+ use sqlite || disable+=" _sqlite3" |
167 |
+ use ssl || export PYTHON_DISABLE_SSL="1" |
168 |
+ use tk || disable+=" _tkinter" |
169 |
+ use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. |
170 |
+ export PYTHON_DISABLE_MODULES="${disable}" |
171 |
+ |
172 |
+ if ! use xml; then |
173 |
+ ewarn "You have configured Python without XML support." |
174 |
+ ewarn "This is NOT a recommended configuration as you" |
175 |
+ ewarn "may face problems parsing any XML documents." |
176 |
+ fi |
177 |
+ |
178 |
+ if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then |
179 |
+ einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" |
180 |
+ fi |
181 |
+ |
182 |
+ if [[ "$(gcc-major-version)" -ge 4 ]]; then |
183 |
+ append-flags -fwrapv |
184 |
+ fi |
185 |
+ |
186 |
+ filter-flags -malign-double |
187 |
+ |
188 |
+ # https://bugs.gentoo.org/show_bug.cgi?id=50309 |
189 |
+ if is-flagq -O3; then |
190 |
+ is-flagq -fstack-protector-all && replace-flags -O3 -O2 |
191 |
+ use hardened && replace-flags -O3 -O2 |
192 |
+ fi |
193 |
+ |
194 |
+ # https://bugs.gentoo.org/700012 |
195 |
+ if is-flagq -flto || is-flagq '-flto=*'; then |
196 |
+ append-cflags $(test-flags-CC -ffat-lto-objects) |
197 |
+ fi |
198 |
+ |
199 |
+ # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. |
200 |
+ tc-export CXX |
201 |
+ |
202 |
+ # Fix implicit declarations on cross and prefix builds. Bug #674070. |
203 |
+ use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw |
204 |
+ |
205 |
+ local dbmliborder |
206 |
+ if use gdbm; then |
207 |
+ dbmliborder+="${dbmliborder:+:}gdbm" |
208 |
+ fi |
209 |
+ |
210 |
+ if use pgo; then |
211 |
+ local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") |
212 |
+ export PROFILE_TASK="-m test -j${jobs} --pgo-extended -x test_gdb -u-network" |
213 |
+ |
214 |
+ # All of these seem to occasionally hang for PGO inconsistently |
215 |
+ # They'll even hang here but be fine in src_test sometimes. |
216 |
+ # bug #828535 (and related: bug #788022) |
217 |
+ PROFILE_TASK+=" -x test_socket -x test_asyncio -x test_httpservers -x test_logging -x test_multiprocessing_fork -x test_xmlrpc" |
218 |
+ |
219 |
+ if has_version "app-arch/rpm" ; then |
220 |
+ # Avoid sandbox failure (attempts to write to /var/lib/rpm) |
221 |
+ PROFILE_TASK+=" -x test_distutils" |
222 |
+ fi |
223 |
+ fi |
224 |
+ |
225 |
+ local myeconfargs=( |
226 |
+ # glibc-2.30 removes it; since we can't cleanly force-rebuild |
227 |
+ # Python on glibc upgrade, remove it proactively to give |
228 |
+ # a chance for users rebuilding python before glibc |
229 |
+ ac_cv_header_stropts_h=no |
230 |
+ |
231 |
+ --enable-shared |
232 |
+ --without-static-libpython |
233 |
+ --enable-ipv6 |
234 |
+ --infodir='${prefix}/share/info' |
235 |
+ --mandir='${prefix}/share/man' |
236 |
+ --with-computed-gotos |
237 |
+ --with-dbmliborder="${dbmliborder}" |
238 |
+ --with-libc= |
239 |
+ --enable-loadable-sqlite-extensions |
240 |
+ --without-ensurepip |
241 |
+ --with-system-expat |
242 |
+ --with-system-ffi |
243 |
+ |
244 |
+ $(use_with lto) |
245 |
+ $(use_enable pgo optimizations) |
246 |
+ $(use_with readline readline "$(usex libedit editline readline)") |
247 |
+ ) |
248 |
+ |
249 |
+ OPT="" econf "${myeconfargs[@]}" |
250 |
+ |
251 |
+ if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then |
252 |
+ eerror "configure has detected that the sem_open function is broken." |
253 |
+ eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." |
254 |
+ die "Broken sem_open function (bug 496328)" |
255 |
+ fi |
256 |
+} |
257 |
+ |
258 |
+src_compile() { |
259 |
+ # Ensure sed works as expected |
260 |
+ # https://bugs.gentoo.org/594768 |
261 |
+ local -x LC_ALL=C |
262 |
+ # Prevent using distutils bundled by setuptools. |
263 |
+ # https://bugs.gentoo.org/823728 |
264 |
+ export SETUPTOOLS_USE_DISTUTILS=stdlib |
265 |
+ |
266 |
+ if use pgo ; then |
267 |
+ # bug 660358 |
268 |
+ local -x COLUMNS=80 |
269 |
+ local -x PYTHONDONTWRITEBYTECODE= |
270 |
+ |
271 |
+ addpredict /usr/lib/python3.10/site-packages |
272 |
+ fi |
273 |
+ |
274 |
+ emake CPPFLAGS= CFLAGS= LDFLAGS= |
275 |
+ |
276 |
+ # Work around bug 329499. See also bug 413751 and 457194. |
277 |
+ if has_version dev-libs/libffi[pax-kernel]; then |
278 |
+ pax-mark E python |
279 |
+ else |
280 |
+ pax-mark m python |
281 |
+ fi |
282 |
+} |
283 |
+ |
284 |
+src_test() { |
285 |
+ # Tests will not work when cross compiling. |
286 |
+ if tc-is-cross-compiler; then |
287 |
+ elog "Disabling tests due to crosscompiling." |
288 |
+ return |
289 |
+ fi |
290 |
+ |
291 |
+ # Skip failing tests. |
292 |
+ local skipped_tests="gdb" |
293 |
+ |
294 |
+ for test in ${skipped_tests}; do |
295 |
+ mv "${S}"/Lib/test/test_${test}.py "${T}" |
296 |
+ done |
297 |
+ |
298 |
+ # bug 660358 |
299 |
+ local -x COLUMNS=80 |
300 |
+ local -x PYTHONDONTWRITEBYTECODE= |
301 |
+ # workaround https://bugs.gentoo.org/775416 |
302 |
+ addwrite /usr/lib/python3.10/site-packages |
303 |
+ |
304 |
+ local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") |
305 |
+ |
306 |
+ emake test EXTRATESTOPTS="-u-network -j${jobs}" \ |
307 |
+ CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty |
308 |
+ local result=$? |
309 |
+ |
310 |
+ for test in ${skipped_tests}; do |
311 |
+ mv "${T}/test_${test}.py" "${S}"/Lib/test |
312 |
+ done |
313 |
+ |
314 |
+ elog "The following tests have been skipped:" |
315 |
+ for test in ${skipped_tests}; do |
316 |
+ elog "test_${test}.py" |
317 |
+ done |
318 |
+ |
319 |
+ elog "If you would like to run them, you may:" |
320 |
+ elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'" |
321 |
+ elog "and run the tests separately." |
322 |
+ |
323 |
+ if [[ ${result} -ne 0 ]]; then |
324 |
+ die "emake test failed" |
325 |
+ fi |
326 |
+} |
327 |
+ |
328 |
+src_install() { |
329 |
+ local libdir=${ED}/usr/lib/python${PYVER} |
330 |
+ |
331 |
+ emake DESTDIR="${D}" altinstall |
332 |
+ |
333 |
+ sed \ |
334 |
+ -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \ |
335 |
+ -e "s/\(PY_LDFLAGS=\).*/\1/" \ |
336 |
+ -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed" |
337 |
+ |
338 |
+ # Fix collisions between different slots of Python. |
339 |
+ rm "${ED}/usr/$(get_libdir)/libpython3.so" || die |
340 |
+ |
341 |
+ # Cheap hack to get version with ABIFLAGS |
342 |
+ local abiver=$(cd "${ED}/usr/include"; echo python*) |
343 |
+ if [[ ${abiver} != python${PYVER} ]]; then |
344 |
+ # Replace python3.X with a symlink to python3.Xm |
345 |
+ rm "${ED}/usr/bin/python${PYVER}" || die |
346 |
+ dosym "${abiver}" "/usr/bin/python${PYVER}" |
347 |
+ # Create python3.X-config symlink |
348 |
+ dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" |
349 |
+ # Create python-3.5m.pc symlink |
350 |
+ dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" |
351 |
+ fi |
352 |
+ |
353 |
+ # python seems to get rebuilt in src_install (bug 569908) |
354 |
+ # Work around it for now. |
355 |
+ if has_version dev-libs/libffi[pax-kernel]; then |
356 |
+ pax-mark E "${ED}/usr/bin/${abiver}" |
357 |
+ else |
358 |
+ pax-mark m "${ED}/usr/bin/${abiver}" |
359 |
+ fi |
360 |
+ |
361 |
+ use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die |
362 |
+ use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die |
363 |
+ |
364 |
+ dodoc Misc/{ACKS,HISTORY,NEWS} |
365 |
+ |
366 |
+ if use examples; then |
367 |
+ docinto examples |
368 |
+ find Tools -name __pycache__ -exec rm -fr {} + || die |
369 |
+ dodoc -r Tools |
370 |
+ fi |
371 |
+ insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 |
372 |
+ local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ |
373 |
+ emake --no-print-directory -s -f - 2>/dev/null) |
374 |
+ newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py |
375 |
+ |
376 |
+ newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER} |
377 |
+ newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER} |
378 |
+ sed \ |
379 |
+ -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \ |
380 |
+ -e "s:@PYDOC@:pydoc${PYVER}:" \ |
381 |
+ -i "${ED}/etc/conf.d/pydoc-${PYVER}" \ |
382 |
+ "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed" |
383 |
+ |
384 |
+ local -x EPYTHON=python${PYVER} |
385 |
+ # if not using a cross-compiler, use the fresh binary |
386 |
+ if ! tc-is-cross-compiler; then |
387 |
+ local -x PYTHON=./python |
388 |
+ local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD} |
389 |
+ else |
390 |
+ local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON} |
391 |
+ fi |
392 |
+ |
393 |
+ echo "EPYTHON='${EPYTHON}'" > epython.py || die |
394 |
+ python_domodule epython.py |
395 |
+ |
396 |
+ # python-exec wrapping support |
397 |
+ local pymajor=${PYVER%.*} |
398 |
+ local scriptdir=${D}$(python_get_scriptdir) |
399 |
+ mkdir -p "${scriptdir}" || die |
400 |
+ # python and pythonX |
401 |
+ ln -s "../../../bin/${abiver}" \ |
402 |
+ "${scriptdir}/python${pymajor}" || die |
403 |
+ ln -s "python${pymajor}" "${scriptdir}/python" || die |
404 |
+ # python-config and pythonX-config |
405 |
+ # note: we need to create a wrapper rather than symlinking it due |
406 |
+ # to some random dirname(argv[0]) magic performed by python-config |
407 |
+ cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die |
408 |
+ #!/bin/sh |
409 |
+ exec "${abiver}-config" "\${@}" |
410 |
+ EOF |
411 |
+ chmod +x "${scriptdir}/python${pymajor}-config" || die |
412 |
+ ln -s "python${pymajor}-config" \ |
413 |
+ "${scriptdir}/python-config" || die |
414 |
+ # 2to3, pydoc |
415 |
+ ln -s "../../../bin/2to3-${PYVER}" \ |
416 |
+ "${scriptdir}/2to3" || die |
417 |
+ ln -s "../../../bin/pydoc${PYVER}" \ |
418 |
+ "${scriptdir}/pydoc" || die |
419 |
+ # idle |
420 |
+ if use tk; then |
421 |
+ ln -s "../../../bin/idle${PYVER}" \ |
422 |
+ "${scriptdir}/idle" || die |
423 |
+ fi |
424 |
+} |