1 |
commit: a2d1cdb2db642d519b5205d86a7569e09de377ec |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jun 29 06:10:24 2021 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jun 29 06:20:24 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a2d1cdb2 |
7 |
|
8 |
dev-lang/python: Bump to 3.8.11 |
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.11.ebuild | 336 +++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 339 insertions(+) |
15 |
|
16 |
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest |
17 |
index 86247b8d8d5..7064807054d 100644 |
18 |
--- a/dev-lang/python/Manifest |
19 |
+++ b/dev-lang/python/Manifest |
20 |
@@ -10,6 +10,8 @@ DIST Python-3.7.10.tar.xz 17392580 BLAKE2B b030db731d141b97f1be794a19382cc252c5b |
21 |
DIST Python-3.7.10.tar.xz.asc 833 BLAKE2B a528daa1638b52f08fd69d197a2d4f8af59a620939957d450da6f5f8947b8eefbfb48ee50bb6327c8f3a352415dedc6e91ef23075fabbfd38c65575857065c74 SHA512 5d0fdcf60f0f4113b3055dd4097814b8b969d6cba4f2cc4cef6cd013b0e728375549b9d7818e6e94e6f0d4888188e751f4659a18f905e6e4c75783e2f323c4ef |
22 |
DIST Python-3.8.10.tar.xz 18433456 BLAKE2B 57318da9ca049559594911a8873141f89d40c0326f8f278ef47b64195a0d51400f24f91dc68633d628f99dc0a9e280565ff830df66801afbc8734593d0fc3162 SHA512 0be69705483ff9692e12048a96180e586f9d84c8d53066629f7fb2389585eb75c0f3506bb8182936e322508f58b71f4d8c6dfebbab9049b31b49da11d3b98e80 |
23 |
DIST Python-3.8.10.tar.xz.asc 833 BLAKE2B ab1ea0d26f51bc3b88ef5130238f7695bd12383193d1f312b000e997e48beb63f75787a3545b7b635ef515e4896e6ec2994cce564126f3b698495a51f5e34038 SHA512 ebc363df372031aba9c547b4929c98e5065ecf53604897a83df134dfbf7c3f3e9e0de1c072bee2e7c2f4db0f90610fa3931ed6d5a5ed877ab15712becd63deaf |
24 |
+DIST Python-3.8.11.tar.xz 18437648 BLAKE2B 957c553ced3387d19c1d1baf2eea7d41e9abfbf398c4514f475eadae29336dc02dbd2cdf7b90ab5fee1e49c083a366c113dcd73149445b663fcdf81a3b2b04f6 SHA512 c8c17491b05d83a9f8940474019034780a6b1ff4148654cd62c8f708c539718a0312cf0665efa2b8c42ed773f4306080bd105701a211ed56e6cab40837d5b2df |
25 |
+DIST Python-3.8.11.tar.xz.asc 833 BLAKE2B 52239149331a6529351714db10b5f6b2a37e9a9ce13470e0ab8ae4bf439544878df095995bdc28a534d55039a539c400f532aec8fb7d9b9ce7132167f0e39529 SHA512 40381e83a1bef996333d5044a361ce441c4631725457f8382588e9a86f586a9539ee139b8398aff3d988a317041fa87476f29cf6fcd2b31fe0e9b4cd21ede68a |
26 |
DIST Python-3.9.5.tar.xz 19058600 BLAKE2B 0072376ac69728436ee422da58c1680170cd60c76ac7d623d7a29c9001e6acace1a8d75a1805e65c9b11a30c55c9e67ed66712ec22b0b94ee6873995c935141d SHA512 7b581af1b3e73695f124ff6a3a960e22104153a5d920ca930c046f42ea313b1e7ec77e39876db2bf5d5da6d7412cb072ff8ae7814dda12c14f9da6c570fb0995 |
27 |
DIST Python-3.9.5.tar.xz.asc 833 BLAKE2B d044e2019edc4854db22eebda182528e88a0c4d71cc17b78e603b43191a882f176a9fa46549845ee09ff9aa56ddf69efa008cd7ae3040b24fed7956c52bb11e9 SHA512 cfee8c161447544d6f18c3490b96ce12c8df5e9b143fca09734066f3606abe767cd7b4d05315c691f41c0e565d9585456774c10770ffe2ef7983a911bbcfdb83 |
28 |
DIST Python-3.9.6.tar.xz 19051972 BLAKE2B 0d8586b2935088eeab7138cf2210c1a74f1bf7359359d25750af5f69de55eb39c92f518b887a8b749c772ed7d33e85b912928ae6d878514eb58d85ef210f54f0 SHA512 01c529e3207738d8771caeb5ed6217e10745c21aa39832fe3185e1c87fdb6aedead97ce38dbb11e02d873654028bd8071c3f345c18452769520723284efe9dc1 |
29 |
@@ -21,5 +23,6 @@ DIST python-gentoo-patches-3.10.0b3.tar.xz 8112 BLAKE2B c6a0517323c5c0d8af998915 |
30 |
DIST python-gentoo-patches-3.6.13_p5.tar.xz 21940 BLAKE2B f6753f2c4383fbf0de0433040dae812f35bf550c60ac4a042c62afcff158619ebdc47d013dfa62d9b3dd446e8401ad50aaaeb212fb048a884a1c436b73b7afe2 SHA512 260d6abb2c24726fcddbe3ae828e96e315f90b6d486c11868066a25635968214a8c25a89737a9737c32ca110892a28f6b12badbeceb5e4d8d4a2a996b3ce7352 |
31 |
DIST python-gentoo-patches-3.7.10_p6.tar.xz 23868 BLAKE2B 3b3786030a461d06a96dbe0987d05c35215bb5e7b0b95e1337a05a311ad6f3c6db68cc7082128c56eea3eff4b98f74d213dde1f48517e07791815b73dcdcd5b8 SHA512 b817a9bc1469675c14555ce50bb004e8c1426465997a72a94859ab10df7c2a036b33b332c9e6b9f49df1addd899a37afd28fe60bf6ce90b4b21f4a28a27aca25 |
32 |
DIST python-gentoo-patches-3.8.10_p2.tar.xz 20288 BLAKE2B 4d9db5c8d5c27673d5a026149e5678c2b4072d6d0326ae015bf4fd5b5065beeff0cd6ee0a061f79ab3258d3d156d555a38cbdca2e5e05b4405038847dcc97c8e SHA512 165a4e3b537538e792a98141a8e4af6b5cde369e6322155731ecb1b55d0e609f06208d88d68dbb1fbe59a5127ae7ac49d76d8fb6505ccf835931b2a802cd85de |
33 |
+DIST python-gentoo-patches-3.8.11.tar.xz 16932 BLAKE2B aaa1df33997f4077916fb7cca2ec3a2b2ac1c0ead3db7c638a5152a82cfaaf5fc2768a10ac7235c417e25b2b735c53628ec096878f08eef0d211b03f4747103c SHA512 d2639b95c5a32f7145f92e52a94aec7c63f3ed4a66036ff73f052ff6836742d1e1dd7180f8634b65b4a44a10bf336092695bcc2230a7fd8be35bae870ed64b08 |
34 |
DIST python-gentoo-patches-3.9.5_p2.tar.xz 14728 BLAKE2B b6b0a0c316d99e8282bdbb5e62a90f84880ff89b0b1e236a5bce37fbdd3c3b187f7964873882dbcbc8c9765af107377240e8aac544987452830f0069aff471c0 SHA512 42e4dd48f4b93bd45a70093b447b4862ab286c1b5adc32d22a3e3d08e67db13bfa829bdbcf989fac9b7c8634a4735cfb4a7b16bfc40bdff0c11bc5a768bbeaf8 |
35 |
DIST python-gentoo-patches-3.9.6.tar.xz 12432 BLAKE2B f63f39b4667eeb214312aa22142c728a1123e88f49c6de09d15e88434e9d630c5e0e588112d77c5cf1f5f25d0224e4fbf0c370488a908e9015f168d9f85e9eb5 SHA512 3e842fcd8574a7f026e401d725febb2815b2b7ac0a89b952a340c7974b911e81286b542d3de56fe5750296f2ab680415b54b8c35f219975af10354cddb1f257a |
36 |
|
37 |
diff --git a/dev-lang/python/python-3.8.11.ebuild b/dev-lang/python/python-3.8.11.ebuild |
38 |
new file mode 100644 |
39 |
index 00000000000..0a87aec9180 |
40 |
--- /dev/null |
41 |
+++ b/dev-lang/python/python-3.8.11.ebuild |
42 |
@@ -0,0 +1,336 @@ |
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:= ) |
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 |
+PDEPEND="app-eselect/eselect-python" |
106 |
+RDEPEND+=" !build? ( app-misc/mime-types )" |
107 |
+ |
108 |
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/python.org.asc |
109 |
+ |
110 |
+src_unpack() { |
111 |
+ if use verify-sig; then |
112 |
+ verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc} |
113 |
+ fi |
114 |
+ default |
115 |
+} |
116 |
+ |
117 |
+src_prepare() { |
118 |
+ # Ensure that internal copies of expat, libffi and zlib are not used. |
119 |
+ rm -fr Modules/expat || die |
120 |
+ rm -fr Modules/_ctypes/libffi* || die |
121 |
+ rm -fr Modules/zlib || die |
122 |
+ |
123 |
+ local PATCHES=( |
124 |
+ "${WORKDIR}/${PATCHSET}" |
125 |
+ ) |
126 |
+ |
127 |
+ default |
128 |
+ |
129 |
+ sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ |
130 |
+ setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" |
131 |
+ |
132 |
+ # force correct number of jobs |
133 |
+ # https://bugs.gentoo.org/737660 |
134 |
+ local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") |
135 |
+ sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die |
136 |
+ sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die |
137 |
+ |
138 |
+ eautoreconf |
139 |
+} |
140 |
+ |
141 |
+src_configure() { |
142 |
+ local disable |
143 |
+ # disable automagic bluetooth headers detection |
144 |
+ use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no |
145 |
+ use gdbm || disable+=" gdbm" |
146 |
+ use ncurses || disable+=" _curses _curses_panel" |
147 |
+ use readline || disable+=" readline" |
148 |
+ use sqlite || disable+=" _sqlite3" |
149 |
+ use ssl || export PYTHON_DISABLE_SSL="1" |
150 |
+ use tk || disable+=" _tkinter" |
151 |
+ use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. |
152 |
+ export PYTHON_DISABLE_MODULES="${disable}" |
153 |
+ |
154 |
+ if ! use xml; then |
155 |
+ ewarn "You have configured Python without XML support." |
156 |
+ ewarn "This is NOT a recommended configuration as you" |
157 |
+ ewarn "may face problems parsing any XML documents." |
158 |
+ fi |
159 |
+ |
160 |
+ if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then |
161 |
+ einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" |
162 |
+ fi |
163 |
+ |
164 |
+ if [[ "$(gcc-major-version)" -ge 4 ]]; then |
165 |
+ append-flags -fwrapv |
166 |
+ fi |
167 |
+ |
168 |
+ filter-flags -malign-double |
169 |
+ |
170 |
+ # https://bugs.gentoo.org/show_bug.cgi?id=50309 |
171 |
+ if is-flagq -O3; then |
172 |
+ is-flagq -fstack-protector-all && replace-flags -O3 -O2 |
173 |
+ use hardened && replace-flags -O3 -O2 |
174 |
+ fi |
175 |
+ |
176 |
+ # https://bugs.gentoo.org/700012 |
177 |
+ if is-flagq -flto || is-flagq '-flto=*'; then |
178 |
+ append-cflags $(test-flags-CC -ffat-lto-objects) |
179 |
+ fi |
180 |
+ |
181 |
+ # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. |
182 |
+ tc-export CXX |
183 |
+ |
184 |
+ # Fix implicit declarations on cross and prefix builds. Bug #674070. |
185 |
+ use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw |
186 |
+ |
187 |
+ local dbmliborder |
188 |
+ if use gdbm; then |
189 |
+ dbmliborder+="${dbmliborder:+:}gdbm" |
190 |
+ fi |
191 |
+ |
192 |
+ local myeconfargs=( |
193 |
+ # glibc-2.30 removes it; since we can't cleanly force-rebuild |
194 |
+ # Python on glibc upgrade, remove it proactively to give |
195 |
+ # a chance for users rebuilding python before glibc |
196 |
+ ac_cv_header_stropts_h=no |
197 |
+ |
198 |
+ --enable-shared |
199 |
+ $(use_enable ipv6) |
200 |
+ --infodir='${prefix}/share/info' |
201 |
+ --mandir='${prefix}/share/man' |
202 |
+ --with-computed-gotos |
203 |
+ --with-dbmliborder="${dbmliborder}" |
204 |
+ --with-libc= |
205 |
+ --enable-loadable-sqlite-extensions |
206 |
+ --without-ensurepip |
207 |
+ --with-system-expat |
208 |
+ --with-system-ffi |
209 |
+ ) |
210 |
+ |
211 |
+ OPT="" econf "${myeconfargs[@]}" |
212 |
+ |
213 |
+ if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then |
214 |
+ eerror "configure has detected that the sem_open function is broken." |
215 |
+ eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." |
216 |
+ die "Broken sem_open function (bug 496328)" |
217 |
+ fi |
218 |
+} |
219 |
+ |
220 |
+src_compile() { |
221 |
+ # Ensure sed works as expected |
222 |
+ # https://bugs.gentoo.org/594768 |
223 |
+ local -x LC_ALL=C |
224 |
+ |
225 |
+ emake CPPFLAGS= CFLAGS= LDFLAGS= |
226 |
+ |
227 |
+ # Work around bug 329499. See also bug 413751 and 457194. |
228 |
+ if has_version dev-libs/libffi[pax_kernel]; then |
229 |
+ pax-mark E python |
230 |
+ else |
231 |
+ pax-mark m python |
232 |
+ fi |
233 |
+} |
234 |
+ |
235 |
+src_test() { |
236 |
+ # Tests will not work when cross compiling. |
237 |
+ if tc-is-cross-compiler; then |
238 |
+ elog "Disabling tests due to crosscompiling." |
239 |
+ return |
240 |
+ fi |
241 |
+ |
242 |
+ # Skip failing tests. |
243 |
+ local skipped_tests="gdb" |
244 |
+ |
245 |
+ for test in ${skipped_tests}; do |
246 |
+ mv "${S}"/Lib/test/test_${test}.py "${T}" |
247 |
+ done |
248 |
+ |
249 |
+ # bug 660358 |
250 |
+ local -x COLUMNS=80 |
251 |
+ local -x PYTHONDONTWRITEBYTECODE= |
252 |
+ |
253 |
+ local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") |
254 |
+ |
255 |
+ emake test EXTRATESTOPTS="-u-network -j${jobs}" \ |
256 |
+ CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty |
257 |
+ local result=$? |
258 |
+ |
259 |
+ for test in ${skipped_tests}; do |
260 |
+ mv "${T}/test_${test}.py" "${S}"/Lib/test |
261 |
+ done |
262 |
+ |
263 |
+ elog "The following tests have been skipped:" |
264 |
+ for test in ${skipped_tests}; do |
265 |
+ elog "test_${test}.py" |
266 |
+ done |
267 |
+ |
268 |
+ elog "If you would like to run them, you may:" |
269 |
+ elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'" |
270 |
+ elog "and run the tests separately." |
271 |
+ |
272 |
+ if [[ ${result} -ne 0 ]]; then |
273 |
+ die "emake test failed" |
274 |
+ fi |
275 |
+} |
276 |
+ |
277 |
+src_install() { |
278 |
+ local libdir=${ED}/usr/lib/python${PYVER} |
279 |
+ |
280 |
+ emake DESTDIR="${D}" altinstall |
281 |
+ |
282 |
+ # Remove static library |
283 |
+ rm "${ED}"/usr/$(get_libdir)/libpython*.a || die |
284 |
+ |
285 |
+ sed \ |
286 |
+ -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \ |
287 |
+ -e "s/\(PY_LDFLAGS=\).*/\1/" \ |
288 |
+ -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed" |
289 |
+ |
290 |
+ # Fix collisions between different slots of Python. |
291 |
+ rm "${ED}/usr/$(get_libdir)/libpython3.so" || die |
292 |
+ |
293 |
+ # Cheap hack to get version with ABIFLAGS |
294 |
+ local abiver=$(cd "${ED}/usr/include"; echo python*) |
295 |
+ if [[ ${abiver} != python${PYVER} ]]; then |
296 |
+ # Replace python3.X with a symlink to python3.Xm |
297 |
+ rm "${ED}/usr/bin/python${PYVER}" || die |
298 |
+ dosym "${abiver}" "/usr/bin/python${PYVER}" |
299 |
+ # Create python3.X-config symlink |
300 |
+ dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" |
301 |
+ # Create python-3.5m.pc symlink |
302 |
+ dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" |
303 |
+ fi |
304 |
+ |
305 |
+ # python seems to get rebuilt in src_install (bug 569908) |
306 |
+ # Work around it for now. |
307 |
+ if has_version dev-libs/libffi[pax_kernel]; then |
308 |
+ pax-mark E "${ED}/usr/bin/${abiver}" |
309 |
+ else |
310 |
+ pax-mark m "${ED}/usr/bin/${abiver}" |
311 |
+ fi |
312 |
+ |
313 |
+ use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die |
314 |
+ use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die |
315 |
+ |
316 |
+ use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die |
317 |
+ |
318 |
+ dodoc Misc/{ACKS,HISTORY,NEWS} |
319 |
+ |
320 |
+ if use examples; then |
321 |
+ docinto examples |
322 |
+ find Tools -name __pycache__ -exec rm -fr {} + || die |
323 |
+ dodoc -r Tools |
324 |
+ fi |
325 |
+ insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 |
326 |
+ local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ |
327 |
+ emake --no-print-directory -s -f - 2>/dev/null) |
328 |
+ newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py |
329 |
+ |
330 |
+ newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER} |
331 |
+ newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER} |
332 |
+ sed \ |
333 |
+ -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \ |
334 |
+ -e "s:@PYDOC@:pydoc${PYVER}:" \ |
335 |
+ -i "${ED}/etc/conf.d/pydoc-${PYVER}" \ |
336 |
+ "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed" |
337 |
+ |
338 |
+ local -x EPYTHON=python${PYVER} |
339 |
+ # if not using a cross-compiler, use the fresh binary |
340 |
+ if ! tc-is-cross-compiler; then |
341 |
+ local -x PYTHON=./python |
342 |
+ local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD} |
343 |
+ else |
344 |
+ local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON} |
345 |
+ fi |
346 |
+ |
347 |
+ echo "EPYTHON='${EPYTHON}'" > epython.py || die |
348 |
+ python_domodule epython.py |
349 |
+ |
350 |
+ # python-exec wrapping support |
351 |
+ local pymajor=${PYVER%.*} |
352 |
+ local scriptdir=${D}$(python_get_scriptdir) |
353 |
+ mkdir -p "${scriptdir}" || die |
354 |
+ # python and pythonX |
355 |
+ ln -s "../../../bin/${abiver}" \ |
356 |
+ "${scriptdir}/python${pymajor}" || die |
357 |
+ ln -s "python${pymajor}" "${scriptdir}/python" || die |
358 |
+ # python-config and pythonX-config |
359 |
+ # note: we need to create a wrapper rather than symlinking it due |
360 |
+ # to some random dirname(argv[0]) magic performed by python-config |
361 |
+ cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die |
362 |
+ #!/bin/sh |
363 |
+ exec "${abiver}-config" "\${@}" |
364 |
+ EOF |
365 |
+ chmod +x "${scriptdir}/python${pymajor}-config" || die |
366 |
+ ln -s "python${pymajor}-config" \ |
367 |
+ "${scriptdir}/python-config" || die |
368 |
+ # 2to3, pydoc |
369 |
+ ln -s "../../../bin/2to3-${PYVER}" \ |
370 |
+ "${scriptdir}/2to3" || die |
371 |
+ ln -s "../../../bin/pydoc${PYVER}" \ |
372 |
+ "${scriptdir}/pydoc" || die |
373 |
+ # idle |
374 |
+ if use tk; then |
375 |
+ ln -s "../../../bin/idle${PYVER}" \ |
376 |
+ "${scriptdir}/idle" || die |
377 |
+ fi |
378 |
+} |