1 |
commit: aae70220c19054419c10ca1712b433eb7496842b |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Aug 19 03:28:06 2020 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Aug 19 03:34:45 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aae70220 |
7 |
|
8 |
dev-lang/python: Bump to 3.6.12 |
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.6.12.ebuild | 365 +++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 367 insertions(+) |
15 |
|
16 |
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest |
17 |
index 4c0d5118607..0cad4dd2f33 100644 |
18 |
--- a/dev-lang/python/Manifest |
19 |
+++ b/dev-lang/python/Manifest |
20 |
@@ -1,11 +1,13 @@ |
21 |
DIST Python-2.7.18.tar.xz 12854736 BLAKE2B 060a621c91dd8e3d321aec99d44c17aa67381998256a1a002d316b38288349884d5960de35c49352d03129ed0bae599e641ec2225898158ebce50a7a2fd74d2c SHA512 a7bb62b51f48ff0b6df0b18f5b0312a523e3110f49c3237936bfe56ed0e26838c0274ff5401bda6fc21bf24337477ccac49e8026c5d651e4b4cafb5eb5086f6c |
22 |
DIST Python-3.6.11.tar.xz 17213036 BLAKE2B 4dae9d9c5eb7e97a8990b0b5739d40ba8a85081c7e03adc22a3305e713d39b3a98ff66c17b395b9d45355e124307eed87803211378d14360e8b3455f7146a1ba SHA512 c76969a6602e095641ba5fd0999a47cf0187eb26559ba9a6e80fe401b8928f6cd9eabd963f615f7c667e48f56603f2508d2b5692c83ea8da1e21292131fb11d6 |
23 |
+DIST Python-3.6.12.tar.xz 17202980 BLAKE2B c8d22e4d57bcaffe77cd902cda3a473e73adf2b74ab104c23b4d846f19632a24cc0c478af84079b16d784bd1c0956824c06c1f6134fd24f54e58aaab0fe96bb6 SHA512 1462801f3f6626a853097d34ccdca9838c4c5bd81ecc3abc751003f5f2f8d36eecdaa4130ef4218de351c5586093c11669639a34492668fbc5a2a4a241f4a070 |
24 |
DIST Python-3.7.8.tar.xz 17399552 BLAKE2B 4bf6c47b1132b6d31a79232002c4d38e2cd123ac05d52b21d6bfba5a4e19ec9130b8df8698d5ce6627e4297c4cf756643f036e694e36364c235306c72ef34bf8 SHA512 d2ba299e3cf8ed0f8fed9317f42bcd8d9af7e0e6175939b4be1be289c1658418bed17899e2608d762ffb15575021956cf6bf2054d7863c04b3bd7642f5b8c7ea |
25 |
DIST Python-3.8.4.tar.xz 18020412 BLAKE2B cfcfb293c413b25fc3ca48116cf8ffaba7bee18e9af9accf26be9b4373a0c62dd8e9da70e5a8a38ba6da4d1afbdbd589ae5ea4b618b65130ae061698b445908c SHA512 37a36d014a8372742be9d0bd9dd3a275e100dc21b1515c145bc62425d4d157327b6e63ad99bc888c0b36c1da4c05676c40eb086e75072d1906e3210ec3043dcb |
26 |
DIST Python-3.8.5.tar.xz 18019640 BLAKE2B bb3e0566afe28759e4ab129ad0986a0fc5103514f2e2b22ff4aa3973c3173ebdd24d4267fbaf903841814a611fd9ea122673e5a1918934366e5c0efaef9d7517 SHA512 460cee65d7df7150694590575502d7f22e548ebfc99c8f8b363eef8bf30ee72e58d8ffacb1d607824f877f880eb9fd6775a508388029583e1e1df3380f3f9587 |
27 |
DIST Python-3.9.0rc1.tar.xz 18798364 BLAKE2B 2ebf669720bcc057f7e1056aca6ff42686a8e567a5ea10304f19e53ae80ba6ba60b9157ae401427be4afa1ec296d97bb81a2b55c60a4df3dba39ae545484e0fc SHA512 8fddf940600bdd4096c0144f689fb9e803bdc7a1ee00f46ccfde3566342ed465c7ac6806613e4f61440fb65f8f83057204bd0dc432ac379759cd4d410c151eef |
28 |
DIST python-gentoo-patches-2.7.18-r1.tar.xz 15500 BLAKE2B 7008b29827dbbd80d4ab8f010ccf9efced99c6b4b9109e4430c0ba269ce53529cb6fedd832502c8d2d3aa21938749cc3591c2545b21c0a59a6e60f8598e84ccc SHA512 e656ab07281fd932b92165674619bbf55ecf410d2937ae4ae771d490b4532540498cc731d30d19c1e8aafd1f64df8a406bbfbb46ea985b3dcd8edb89a0b7f20f |
29 |
DIST python-gentoo-patches-3.6.11-r3.tar.xz 14064 BLAKE2B 416780c15ee12cfc06bfd1397d510dd42fea61abcaafd9cf54f27d843342debf0caa93c9700686feb14f04239ad4ea8f20ce8736029638abe7d7b9c57b9d659d SHA512 de6a4a5bec89e6149b85b383991c99bd9460a8f59f52a700d54edd0154557727ccc79daaa90336dff434b222657c3f28dda1228d2d474002d0a28f31c9ed0b10 |
30 |
+DIST python-gentoo-patches-3.6.12.tar.xz 11448 BLAKE2B a7fb7153ca6fd353649f9dc23f2d777e84ff144d67984d8c3d292619a4f671e3a71d8022bcc334b55f9f1f416ceeca113fb116da805e4bc45d8a67cbc098ead8 SHA512 7efb97abd3e058e4532b89205c99794836ba094079de2a6d7846fd2673ea8cc31e68573b83fd9f82453151653fb0ed9bc40b7961b41efdfe703b64cbed2576bf |
31 |
DIST python-gentoo-patches-3.7.8-r3.tar.xz 13232 BLAKE2B 9df47b1f61d08f62a80221bc48d73ec27cd74a9ade8219912c5b02eaea919b70d91b1154837cd03c0129a5839186e9c970167ca3398129c044c25c7853f1f920 SHA512 e1477d425cb6125ca2286d816f4aa4e9e3c789d6a4f4907bd7b78549598356cae5766f642e2cad9e7c3abe2e82c12cf3cb7db3513be68aa213cb64cc0abc678a |
32 |
DIST python-gentoo-patches-3.8.4-r2.tar.xz 12660 BLAKE2B 3197edc6beb2b1be05399f268ff9b337ed67f699e3867160fea8e50f763a62b184ddd7adcdfa55dafc8c14f91e020b409461027361d04858db667992794b1168 SHA512 c56adbec04bfb950f7fb65f38cc0b78eaae9783800c755b7ac934b07725fcf4d69bbc2c29f7d1255acd6e88559a216dc8a6088042a479aa0d453b706e318c0cf |
33 |
DIST python-gentoo-patches-3.8.5.tar.xz 11280 BLAKE2B 163c577da75f4ec0ebe86b5a08bea96d5ae406020bd211439b1405c0f8a5dddc9422a9ea5b16eed195433cbec010d9def3126a578d3f9716325482216b9e4d62 SHA512 6b7f72b8deb87fb7a169e97391185823984b5e9c99ec5232504c670843fbe0ca76afe32fc3fbe1f850ec6c42e9325cf4697022f36f7b00a4028b324069dd4d5b |
34 |
|
35 |
diff --git a/dev-lang/python/python-3.6.12.ebuild b/dev-lang/python/python-3.6.12.ebuild |
36 |
new file mode 100644 |
37 |
index 00000000000..b1933246549 |
38 |
--- /dev/null |
39 |
+++ b/dev-lang/python/python-3.6.12.ebuild |
40 |
@@ -0,0 +1,365 @@ |
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 multiprocessing pax-utils \ |
48 |
+ python-utils-r1 toolchain-funcs |
49 |
+ |
50 |
+MY_P="Python-${PV}" |
51 |
+PYVER=$(ver_cut 1-2) |
52 |
+PATCHSET="python-gentoo-patches-${PV}" |
53 |
+ |
54 |
+DESCRIPTION="An interpreted, interactive, object-oriented programming language" |
55 |
+HOMEPAGE="https://www.python.org/" |
56 |
+SRC_URI="https://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz |
57 |
+ https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz" |
58 |
+S="${WORKDIR}/${MY_P}" |
59 |
+ |
60 |
+LICENSE="PSF-2" |
61 |
+SLOT="${PYVER}/${PYVER}m" |
62 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86" |
63 |
+IUSE="bluetooth build examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test +threads tk wininst +xml" |
64 |
+RESTRICT="!test? ( test )" |
65 |
+ |
66 |
+# Do not add a dependency on dev-lang/python to this ebuild. |
67 |
+# If you need to apply a patch which requires python for bootstrapping, please |
68 |
+# run the bootstrap code on your dev box and include the results in the |
69 |
+# patchset. See bug 447752. |
70 |
+ |
71 |
+RDEPEND="app-arch/bzip2:= |
72 |
+ app-arch/xz-utils:= |
73 |
+ dev-libs/libffi:= |
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 |
+ Lib/distutils/command/install.py \ |
115 |
+ Lib/distutils/sysconfig.py \ |
116 |
+ Lib/site.py \ |
117 |
+ Lib/sysconfig.py \ |
118 |
+ Lib/test/test_site.py \ |
119 |
+ Makefile.pre.in \ |
120 |
+ Modules/Setup.dist \ |
121 |
+ Modules/getpath.c \ |
122 |
+ configure.ac \ |
123 |
+ setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" |
124 |
+ |
125 |
+ # force correct number of jobs |
126 |
+ # https://bugs.gentoo.org/737660 |
127 |
+ local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") |
128 |
+ sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die |
129 |
+ |
130 |
+ eautoreconf |
131 |
+} |
132 |
+ |
133 |
+src_configure() { |
134 |
+ local disable |
135 |
+ # disable automagic bluetooth headers detection |
136 |
+ use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no |
137 |
+ use gdbm || disable+=" gdbm" |
138 |
+ use ncurses || disable+=" _curses _curses_panel" |
139 |
+ use readline || disable+=" readline" |
140 |
+ use sqlite || disable+=" _sqlite3" |
141 |
+ use ssl || export PYTHON_DISABLE_SSL="1" |
142 |
+ use tk || disable+=" _tkinter" |
143 |
+ use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. |
144 |
+ export PYTHON_DISABLE_MODULES="${disable}" |
145 |
+ |
146 |
+ if ! use xml; then |
147 |
+ ewarn "You have configured Python without XML support." |
148 |
+ ewarn "This is NOT a recommended configuration as you" |
149 |
+ ewarn "may face problems parsing any XML documents." |
150 |
+ fi |
151 |
+ |
152 |
+ if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then |
153 |
+ einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" |
154 |
+ fi |
155 |
+ |
156 |
+ if [[ "$(gcc-major-version)" -ge 4 ]]; then |
157 |
+ append-flags -fwrapv |
158 |
+ fi |
159 |
+ |
160 |
+ filter-flags -malign-double |
161 |
+ |
162 |
+ # https://bugs.gentoo.org/show_bug.cgi?id=50309 |
163 |
+ if is-flagq -O3; then |
164 |
+ is-flagq -fstack-protector-all && replace-flags -O3 -O2 |
165 |
+ use hardened && replace-flags -O3 -O2 |
166 |
+ fi |
167 |
+ |
168 |
+ # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. |
169 |
+ tc-export CXX |
170 |
+ |
171 |
+ # Set LDFLAGS so we link modules with -lpython3.2 correctly. |
172 |
+ # Needed on FreeBSD unless Python 3.2 is already installed. |
173 |
+ # Please query BSD team before removing this! |
174 |
+ append-ldflags "-L." |
175 |
+ |
176 |
+ local dbmliborder |
177 |
+ if use gdbm; then |
178 |
+ dbmliborder+="${dbmliborder:+:}gdbm" |
179 |
+ fi |
180 |
+ |
181 |
+ local myeconfargs=( |
182 |
+ # glibc-2.30 removes it; since we can't cleanly force-rebuild |
183 |
+ # Python on glibc upgrade, remove it proactively to give |
184 |
+ # a chance for users rebuilding python before glibc |
185 |
+ ac_cv_header_stropts_h=no |
186 |
+ |
187 |
+ --with-fpectl |
188 |
+ --enable-shared |
189 |
+ $(use_enable ipv6) |
190 |
+ $(use_with threads) |
191 |
+ --infodir='${prefix}/share/info' |
192 |
+ --mandir='${prefix}/share/man' |
193 |
+ --with-computed-gotos |
194 |
+ --with-dbmliborder="${dbmliborder}" |
195 |
+ --with-libc= |
196 |
+ --enable-loadable-sqlite-extensions |
197 |
+ --without-ensurepip |
198 |
+ --with-system-expat |
199 |
+ --with-system-ffi |
200 |
+ ) |
201 |
+ |
202 |
+ OPT="" econf "${myeconfargs[@]}" |
203 |
+ |
204 |
+ if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then |
205 |
+ eerror "configure has detected that the sem_open function is broken." |
206 |
+ eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." |
207 |
+ die "Broken sem_open function (bug 496328)" |
208 |
+ fi |
209 |
+} |
210 |
+ |
211 |
+src_compile() { |
212 |
+ # Ensure sed works as expected |
213 |
+ # https://bugs.gentoo.org/594768 |
214 |
+ local -x LC_ALL=C |
215 |
+ |
216 |
+ emake CPPFLAGS= CFLAGS= LDFLAGS= |
217 |
+ |
218 |
+ # Work around bug 329499. See also bug 413751 and 457194. |
219 |
+ if has_version dev-libs/libffi[pax_kernel]; then |
220 |
+ pax-mark E python |
221 |
+ else |
222 |
+ pax-mark m python |
223 |
+ fi |
224 |
+} |
225 |
+ |
226 |
+src_test() { |
227 |
+ # Tests will not work when cross compiling. |
228 |
+ if tc-is-cross-compiler; then |
229 |
+ elog "Disabling tests due to crosscompiling." |
230 |
+ return |
231 |
+ fi |
232 |
+ |
233 |
+ # Skip failing tests. |
234 |
+ local skipped_tests="gdb" |
235 |
+ |
236 |
+ for test in ${skipped_tests}; do |
237 |
+ mv "${S}"/Lib/test/test_${test}.py "${T}" |
238 |
+ done |
239 |
+ |
240 |
+ # bug 660358 |
241 |
+ local -x COLUMNS=80 |
242 |
+ local -x PYTHONDONTWRITEBYTECODE= |
243 |
+ |
244 |
+ local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") |
245 |
+ |
246 |
+ emake test EXTRATESTOPTS="-u-network -j${jobs}" \ |
247 |
+ CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty |
248 |
+ local result=$? |
249 |
+ |
250 |
+ for test in ${skipped_tests}; do |
251 |
+ mv "${T}/test_${test}.py" "${S}"/Lib/test |
252 |
+ done |
253 |
+ |
254 |
+ elog "The following tests have been skipped:" |
255 |
+ for test in ${skipped_tests}; do |
256 |
+ elog "test_${test}.py" |
257 |
+ done |
258 |
+ |
259 |
+ elog "If you would like to run them, you may:" |
260 |
+ elog "cd '${EPREFIX}/usr/$(get_libdir)/python${PYVER}/test'" |
261 |
+ elog "and run the tests separately." |
262 |
+ |
263 |
+ if [[ ${result} -ne 0 ]]; then |
264 |
+ die "emake test failed" |
265 |
+ fi |
266 |
+} |
267 |
+ |
268 |
+src_install() { |
269 |
+ local libdir=${ED}/usr/$(get_libdir)/python${PYVER} |
270 |
+ |
271 |
+ emake DESTDIR="${D}" altinstall |
272 |
+ |
273 |
+ # Remove static library |
274 |
+ rm "${ED}"/usr/$(get_libdir)/libpython*.a || die |
275 |
+ |
276 |
+ sed \ |
277 |
+ -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \ |
278 |
+ -e "s/\(PY_LDFLAGS=\).*/\1/" \ |
279 |
+ -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed" |
280 |
+ |
281 |
+ # Fix collisions between different slots of Python. |
282 |
+ rm "${ED}/usr/$(get_libdir)/libpython3.so" || die |
283 |
+ |
284 |
+ # Cheap hack to get version with ABIFLAGS |
285 |
+ local abiver=$(cd "${ED}/usr/include"; echo python*) |
286 |
+ if [[ ${abiver} != python${PYVER} ]]; then |
287 |
+ # Replace python3.X with a symlink to python3.Xm |
288 |
+ rm "${ED}/usr/bin/python${PYVER}" || die |
289 |
+ dosym "${abiver}" "/usr/bin/python${PYVER}" |
290 |
+ # Create python3.X-config symlink |
291 |
+ dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" |
292 |
+ # Create python-3.5m.pc symlink |
293 |
+ dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" |
294 |
+ fi |
295 |
+ |
296 |
+ # python seems to get rebuilt in src_install (bug 569908) |
297 |
+ # Work around it for now. |
298 |
+ if has_version dev-libs/libffi[pax_kernel]; then |
299 |
+ pax-mark E "${ED}/usr/bin/${abiver}" |
300 |
+ else |
301 |
+ pax-mark m "${ED}/usr/bin/${abiver}" |
302 |
+ fi |
303 |
+ |
304 |
+ use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die |
305 |
+ use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die |
306 |
+ |
307 |
+ use threads || rm -r "${libdir}/multiprocessing" || die |
308 |
+ use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die |
309 |
+ |
310 |
+ dodoc Misc/{ACKS,HISTORY,NEWS} |
311 |
+ |
312 |
+ if use examples; then |
313 |
+ docinto examples |
314 |
+ find Tools -name __pycache__ -exec rm -fr {} + || die |
315 |
+ dodoc -r Tools |
316 |
+ fi |
317 |
+ insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 |
318 |
+ local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ |
319 |
+ emake --no-print-directory -s -f - 2>/dev/null) |
320 |
+ newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py |
321 |
+ |
322 |
+ newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER} |
323 |
+ newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER} |
324 |
+ sed \ |
325 |
+ -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \ |
326 |
+ -e "s:@PYDOC@:pydoc${PYVER}:" \ |
327 |
+ -i "${ED}/etc/conf.d/pydoc-${PYVER}" \ |
328 |
+ "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed" |
329 |
+ |
330 |
+ local -x EPYTHON=python${PYVER} |
331 |
+ # if not using a cross-compiler, use the fresh binary |
332 |
+ if ! tc-is-cross-compiler; then |
333 |
+ local -x PYTHON=./python |
334 |
+ local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD} |
335 |
+ else |
336 |
+ local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON} |
337 |
+ fi |
338 |
+ |
339 |
+ echo "EPYTHON='${EPYTHON}'" > epython.py || die |
340 |
+ python_domodule epython.py |
341 |
+ |
342 |
+ # python-exec wrapping support |
343 |
+ local pymajor=${PYVER%.*} |
344 |
+ local scriptdir=${D}$(python_get_scriptdir) |
345 |
+ mkdir -p "${scriptdir}" || die |
346 |
+ # python and pythonX |
347 |
+ ln -s "../../../bin/${abiver}" \ |
348 |
+ "${scriptdir}/python${pymajor}" || die |
349 |
+ ln -s "python${pymajor}" "${scriptdir}/python" || die |
350 |
+ # python-config and pythonX-config |
351 |
+ # note: we need to create a wrapper rather than symlinking it due |
352 |
+ # to some random dirname(argv[0]) magic performed by python-config |
353 |
+ cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die |
354 |
+ #!/bin/sh |
355 |
+ exec "${abiver}-config" "\${@}" |
356 |
+ EOF |
357 |
+ chmod +x "${scriptdir}/python${pymajor}-config" || die |
358 |
+ ln -s "python${pymajor}-config" \ |
359 |
+ "${scriptdir}/python-config" || die |
360 |
+ # 2to3, pydoc, pyvenv |
361 |
+ ln -s "../../../bin/2to3-${PYVER}" \ |
362 |
+ "${scriptdir}/2to3" || die |
363 |
+ ln -s "../../../bin/pydoc${PYVER}" \ |
364 |
+ "${scriptdir}/pydoc" || die |
365 |
+ ln -s "../../../bin/pyvenv-${PYVER}" \ |
366 |
+ "${scriptdir}/pyvenv" || die |
367 |
+ # idle |
368 |
+ if use tk; then |
369 |
+ ln -s "../../../bin/idle${PYVER}" \ |
370 |
+ "${scriptdir}/idle" || die |
371 |
+ fi |
372 |
+} |
373 |
+ |
374 |
+pkg_preinst() { |
375 |
+ if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then |
376 |
+ python_updater_warning="1" |
377 |
+ fi |
378 |
+} |
379 |
+ |
380 |
+eselect_python_update() { |
381 |
+ if [[ -z "$(eselect python show)" || \ |
382 |
+ ! -f "${EROOT}/usr/bin/$(eselect python show)" ]]; then |
383 |
+ eselect python update |
384 |
+ fi |
385 |
+ |
386 |
+ if [[ -z "$(eselect python show --python${PV%%.*})" || \ |
387 |
+ ! -f "${EROOT}/usr/bin/$(eselect python show --python${PV%%.*})" ]] |
388 |
+ then |
389 |
+ eselect python update --python${PV%%.*} |
390 |
+ fi |
391 |
+} |
392 |
+ |
393 |
+pkg_postinst() { |
394 |
+ eselect_python_update |
395 |
+ |
396 |
+ if [[ "${python_updater_warning}" == "1" ]]; then |
397 |
+ ewarn "You have just upgraded from an older version of Python." |
398 |
+ ewarn |
399 |
+ ewarn "Please adjust PYTHON_TARGETS (if so desired), and run emerge with the --newuse or --changed-use option to rebuild packages installing python modules." |
400 |
+ fi |
401 |
+} |
402 |
+ |
403 |
+pkg_postrm() { |
404 |
+ eselect_python_update |
405 |
+} |