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