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