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