1 |
commit: b8a62a1b1c458eaf5accece20f657432e75dbb30 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu May 14 06:13:22 2020 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu May 14 06:13:22 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b8a62a1b |
7 |
|
8 |
dev-lang/python: Bump to 3.8.3 |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
dev-lang/python/Manifest | 2 + |
13 |
dev-lang/python/python-3.8.3.ebuild | 346 ++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 348 insertions(+) |
15 |
|
16 |
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest |
17 |
index 307f2a9b212..219b643cbf3 100644 |
18 |
--- a/dev-lang/python/Manifest |
19 |
+++ b/dev-lang/python/Manifest |
20 |
@@ -3,6 +3,7 @@ DIST Python-2.7.18.tar.xz 12854736 BLAKE2B 060a621c91dd8e3d321aec99d44c17aa67381 |
21 |
DIST Python-3.6.10.tar.xz 17212220 BLAKE2B 822e231cf2755e6477e49e9128a983185a4f1e30e9d6c221f1b5720891c0de345e8c5402af458d3627eba124e75fea4b5daa94e01b0eaddc116dc3281263ecbe SHA512 26147099e1f1a0ffc85febad26e18e991f019599a150887ea0b925e34663fad8e03b3c2a941e2770c1a63960695e173ef32709572c9361e7f2cb862ccf75b28a |
22 |
DIST Python-3.7.7.tar.xz 17268888 BLAKE2B 5f16c9559249470a9e6c0aa686965e7d78ce0f7364b5d03fc9590613c7a5456f92835340e49bf9becbec18b18d1e5a6fc318b6e30f2349da3246a918cf8b05ff SHA512 ddc838a7b0c442c2e465616f20231f2b703ed6b69ed2dc17858aac8760814fdf7cff43d350d359300e47b6bb1f0bd38c31126b855e423a3a65ed06a8fa16d136 |
23 |
DIST Python-3.8.2.tar.xz 17869888 BLAKE2B f42b35bea5e65f1f0a3fa6f1fd3d749fba3fa46d958608a314c1a98d0e3ca890e856da4d40ee489fe546fc02ce0fc9fa2daaaba96a8928d92ae7eb3d2dda3fe4 SHA512 ca37ad0e7c5845f5f228566aa8ff654a8f428c7d4a5aaabff29baebb0ca3219b31ba8bb2607f89e37cf3fc564f023b8407e53a4f2c47bd99122c1cc222613e37 |
24 |
+DIST Python-3.8.3.tar.xz 17912964 BLAKE2B 9c415823f70bad97936e0472fc53a1b7650cbf0082da714266095dec74e0cd4a48c9477ad03fbb75fdc2cd8e41ef3aa5839e38fc69751720f5cb5c7fc77cce17 SHA512 3103bd8d944f3905eee3a2b52fd1f5c7dee380f9c5a99ad35a401fcba5a9117c3860ecec5cb47a92712c6549442fd2fa553a15c5657241dd09f5d00b9ed4f0f4 |
25 |
DIST Python-3.9.0a6.tar.xz 18202376 BLAKE2B 32f04613a3b11341759eb98fd4b16edcb890a9ce19a4d5031aecdccd985a5462248fcd0e7bf478e2f23490ad85b36c760c14398f2b238e26038a476831f004d2 SHA512 edb71840347ab2b5e18b3a2b831a3d9a26e1af52de9b1c6c088ce2d20f8e96a22c87fc3677b62e49c91a00d8b531028bdc739f00fe220dbdeb343daf17829be4 |
26 |
DIST python-gentoo-patches-2.7.17-r1.tar.xz 14708 BLAKE2B f6e25236a471649de122d0f29506f7a4f34044a568ead47a68980411d9722b761fe1f9d653d5edccb6978b65c8c1eecbef55f403b94f32b37c0ad68e061505a8 SHA512 ecdde5e38c6fe5e69691fb3a68c8f4f43da7857d4abaff763d3cf6ad864ba43c769c03b186b60f2736a1ffb1e3e4c9982715d1b8a99ff3f5740096153bb8a90f |
27 |
DIST python-gentoo-patches-2.7.18.tar.xz 15012 BLAKE2B f691e231c793bb8f11fb64c89b90e022af8e0fe0e28839822c2ae6214fdab6c6fd9c07466c4b5797d3964b7db09fd979597774fb7872dc674e8df59321b6bf95 SHA512 a2952b27bfc0a52f322b2f3e177cbe09fa288c9ca5967c13fb9c2d45d3e81033407e30e86bdaaaa258f0b3cfa2cef6eda5502bddb6390f9512a493d145d34e03 |
28 |
@@ -12,4 +13,5 @@ DIST python-gentoo-patches-3.7.6.tar.xz 10084 BLAKE2B 220869e85bdaf9c21b1b05e138 |
29 |
DIST python-gentoo-patches-3.7.7.tar.xz 14644 BLAKE2B 1a377eac945310082ec9fa257bcb406c7eaf24b5e80469dd49e82a1bc0554b75394678609cae447cb0fc7a19059b29166bf110b6ed99a89a9919b3a56a323f87 SHA512 2c7fbcefd6f4d1674b78f3b67f2be3f1b168e08c318fefe8d4757f2d30c22477f5010ad6f2c0abb265d819ee667617f21f93e002242e216b4ee570200b0ddf74 |
30 |
DIST python-gentoo-patches-3.8.1-r2.tar.xz 10108 BLAKE2B 02d3e2ae95b5cfa67c0ba4ff618fbee51d2342955d0a064b80575beda73902bd72462e4f6dba63743bf9fc031d92c69153ef8bd8a0ab5d6e17bfdf8ed0152da5 SHA512 757f7cf6b0cb6c1493d8ed8e5780780efcb32860a9aeba4f933a3a3fb22c412bebde8854e34609465d8a12cb9545a7b19e5d5dbe87d772bb83acd9fe829b75cc |
31 |
DIST python-gentoo-patches-3.8.2-r1.tar.xz 16112 BLAKE2B 9ae197a56bbd96afa11c4312c68ac030138773df22dedc3a3e6fb9e81b366d6522fb2c147946eb604a87d749cbea7e5e5eed8ae0e737294c0949a8c2791dd327 SHA512 00f31c3b7227dd443f05234fbb7744338ce687e1ea4d236a6b1d386d76082acb34259f59442018c9ace54e0004dea9ac822ae2a4470159b83d00112e258baff0 |
32 |
+DIST python-gentoo-patches-3.8.3.tar.xz 10704 BLAKE2B 6fdd13139b1132313153af2de774abeca7c1fe9acb34a87e5d96875a4cbe8c22c201acbb11c15eeaf828493c32f6acd89e3b5d4012fa2c9d216da556aadb9f01 SHA512 6f67d77e8240983c0dd749620e5df81df5816b831032e190c82c8d73ea8a995daf2631640234a1350e483bd13276466457d110176612bfde3281d1b6a8bf97bb |
33 |
DIST python-gentoo-patches-3.9.0_alpha6.tar.xz 8916 BLAKE2B ca611dd96e6fca625def6affeb35daa1c869ffa3b84bd13d5cc2dff7ffe4e0aaf4a76b3ed35d4520fe64f1905a644ecc2dcd80259f88264adeff926d728df76e SHA512 b3cd6619d998db8c828fc05eeba74d644ead60d34c279943725ea94ee9e5d45a07d481af62b8589336c55bb8baa23d6559aa57a73d11bf2364b6e9b839e0a4be |
34 |
|
35 |
diff --git a/dev-lang/python/python-3.8.3.ebuild b/dev-lang/python/python-3.8.3.ebuild |
36 |
new file mode 100644 |
37 |
index 00000000000..c1cb51ab328 |
38 |
--- /dev/null |
39 |
+++ b/dev-lang/python/python-3.8.3.ebuild |
40 |
@@ -0,0 +1,346 @@ |
41 |
+# Copyright 1999-2020 Gentoo Authors |
42 |
+# Distributed under the terms of the GNU General Public License v2 |
43 |
+ |
44 |
+EAPI="7" |
45 |
+WANT_LIBTOOL="none" |
46 |
+ |
47 |
+inherit autotools flag-o-matic pax-utils python-utils-r1 toolchain-funcs |
48 |
+ |
49 |
+MY_P="Python-${PV}" |
50 |
+PYVER=$(ver_cut 1-2) |
51 |
+PATCHSET="python-gentoo-patches-3.8.3" |
52 |
+ |
53 |
+DESCRIPTION="An interpreted, interactive, object-oriented programming language" |
54 |
+HOMEPAGE="https://www.python.org/" |
55 |
+SRC_URI="https://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz |
56 |
+ https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz" |
57 |
+S="${WORKDIR}/${MY_P}" |
58 |
+ |
59 |
+LICENSE="PSF-2" |
60 |
+SLOT="${PYVER}" |
61 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" |
62 |
+IUSE="bluetooth build examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test tk wininst +xml" |
63 |
+RESTRICT="!test? ( test )" |
64 |
+ |
65 |
+# Do not add a dependency on dev-lang/python to this ebuild. |
66 |
+# If you need to apply a patch which requires python for bootstrapping, please |
67 |
+# run the bootstrap code on your dev box and include the results in the |
68 |
+# patchset. See bug 447752. |
69 |
+ |
70 |
+RDEPEND="app-arch/bzip2:= |
71 |
+ app-arch/xz-utils:= |
72 |
+ dev-libs/libffi:= |
73 |
+ sys-apps/util-linux:= |
74 |
+ >=sys-libs/zlib-1.1.3:= |
75 |
+ virtual/libcrypt:= |
76 |
+ virtual/libintl |
77 |
+ gdbm? ( sys-libs/gdbm:=[berkdb] ) |
78 |
+ ncurses? ( >=sys-libs/ncurses-5.2:= ) |
79 |
+ readline? ( >=sys-libs/readline-4.1:= ) |
80 |
+ sqlite? ( >=dev-db/sqlite-3.3.8:3= ) |
81 |
+ ssl? ( |
82 |
+ !libressl? ( dev-libs/openssl:= ) |
83 |
+ libressl? ( dev-libs/libressl:= ) |
84 |
+ ) |
85 |
+ tk? ( |
86 |
+ >=dev-lang/tcl-8.0:= |
87 |
+ >=dev-lang/tk-8.0:= |
88 |
+ dev-tcltk/blt:= |
89 |
+ dev-tcltk/tix |
90 |
+ ) |
91 |
+ xml? ( >=dev-libs/expat-2.1:= )" |
92 |
+# bluetooth requires headers from bluez |
93 |
+DEPEND="${RDEPEND} |
94 |
+ bluetooth? ( net-wireless/bluez ) |
95 |
+ test? ( app-arch/xz-utils[extra-filters(+)] ) |
96 |
+ virtual/pkgconfig |
97 |
+ !sys-devel/gcc[libffi(-)]" |
98 |
+RDEPEND+=" !build? ( app-misc/mime-types )" |
99 |
+PDEPEND=">=app-eselect/eselect-python-20140125-r1" |
100 |
+ |
101 |
+src_prepare() { |
102 |
+ # Ensure that internal copies of expat, libffi and zlib are not used. |
103 |
+ rm -fr Modules/expat || die |
104 |
+ rm -fr Modules/_ctypes/libffi* || die |
105 |
+ rm -fr Modules/zlib || die |
106 |
+ |
107 |
+ local PATCHES=( |
108 |
+ "${WORKDIR}/${PATCHSET}" |
109 |
+ ) |
110 |
+ |
111 |
+ default |
112 |
+ |
113 |
+ sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ |
114 |
+ setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" |
115 |
+ |
116 |
+ eautoreconf |
117 |
+} |
118 |
+ |
119 |
+src_configure() { |
120 |
+ local disable |
121 |
+ # disable automagic bluetooth headers detection |
122 |
+ use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no |
123 |
+ use gdbm || disable+=" gdbm" |
124 |
+ use ncurses || disable+=" _curses _curses_panel" |
125 |
+ use readline || disable+=" readline" |
126 |
+ use sqlite || disable+=" _sqlite3" |
127 |
+ use ssl || export PYTHON_DISABLE_SSL="1" |
128 |
+ use tk || disable+=" _tkinter" |
129 |
+ use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. |
130 |
+ export PYTHON_DISABLE_MODULES="${disable}" |
131 |
+ |
132 |
+ if ! use xml; then |
133 |
+ ewarn "You have configured Python without XML support." |
134 |
+ ewarn "This is NOT a recommended configuration as you" |
135 |
+ ewarn "may face problems parsing any XML documents." |
136 |
+ fi |
137 |
+ |
138 |
+ if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then |
139 |
+ einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" |
140 |
+ fi |
141 |
+ |
142 |
+ if [[ "$(gcc-major-version)" -ge 4 ]]; then |
143 |
+ append-flags -fwrapv |
144 |
+ fi |
145 |
+ |
146 |
+ filter-flags -malign-double |
147 |
+ |
148 |
+ # https://bugs.gentoo.org/show_bug.cgi?id=50309 |
149 |
+ if is-flagq -O3; then |
150 |
+ is-flagq -fstack-protector-all && replace-flags -O3 -O2 |
151 |
+ use hardened && replace-flags -O3 -O2 |
152 |
+ fi |
153 |
+ |
154 |
+ # https://bugs.gentoo.org/700012 |
155 |
+ if is-flagq -flto || is-flagq '-flto=*'; then |
156 |
+ append-cflags $(test-flags-CC -ffat-lto-objects) |
157 |
+ fi |
158 |
+ |
159 |
+ # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. |
160 |
+ tc-export CXX |
161 |
+ |
162 |
+ # Set LDFLAGS so we link modules with -lpython3.2 correctly. |
163 |
+ # Needed on FreeBSD unless Python 3.2 is already installed. |
164 |
+ # Please query BSD team before removing this! |
165 |
+ append-ldflags "-L." |
166 |
+ |
167 |
+ # Fix implicit declarations on cross and prefix builds. Bug #674070. |
168 |
+ use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw |
169 |
+ |
170 |
+ local dbmliborder |
171 |
+ if use gdbm; then |
172 |
+ dbmliborder+="${dbmliborder:+:}gdbm" |
173 |
+ fi |
174 |
+ |
175 |
+ local myeconfargs=( |
176 |
+ # glibc-2.30 removes it; since we can't cleanly force-rebuild |
177 |
+ # Python on glibc upgrade, remove it proactively to give |
178 |
+ # a chance for users rebuilding python before glibc |
179 |
+ ac_cv_header_stropts_h=no |
180 |
+ |
181 |
+ --enable-shared |
182 |
+ $(use_enable ipv6) |
183 |
+ --infodir='${prefix}/share/info' |
184 |
+ --mandir='${prefix}/share/man' |
185 |
+ --with-computed-gotos |
186 |
+ --with-dbmliborder="${dbmliborder}" |
187 |
+ --with-libc= |
188 |
+ --enable-loadable-sqlite-extensions |
189 |
+ --without-ensurepip |
190 |
+ --with-system-expat |
191 |
+ --with-system-ffi |
192 |
+ ) |
193 |
+ |
194 |
+ OPT="" econf "${myeconfargs[@]}" |
195 |
+} |
196 |
+ |
197 |
+src_compile() { |
198 |
+ # Ensure sed works as expected |
199 |
+ # https://bugs.gentoo.org/594768 |
200 |
+ local -x LC_ALL=C |
201 |
+ |
202 |
+ emake CPPFLAGS= CFLAGS= LDFLAGS= |
203 |
+ |
204 |
+ # Work around bug 329499. See also bug 413751 and 457194. |
205 |
+ if has_version dev-libs/libffi[pax_kernel]; then |
206 |
+ pax-mark E python |
207 |
+ else |
208 |
+ pax-mark m python |
209 |
+ fi |
210 |
+} |
211 |
+ |
212 |
+src_test() { |
213 |
+ # Tests will not work when cross compiling. |
214 |
+ if tc-is-cross-compiler; then |
215 |
+ elog "Disabling tests due to crosscompiling." |
216 |
+ return |
217 |
+ fi |
218 |
+ |
219 |
+ # Skip failing tests. |
220 |
+ local skipped_tests="gdb" |
221 |
+ |
222 |
+ for test in ${skipped_tests}; do |
223 |
+ mv "${S}"/Lib/test/test_${test}.py "${T}" |
224 |
+ done |
225 |
+ |
226 |
+ # bug 660358 |
227 |
+ local -x COLUMNS=80 |
228 |
+ |
229 |
+ local -x PYTHONDONTWRITEBYTECODE= |
230 |
+ |
231 |
+ emake test EXTRATESTOPTS="-u-network" CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty |
232 |
+ local result=$? |
233 |
+ |
234 |
+ for test in ${skipped_tests}; do |
235 |
+ mv "${T}/test_${test}.py" "${S}"/Lib/test |
236 |
+ done |
237 |
+ |
238 |
+ elog "The following tests have been skipped:" |
239 |
+ for test in ${skipped_tests}; do |
240 |
+ elog "test_${test}.py" |
241 |
+ done |
242 |
+ |
243 |
+ elog "If you would like to run them, you may:" |
244 |
+ elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'" |
245 |
+ elog "and run the tests separately." |
246 |
+ |
247 |
+ if [[ ${result} -ne 0 ]]; then |
248 |
+ die "emake test failed" |
249 |
+ fi |
250 |
+} |
251 |
+ |
252 |
+src_install() { |
253 |
+ local libdir=${ED}/usr/lib/python${PYVER} |
254 |
+ |
255 |
+ emake DESTDIR="${D}" altinstall |
256 |
+ |
257 |
+ # Remove static library |
258 |
+ rm "${ED}"/usr/$(get_libdir)/libpython*.a || die |
259 |
+ |
260 |
+ sed \ |
261 |
+ -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \ |
262 |
+ -e "s/\(PY_LDFLAGS=\).*/\1/" \ |
263 |
+ -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed" |
264 |
+ |
265 |
+ # Fix collisions between different slots of Python. |
266 |
+ rm "${ED}/usr/$(get_libdir)/libpython3.so" || die |
267 |
+ |
268 |
+ # Cheap hack to get version with ABIFLAGS |
269 |
+ local abiver=$(cd "${ED}/usr/include"; echo python*) |
270 |
+ if [[ ${abiver} != python${PYVER} ]]; then |
271 |
+ # Replace python3.X with a symlink to python3.Xm |
272 |
+ rm "${ED}/usr/bin/python${PYVER}" || die |
273 |
+ dosym "${abiver}" "/usr/bin/python${PYVER}" |
274 |
+ # Create python3.X-config symlink |
275 |
+ dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" |
276 |
+ # Create python-3.5m.pc symlink |
277 |
+ dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" |
278 |
+ fi |
279 |
+ |
280 |
+ # python seems to get rebuilt in src_install (bug 569908) |
281 |
+ # Work around it for now. |
282 |
+ if has_version dev-libs/libffi[pax_kernel]; then |
283 |
+ pax-mark E "${ED}/usr/bin/${abiver}" |
284 |
+ else |
285 |
+ pax-mark m "${ED}/usr/bin/${abiver}" |
286 |
+ fi |
287 |
+ |
288 |
+ use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die |
289 |
+ use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die |
290 |
+ |
291 |
+ use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die |
292 |
+ |
293 |
+ dodoc Misc/{ACKS,HISTORY,NEWS} |
294 |
+ |
295 |
+ if use examples; then |
296 |
+ docinto examples |
297 |
+ find Tools -name __pycache__ -exec rm -fr {} + || die |
298 |
+ dodoc -r Tools |
299 |
+ fi |
300 |
+ insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 |
301 |
+ local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ |
302 |
+ emake --no-print-directory -s -f - 2>/dev/null) |
303 |
+ newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py |
304 |
+ |
305 |
+ newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER} |
306 |
+ newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER} |
307 |
+ sed \ |
308 |
+ -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \ |
309 |
+ -e "s:@PYDOC@:pydoc${PYVER}:" \ |
310 |
+ -i "${ED}/etc/conf.d/pydoc-${PYVER}" \ |
311 |
+ "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed" |
312 |
+ |
313 |
+ local -x EPYTHON=python${PYVER} |
314 |
+ # if not using a cross-compiler, use the fresh binary |
315 |
+ if ! tc-is-cross-compiler; then |
316 |
+ local -x PYTHON=./python |
317 |
+ local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD} |
318 |
+ else |
319 |
+ local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON} |
320 |
+ fi |
321 |
+ |
322 |
+ echo "EPYTHON='${EPYTHON}'" > epython.py || die |
323 |
+ python_domodule epython.py |
324 |
+ |
325 |
+ # python-exec wrapping support |
326 |
+ local pymajor=${PYVER%.*} |
327 |
+ local scriptdir=${D}$(python_get_scriptdir) |
328 |
+ mkdir -p "${scriptdir}" || die |
329 |
+ # python and pythonX |
330 |
+ ln -s "../../../bin/${abiver}" \ |
331 |
+ "${scriptdir}/python${pymajor}" || die |
332 |
+ ln -s "python${pymajor}" "${scriptdir}/python" || die |
333 |
+ # python-config and pythonX-config |
334 |
+ # note: we need to create a wrapper rather than symlinking it due |
335 |
+ # to some random dirname(argv[0]) magic performed by python-config |
336 |
+ cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die |
337 |
+ #!/bin/sh |
338 |
+ exec "${abiver}-config" "\${@}" |
339 |
+ EOF |
340 |
+ chmod +x "${scriptdir}/python${pymajor}-config" || die |
341 |
+ ln -s "python${pymajor}-config" \ |
342 |
+ "${scriptdir}/python-config" || die |
343 |
+ # 2to3, pydoc |
344 |
+ ln -s "../../../bin/2to3-${PYVER}" \ |
345 |
+ "${scriptdir}/2to3" || die |
346 |
+ ln -s "../../../bin/pydoc${PYVER}" \ |
347 |
+ "${scriptdir}/pydoc" || die |
348 |
+ # idle |
349 |
+ if use tk; then |
350 |
+ ln -s "../../../bin/idle${PYVER}" \ |
351 |
+ "${scriptdir}/idle" || die |
352 |
+ fi |
353 |
+} |
354 |
+ |
355 |
+pkg_preinst() { |
356 |
+ if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then |
357 |
+ python_updater_warning="1" |
358 |
+ fi |
359 |
+} |
360 |
+ |
361 |
+eselect_python_update() { |
362 |
+ if [[ -z "$(eselect python show)" || \ |
363 |
+ ! -f "${EROOT}/usr/bin/$(eselect python show)" ]]; then |
364 |
+ eselect python update |
365 |
+ fi |
366 |
+ |
367 |
+ if [[ -z "$(eselect python show --python${PV%%.*})" || \ |
368 |
+ ! -f "${EROOT}/usr/bin/$(eselect python show --python${PV%%.*})" ]] |
369 |
+ then |
370 |
+ eselect python update --python${PV%%.*} |
371 |
+ fi |
372 |
+} |
373 |
+ |
374 |
+pkg_postinst() { |
375 |
+ eselect_python_update |
376 |
+ |
377 |
+ if [[ "${python_updater_warning}" == "1" ]]; then |
378 |
+ ewarn "You have just upgraded from an older version of Python." |
379 |
+ ewarn |
380 |
+ ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules." |
381 |
+ fi |
382 |
+} |
383 |
+ |
384 |
+pkg_postrm() { |
385 |
+ eselect_python_update |
386 |
+} |