1 |
commit: 76d75cdf4930cdfbac1366437e83c1a968730ee0 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Aug 30 21:53:16 2021 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Aug 30 22:23:49 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=76d75cdf |
7 |
|
8 |
dev-lang/python: Bump to 3.8.12 |
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.8.12.ebuild | 335 +++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 338 insertions(+) |
15 |
|
16 |
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest |
17 |
index bc7c8b10002..496820d4485 100644 |
18 |
--- a/dev-lang/python/Manifest |
19 |
+++ b/dev-lang/python/Manifest |
20 |
@@ -8,6 +8,8 @@ DIST Python-3.7.11.tar.xz 17393380 BLAKE2B 6394d69935950366da7c4cecd4816d7625417 |
21 |
DIST Python-3.7.11.tar.xz.asc 833 BLAKE2B 8af6b3e58b607a34c91f57af2fbe9c3f3c7cb6fa5e435e963edd7edcf7649e70c3a76bd346ff8ef1b3c890d8a92d3b2fed27ee01b512c579ff8ce80be61274fb SHA512 f19db95e88c9269174a2b4ac4d8c68fa7ed666b6698af26d2da202e30d145686e8679be763eecba9f8a0c34a207639724094463cffce659c3855ed4b133b0a59 |
22 |
DIST Python-3.8.11.tar.xz 18437648 BLAKE2B 957c553ced3387d19c1d1baf2eea7d41e9abfbf398c4514f475eadae29336dc02dbd2cdf7b90ab5fee1e49c083a366c113dcd73149445b663fcdf81a3b2b04f6 SHA512 c8c17491b05d83a9f8940474019034780a6b1ff4148654cd62c8f708c539718a0312cf0665efa2b8c42ed773f4306080bd105701a211ed56e6cab40837d5b2df |
23 |
DIST Python-3.8.11.tar.xz.asc 833 BLAKE2B 52239149331a6529351714db10b5f6b2a37e9a9ce13470e0ab8ae4bf439544878df095995bdc28a534d55039a539c400f532aec8fb7d9b9ce7132167f0e39529 SHA512 40381e83a1bef996333d5044a361ce441c4631725457f8382588e9a86f586a9539ee139b8398aff3d988a317041fa87476f29cf6fcd2b31fe0e9b4cd21ede68a |
24 |
+DIST Python-3.8.12.tar.xz 18443568 BLAKE2B 73413aee7a31347ac4342718a54d23d4036220262c4cd41cd50b06c3b1698d52d11cf7ac2c781b919f2cdb0dcb6397d623c463dcdcd1edca99abbbce239a3c6e SHA512 2f93fe5ff83f470c7b6a1b7f29f499a2a010fabd649e9fe65ad3fbfa21b6e1966e77c9b7ac012d978159bc3fe63fec2d64bc6982fc2ee1714d3fa0e47631f279 |
25 |
+DIST Python-3.8.12.tar.xz.asc 833 BLAKE2B 33f59aa667555832ee510d2a7295079f34a3983dfa84beab20b33ec691ea3eecfcc4a62591fe233fc30622d0236ee69a3d41b8922ee2f4c632df3523d565c3ec SHA512 ef552b716a721f410abb14387594c8b0ddc65ce4b8a6ae6bf920c1db2ea9ddf6bbf547e93d3716495ae31848eb1049aae4257016e888393681bbfb6f6529bc12 |
26 |
DIST Python-3.9.6.tar.xz 19051972 BLAKE2B 0d8586b2935088eeab7138cf2210c1a74f1bf7359359d25750af5f69de55eb39c92f518b887a8b749c772ed7d33e85b912928ae6d878514eb58d85ef210f54f0 SHA512 01c529e3207738d8771caeb5ed6217e10745c21aa39832fe3185e1c87fdb6aedead97ce38dbb11e02d873654028bd8071c3f345c18452769520723284efe9dc1 |
27 |
DIST Python-3.9.6.tar.xz.asc 833 BLAKE2B 41901bfb80a901f2f14e86769e6d08ded8f75656d347201345183162e180e61442da871a1067572a54da579551166a19bf5436e51581bb10cb78afc4d28773fc SHA512 0673c8833f302c829bfde97453c52744f6aa99b4a72520f4cc384d4aa9d6ffd28a1407ceafb0a1ec4462b3aa74b656bf39c67872c4e6a131429ea58c47ad0ecc |
28 |
DIST python-gentoo-patches-2.7.18_p11.tar.xz 31340 BLAKE2B bdc097b971ab8ec0b60f944002af34f3fff6b681c43515a4fec2fcac1a2c731bf4fcfae2178463103911e2f8cd6bc84d3b56cd0ad61da5c8276278ec9b85a242 SHA512 2a2388c4543267bfb0167f963a22f5141442c9347d9a8806ad6917843e6958d47c8f1933244651c870101b21408c920408fe056efb7a148117c24ab391151d88 |
29 |
@@ -16,5 +18,6 @@ DIST python-gentoo-patches-3.10.0rc1_p2.tar.xz 10548 BLAKE2B b0a78e3b5e45ead4833 |
30 |
DIST python-gentoo-patches-3.6.14.tar.xz 14744 BLAKE2B b9482f9d2b7ada60eff9a5672ed21556c00b473a7cfdb543dce8253fb0ff1539e635a35569478c496012ecde4eef78a257da28f7a80bff99da10249708262229 SHA512 246f83911c8e52ea83a9bf453faa0bc0ea0c29bbf3b666a938e3790c6147f71e617ff9cb27501c5f0b89172eb9e7819e3f2ef0a5bae271cc938d2c0c2b93f7ae |
31 |
DIST python-gentoo-patches-3.7.11.tar.xz 16708 BLAKE2B 4f74b38f400c20b4112f080447021e7140704b282d6369a1479886740d12a17e7818b52a382a4b115238847bb08df0260b092b6ead491623b869c3d3a56f4cc2 SHA512 b96d7af8c9f7fb4b246a8b66e6440336a7d123678d990dd259d7ffb87d79ce74295ff350e220fee38d1b12f1ca94533899c2d2ce700391b3eac907722a79bba6 |
32 |
DIST python-gentoo-patches-3.8.11.tar.xz 16932 BLAKE2B aaa1df33997f4077916fb7cca2ec3a2b2ac1c0ead3db7c638a5152a82cfaaf5fc2768a10ac7235c417e25b2b735c53628ec096878f08eef0d211b03f4747103c SHA512 d2639b95c5a32f7145f92e52a94aec7c63f3ed4a66036ff73f052ff6836742d1e1dd7180f8634b65b4a44a10bf336092695bcc2230a7fd8be35bae870ed64b08 |
33 |
+DIST python-gentoo-patches-3.8.12.tar.xz 14936 BLAKE2B 1cb6cdb0bb659b1bc3f8a4ecd80da74b41a9fa2f4d5646ac4b48ddecd5124677cb24574a425404fedab4fb9c7faba4b1cb54cc3482785559a54fa3e9b3ca13f1 SHA512 86c30622bbf6847efcdf2bc43d916b05ee78ab17f45b93148a01cf4c181592029ecc52e8c4887112d97aeece63a92ee0f685a689287c133443cf51b3f8171fb9 |
34 |
DIST python-gentoo-patches-3.9.6_p1.tar.xz 12764 BLAKE2B 927718f1aadb5d5ef67e647a639a10bffdd48474bf01e50bd37ef1242bce57606b7b54c4823c1da3585ee76e737028163e38e9b4e19037585cc53f925e1c5fa7 SHA512 f06fb55786bd942e72e3225ee9ce218724aeee29f301279743588749007e991851a8f29db5b5dfd85435e3d763c00942947909a6fc60581bd0f3e8a6e913bff8 |
35 |
DIST python-gentoo-patches-3.9.6_p2.tar.xz 14720 BLAKE2B e14634229b65a29f5294694949c138bfa6146810349d1207a07d84eeca529571eb9c760b58ddbe6e8d96d50d1a3e0d1dfe42328c53c977a9eeb22ecd553317dc SHA512 5d84b8bb4e5584e3ef8e6298af000e772240ad93ed0aaadf1d785db947f1e79aecae7313b8dbeb65849212c9930e683be6e18e42ef6c41a3c27d60f75df08a01 |
36 |
|
37 |
diff --git a/dev-lang/python/python-3.8.12.ebuild b/dev-lang/python/python-3.8.12.ebuild |
38 |
new file mode 100644 |
39 |
index 00000000000..42783872728 |
40 |
--- /dev/null |
41 |
+++ b/dev-lang/python/python-3.8.12.ebuild |
42 |
@@ -0,0 +1,335 @@ |
43 |
+# Copyright 1999-2021 Gentoo Authors |
44 |
+# Distributed under the terms of the GNU General Public License v2 |
45 |
+ |
46 |
+EAPI="7" |
47 |
+WANT_LIBTOOL="none" |
48 |
+ |
49 |
+inherit autotools flag-o-matic multiprocessing pax-utils \ |
50 |
+ python-utils-r1 toolchain-funcs verify-sig |
51 |
+ |
52 |
+MY_PV=${PV/_rc/rc} |
53 |
+MY_P="Python-${MY_PV%_p*}" |
54 |
+PYVER=$(ver_cut 1-2) |
55 |
+PATCHSET="python-gentoo-patches-${MY_PV}" |
56 |
+ |
57 |
+DESCRIPTION="An interpreted, interactive, object-oriented programming language" |
58 |
+HOMEPAGE="https://www.python.org/" |
59 |
+SRC_URI="https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz |
60 |
+ https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz |
61 |
+ verify-sig? ( |
62 |
+ https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz.asc |
63 |
+ )" |
64 |
+S="${WORKDIR}/${MY_P}" |
65 |
+ |
66 |
+LICENSE="PSF-2" |
67 |
+SLOT="${PYVER}" |
68 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" |
69 |
+IUSE="bluetooth build examples gdbm hardened ipv6 +ncurses +readline +sqlite +ssl test tk wininst +xml" |
70 |
+RESTRICT="!test? ( test )" |
71 |
+ |
72 |
+# Do not add a dependency on dev-lang/python to this ebuild. |
73 |
+# If you need to apply a patch which requires python for bootstrapping, please |
74 |
+# run the bootstrap code on your dev box and include the results in the |
75 |
+# patchset. See bug 447752. |
76 |
+ |
77 |
+RDEPEND="app-arch/bzip2:= |
78 |
+ app-arch/xz-utils:= |
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/pkgconfig |
102 |
+ sys-devel/autoconf-archive |
103 |
+ verify-sig? ( app-crypt/openpgp-keys-python ) |
104 |
+ !sys-devel/gcc[libffi(-)]" |
105 |
+RDEPEND+=" !build? ( app-misc/mime-types )" |
106 |
+ |
107 |
+VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/python.org.asc |
108 |
+ |
109 |
+src_unpack() { |
110 |
+ if use verify-sig; then |
111 |
+ verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc} |
112 |
+ fi |
113 |
+ default |
114 |
+} |
115 |
+ |
116 |
+src_prepare() { |
117 |
+ # Ensure that internal copies of expat, libffi and zlib are not used. |
118 |
+ rm -fr Modules/expat || die |
119 |
+ rm -fr Modules/_ctypes/libffi* || die |
120 |
+ rm -fr Modules/zlib || die |
121 |
+ |
122 |
+ local PATCHES=( |
123 |
+ "${WORKDIR}/${PATCHSET}" |
124 |
+ ) |
125 |
+ |
126 |
+ default |
127 |
+ |
128 |
+ sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ |
129 |
+ setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" |
130 |
+ |
131 |
+ # force correct number of jobs |
132 |
+ # https://bugs.gentoo.org/737660 |
133 |
+ local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") |
134 |
+ sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die |
135 |
+ sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die |
136 |
+ |
137 |
+ eautoreconf |
138 |
+} |
139 |
+ |
140 |
+src_configure() { |
141 |
+ local disable |
142 |
+ # disable automagic bluetooth headers detection |
143 |
+ use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no |
144 |
+ use gdbm || disable+=" gdbm" |
145 |
+ use ncurses || disable+=" _curses _curses_panel" |
146 |
+ use readline || disable+=" readline" |
147 |
+ use sqlite || disable+=" _sqlite3" |
148 |
+ use ssl || export PYTHON_DISABLE_SSL="1" |
149 |
+ use tk || disable+=" _tkinter" |
150 |
+ use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. |
151 |
+ export PYTHON_DISABLE_MODULES="${disable}" |
152 |
+ |
153 |
+ if ! use xml; then |
154 |
+ ewarn "You have configured Python without XML support." |
155 |
+ ewarn "This is NOT a recommended configuration as you" |
156 |
+ ewarn "may face problems parsing any XML documents." |
157 |
+ fi |
158 |
+ |
159 |
+ if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then |
160 |
+ einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" |
161 |
+ fi |
162 |
+ |
163 |
+ if [[ "$(gcc-major-version)" -ge 4 ]]; then |
164 |
+ append-flags -fwrapv |
165 |
+ fi |
166 |
+ |
167 |
+ filter-flags -malign-double |
168 |
+ |
169 |
+ # https://bugs.gentoo.org/show_bug.cgi?id=50309 |
170 |
+ if is-flagq -O3; then |
171 |
+ is-flagq -fstack-protector-all && replace-flags -O3 -O2 |
172 |
+ use hardened && replace-flags -O3 -O2 |
173 |
+ fi |
174 |
+ |
175 |
+ # https://bugs.gentoo.org/700012 |
176 |
+ if is-flagq -flto || is-flagq '-flto=*'; then |
177 |
+ append-cflags $(test-flags-CC -ffat-lto-objects) |
178 |
+ fi |
179 |
+ |
180 |
+ # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. |
181 |
+ tc-export CXX |
182 |
+ |
183 |
+ # Fix implicit declarations on cross and prefix builds. Bug #674070. |
184 |
+ use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw |
185 |
+ |
186 |
+ local dbmliborder |
187 |
+ if use gdbm; then |
188 |
+ dbmliborder+="${dbmliborder:+:}gdbm" |
189 |
+ fi |
190 |
+ |
191 |
+ local myeconfargs=( |
192 |
+ # glibc-2.30 removes it; since we can't cleanly force-rebuild |
193 |
+ # Python on glibc upgrade, remove it proactively to give |
194 |
+ # a chance for users rebuilding python before glibc |
195 |
+ ac_cv_header_stropts_h=no |
196 |
+ |
197 |
+ --enable-shared |
198 |
+ $(use_enable ipv6) |
199 |
+ --infodir='${prefix}/share/info' |
200 |
+ --mandir='${prefix}/share/man' |
201 |
+ --with-computed-gotos |
202 |
+ --with-dbmliborder="${dbmliborder}" |
203 |
+ --with-libc= |
204 |
+ --enable-loadable-sqlite-extensions |
205 |
+ --without-ensurepip |
206 |
+ --with-system-expat |
207 |
+ --with-system-ffi |
208 |
+ ) |
209 |
+ |
210 |
+ OPT="" econf "${myeconfargs[@]}" |
211 |
+ |
212 |
+ if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then |
213 |
+ eerror "configure has detected that the sem_open function is broken." |
214 |
+ eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." |
215 |
+ die "Broken sem_open function (bug 496328)" |
216 |
+ fi |
217 |
+} |
218 |
+ |
219 |
+src_compile() { |
220 |
+ # Ensure sed works as expected |
221 |
+ # https://bugs.gentoo.org/594768 |
222 |
+ local -x LC_ALL=C |
223 |
+ |
224 |
+ emake CPPFLAGS= CFLAGS= LDFLAGS= |
225 |
+ |
226 |
+ # Work around bug 329499. See also bug 413751 and 457194. |
227 |
+ if has_version dev-libs/libffi[pax-kernel]; then |
228 |
+ pax-mark E python |
229 |
+ else |
230 |
+ pax-mark m python |
231 |
+ fi |
232 |
+} |
233 |
+ |
234 |
+src_test() { |
235 |
+ # Tests will not work when cross compiling. |
236 |
+ if tc-is-cross-compiler; then |
237 |
+ elog "Disabling tests due to crosscompiling." |
238 |
+ return |
239 |
+ fi |
240 |
+ |
241 |
+ # Skip failing tests. |
242 |
+ local skipped_tests="gdb" |
243 |
+ |
244 |
+ for test in ${skipped_tests}; do |
245 |
+ mv "${S}"/Lib/test/test_${test}.py "${T}" |
246 |
+ done |
247 |
+ |
248 |
+ # bug 660358 |
249 |
+ local -x COLUMNS=80 |
250 |
+ local -x PYTHONDONTWRITEBYTECODE= |
251 |
+ |
252 |
+ local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") |
253 |
+ |
254 |
+ emake test EXTRATESTOPTS="-u-network -j${jobs}" \ |
255 |
+ CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty |
256 |
+ local result=$? |
257 |
+ |
258 |
+ for test in ${skipped_tests}; do |
259 |
+ mv "${T}/test_${test}.py" "${S}"/Lib/test |
260 |
+ done |
261 |
+ |
262 |
+ elog "The following tests have been skipped:" |
263 |
+ for test in ${skipped_tests}; do |
264 |
+ elog "test_${test}.py" |
265 |
+ done |
266 |
+ |
267 |
+ elog "If you would like to run them, you may:" |
268 |
+ elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'" |
269 |
+ elog "and run the tests separately." |
270 |
+ |
271 |
+ if [[ ${result} -ne 0 ]]; then |
272 |
+ die "emake test failed" |
273 |
+ fi |
274 |
+} |
275 |
+ |
276 |
+src_install() { |
277 |
+ local libdir=${ED}/usr/lib/python${PYVER} |
278 |
+ |
279 |
+ emake DESTDIR="${D}" altinstall |
280 |
+ |
281 |
+ # Remove static library |
282 |
+ rm "${ED}"/usr/$(get_libdir)/libpython*.a || die |
283 |
+ |
284 |
+ sed \ |
285 |
+ -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \ |
286 |
+ -e "s/\(PY_LDFLAGS=\).*/\1/" \ |
287 |
+ -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed" |
288 |
+ |
289 |
+ # Fix collisions between different slots of Python. |
290 |
+ rm "${ED}/usr/$(get_libdir)/libpython3.so" || die |
291 |
+ |
292 |
+ # Cheap hack to get version with ABIFLAGS |
293 |
+ local abiver=$(cd "${ED}/usr/include"; echo python*) |
294 |
+ if [[ ${abiver} != python${PYVER} ]]; then |
295 |
+ # Replace python3.X with a symlink to python3.Xm |
296 |
+ rm "${ED}/usr/bin/python${PYVER}" || die |
297 |
+ dosym "${abiver}" "/usr/bin/python${PYVER}" |
298 |
+ # Create python3.X-config symlink |
299 |
+ dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" |
300 |
+ # Create python-3.5m.pc symlink |
301 |
+ dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" |
302 |
+ fi |
303 |
+ |
304 |
+ # python seems to get rebuilt in src_install (bug 569908) |
305 |
+ # Work around it for now. |
306 |
+ if has_version dev-libs/libffi[pax-kernel]; then |
307 |
+ pax-mark E "${ED}/usr/bin/${abiver}" |
308 |
+ else |
309 |
+ pax-mark m "${ED}/usr/bin/${abiver}" |
310 |
+ fi |
311 |
+ |
312 |
+ use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die |
313 |
+ use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die |
314 |
+ |
315 |
+ use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die |
316 |
+ |
317 |
+ dodoc Misc/{ACKS,HISTORY,NEWS} |
318 |
+ |
319 |
+ if use examples; then |
320 |
+ docinto examples |
321 |
+ find Tools -name __pycache__ -exec rm -fr {} + || die |
322 |
+ dodoc -r Tools |
323 |
+ fi |
324 |
+ insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 |
325 |
+ local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ |
326 |
+ emake --no-print-directory -s -f - 2>/dev/null) |
327 |
+ newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py |
328 |
+ |
329 |
+ newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER} |
330 |
+ newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER} |
331 |
+ sed \ |
332 |
+ -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \ |
333 |
+ -e "s:@PYDOC@:pydoc${PYVER}:" \ |
334 |
+ -i "${ED}/etc/conf.d/pydoc-${PYVER}" \ |
335 |
+ "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed" |
336 |
+ |
337 |
+ local -x EPYTHON=python${PYVER} |
338 |
+ # if not using a cross-compiler, use the fresh binary |
339 |
+ if ! tc-is-cross-compiler; then |
340 |
+ local -x PYTHON=./python |
341 |
+ local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD} |
342 |
+ else |
343 |
+ local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON} |
344 |
+ fi |
345 |
+ |
346 |
+ echo "EPYTHON='${EPYTHON}'" > epython.py || die |
347 |
+ python_domodule epython.py |
348 |
+ |
349 |
+ # python-exec wrapping support |
350 |
+ local pymajor=${PYVER%.*} |
351 |
+ local scriptdir=${D}$(python_get_scriptdir) |
352 |
+ mkdir -p "${scriptdir}" || die |
353 |
+ # python and pythonX |
354 |
+ ln -s "../../../bin/${abiver}" \ |
355 |
+ "${scriptdir}/python${pymajor}" || die |
356 |
+ ln -s "python${pymajor}" "${scriptdir}/python" || die |
357 |
+ # python-config and pythonX-config |
358 |
+ # note: we need to create a wrapper rather than symlinking it due |
359 |
+ # to some random dirname(argv[0]) magic performed by python-config |
360 |
+ cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die |
361 |
+ #!/bin/sh |
362 |
+ exec "${abiver}-config" "\${@}" |
363 |
+ EOF |
364 |
+ chmod +x "${scriptdir}/python${pymajor}-config" || die |
365 |
+ ln -s "python${pymajor}-config" \ |
366 |
+ "${scriptdir}/python-config" || die |
367 |
+ # 2to3, pydoc |
368 |
+ ln -s "../../../bin/2to3-${PYVER}" \ |
369 |
+ "${scriptdir}/2to3" || die |
370 |
+ ln -s "../../../bin/pydoc${PYVER}" \ |
371 |
+ "${scriptdir}/pydoc" || die |
372 |
+ # idle |
373 |
+ if use tk; then |
374 |
+ ln -s "../../../bin/idle${PYVER}" \ |
375 |
+ "${scriptdir}/idle" || die |
376 |
+ fi |
377 |
+} |