1 |
commit: 80e70664d49a6070ce609d7da00b6fbc3220ec78 |
2 |
Author: Dirkjan Ochtman <djc <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Dec 6 19:01:22 2015 +0000 |
4 |
Commit: Dirkjan Ochtman <djc <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Dec 6 19:01:22 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=80e70664 |
7 |
|
8 |
dev-lang/python: version bump to 2.7.11 |
9 |
|
10 |
Package-Manager: portage-2.2.20.1 |
11 |
|
12 |
dev-lang/python/Manifest | 2 + |
13 |
dev-lang/python/python-2.7.11.ebuild | 371 +++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 373 insertions(+) |
15 |
|
16 |
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest |
17 |
index c3da511..9e23c72 100644 |
18 |
--- a/dev-lang/python/Manifest |
19 |
+++ b/dev-lang/python/Manifest |
20 |
@@ -1,8 +1,10 @@ |
21 |
DIST Python-2.7.10.tar.xz 12250696 SHA256 1cd3730781b91caf0fa1c4d472dc29274186480161a150294c42ce9b5c5effc0 SHA512 67615a6defbcda062f15a09f9dd3b9441afd01a8cc3255e5bc45b925378a0ddc38d468b7701176f6cc153ec52a4f21671b433780d9bde343aa9b9c1b2ae29feb WHIRLPOOL 3a9dcfc55b107dc55ad0ae93fb24a11eab7d4d9b4cfbe6b6830a090b6e5f71bb2ac91526b89c6f3e4f2610fa1a2cc4e82b58a83c599aa71f94894c74181b504b |
22 |
+DIST Python-2.7.11.tar.xz 12277476 SHA256 962b4c45af50124ea61f11a30deb4342fc0bc21126790fa1d7f6c79809413f46 SHA512 72166763a2fe6aab45ecf378f55a1efc7322d1742c4638bae84f4ed4b9fb4c01f2a0293733c64426ae2c70df24d95ff2b1e2a4f3c2715de00d8f320d4d939ea0 WHIRLPOOL 7ebcff7a2fe775a21a3847dee10369b73aaea8685eb63b4bc33dab0f562b8fb984c398cb34e8158cf1e24f106002829649540aad30a5ec7f4de0018ce7449f69 |
23 |
DIST Python-3.3.5.tar.xz 12116308 SHA256 abe99b484434503d8b23be0f243ec27139e743a4798cd71c1dce3cf40e63b6e5 SHA512 562ebd85291f29ff18d37f05682763fc45aa9d070688006f4ef5c89392a48022357c3ca9ee1d795e9e863bdef413e6bab77b8d65581d374a76dbe7cacec65550 WHIRLPOOL f4b6010d32b28b7bb038cbb7c5f98d325cc4253fd1be9a0a1089ed6fd7dd414c5169931d21ef819137d5c1084517a650828f260cf2a1d8ce871bc67aeef3fff8 |
24 |
DIST Python-3.4.3.tar.xz 14421964 SHA256 b5b3963533768d5fc325a4d7a6bd6f666726002d696f1d399ec06b043ea996b8 SHA512 55b2d7c07da8ad3a3971b4687da2e45809c6f1474732e93b0432f121f287d0b63ad8a9bf381987ea70f47a03d9474c3e55b7d86d14800bf7ef29b3324d8d35b9 WHIRLPOOL f851dedc6a1ea35adec83d60784a5fbcd9dfcf6aa8858bb5ada114fa2ff55add1fbf323ab94ec039ecdedb26d59e8f2e6e171cd9fc1ed41ad9cfa434a555cff3 |
25 |
DIST Python-3.5.0.tar.xz 14808460 SHA256 d6d7aa1634a5eeeca6ed4fca266982a04f84bd8f3945a9179e20b24ad2e2be91 SHA512 f06bd652484aa89371021d0f9fcb08e6e905e90b39ae065d7df75b367e66b7ea43a818ca33ce04aa3d6746b5e8b1b83e90b709ac2203324fb7a595c1017be149 WHIRLPOOL aef3970297911324537e4e1e9d0e179c925bf51fea9d6a6413a08e3f349fd244d834e6fe732e9120669b762c302b47f821de170ce083d2cc39b7e35f51fdd1f0 |
26 |
DIST python-gentoo-patches-2.7.10-0.tar.xz 12892 SHA256 c9a838bd62ae50cc385da23a837acfd05f2b74e4f086c9c76eb4d3aa5366ef6d SHA512 5f100944635e360691dc0a2b340a906646c4ae9ee558246ddffc56e8b15d389f25f1fbdc1db4cc08e7d29560d04d66b058b3904902899d58ecae8c408ebdf056 WHIRLPOOL f69e9a518bb7ee50c1b262a21e70e1e2443f859ee6d2f4fa84421120dbd054a06ce8dd6cfea8512cbc64bce806322b879c25c561d5eb05e1ba6cc15035b373a9 |
27 |
+DIST python-gentoo-patches-2.7.11-0.tar.xz 12916 SHA256 e14b47bb1fd64d366d7dfb8339cc2cbf4a53fc288b11dd83f575eb36a8a6408d SHA512 f0447bb699a163afc08df39b111394377539935546ae23732d7239e78d2bff0c04bc94949f86aef0c1be83736127dbd25c2c531e49befed2d638c3cd4940ac52 WHIRLPOOL 305992849d9d244da1e308e739c9bf62a3ef5c74eb65c765bdc666fb5767eb16c7a609f7c442c17da17f76c3ab81e4b09fa8c21e43f89366539a6a9d656bea77 |
28 |
DIST python-gentoo-patches-3.3.5-0.tar.xz 12892 SHA256 a7240de9598033cb40f8f273d8104d4e2b1dcaea028d45ac28efaa3c680ff6f7 SHA512 27eef4c2b3f631b000db3f6a5c426d9b498d63a08fe82b1ab7c2c010fb72208109461a5f008d47703852526655b70a734ea95be8742897026db5750bb9cc9d16 WHIRLPOOL edab9222d7da94cab3b1de0e1a27c6c7dbd49194b813a0a1cf9e532063029c4e4f19151c9f4878eeabed3168ff1f97eae7f008280c7ed2897fc14c5516c68d7e |
29 |
DIST python-gentoo-patches-3.4.3-0.tar.xz 11736 SHA256 917a9d98d40a91379c81ea57922a8632ba3c6f6db6f304ed6262bc88c5044946 SHA512 7ad1b30cf8bb7900fe518ed71e4ee55dd92ce7e23ae583a1f2f851b26cfa8c4f4271d28f418e780f3725a48d4ca8eeb8fd083f850810c66c29fb08c430828d72 WHIRLPOOL 074e8c0055b49a028eebda21d1acfb8a25ec968eb8b350c2bed37e042f9f354871e413db13e0ef2fe41d7e56d647178a7b3622019f36c4819c2c68f088366eb1 |
30 |
DIST python-gentoo-patches-3.5.0-0.tar.xz 11872 SHA256 8d1830aee5f7e019250447ee084203e26143bdf47c95435861e3e0eda5106eb6 SHA512 d7b6c7fdfdea9d7577b14febf2e4680839908a8eba05f3bc17e71f2fe4c360816a8126de5fa69cfba6930be9793bf1b9cafcde2ae621c1150cb9f1ffecc4a3d4 WHIRLPOOL 01202442c789cd9f54748ec80f9c5b1d2728c5df876a2c8fa417c3078a6e9cc55103ee07fce76f402b15afe1625c5b0497734dc4b601fb304e75bf652ce2f058 |
31 |
|
32 |
diff --git a/dev-lang/python/python-2.7.11.ebuild b/dev-lang/python/python-2.7.11.ebuild |
33 |
new file mode 100644 |
34 |
index 0000000..e6120b5 |
35 |
--- /dev/null |
36 |
+++ b/dev-lang/python/python-2.7.11.ebuild |
37 |
@@ -0,0 +1,371 @@ |
38 |
+# Copyright 1999-2015 Gentoo Foundation |
39 |
+# Distributed under the terms of the GNU General Public License v2 |
40 |
+# $Id$ |
41 |
+ |
42 |
+EAPI="5" |
43 |
+WANT_LIBTOOL="none" |
44 |
+ |
45 |
+inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs multiprocessing |
46 |
+ |
47 |
+MY_P="Python-${PV}" |
48 |
+PATCHSET_VERSION="2.7.11-0" |
49 |
+ |
50 |
+DESCRIPTION="An interpreted, interactive, object-oriented programming language" |
51 |
+HOMEPAGE="http://www.python.org/" |
52 |
+SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz |
53 |
+ https://dev.gentoo.org/~djc/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz" |
54 |
+ |
55 |
+LICENSE="PSF-2" |
56 |
+SLOT="2.7" |
57 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd" |
58 |
+IUSE="-berkdb build doc elibc_uclibc examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml" |
59 |
+ |
60 |
+# Do not add a dependency on dev-lang/python to this ebuild. |
61 |
+# If you need to apply a patch which requires python for bootstrapping, please |
62 |
+# run the bootstrap code on your dev box and include the results in the |
63 |
+# patchset. See bug 447752. |
64 |
+ |
65 |
+RDEPEND="app-arch/bzip2:0= |
66 |
+ >=sys-libs/zlib-1.1.3:0= |
67 |
+ virtual/libffi |
68 |
+ virtual/libintl |
69 |
+ berkdb? ( || ( |
70 |
+ sys-libs/db:5.3 |
71 |
+ sys-libs/db:5.2 |
72 |
+ sys-libs/db:5.1 |
73 |
+ sys-libs/db:5.0 |
74 |
+ sys-libs/db:4.8 |
75 |
+ sys-libs/db:4.7 |
76 |
+ sys-libs/db:4.6 |
77 |
+ sys-libs/db:4.5 |
78 |
+ sys-libs/db:4.4 |
79 |
+ sys-libs/db:4.3 |
80 |
+ sys-libs/db:4.2 |
81 |
+ ) ) |
82 |
+ gdbm? ( sys-libs/gdbm:0=[berkdb] ) |
83 |
+ ncurses? ( |
84 |
+ >=sys-libs/ncurses-5.2:0= |
85 |
+ readline? ( >=sys-libs/readline-4.1:0= ) |
86 |
+ ) |
87 |
+ sqlite? ( >=dev-db/sqlite-3.3.8:3= ) |
88 |
+ ssl? ( |
89 |
+ !libressl? ( dev-libs/openssl:0= ) |
90 |
+ libressl? ( dev-libs/libressl:= ) |
91 |
+ ) |
92 |
+ tk? ( |
93 |
+ >=dev-lang/tcl-8.0:0= |
94 |
+ >=dev-lang/tk-8.0:0= |
95 |
+ dev-tcltk/blt:0= |
96 |
+ dev-tcltk/tix |
97 |
+ ) |
98 |
+ xml? ( >=dev-libs/expat-2.1 ) |
99 |
+ !!<sys-apps/portage-2.1.9" |
100 |
+DEPEND="${RDEPEND} |
101 |
+ virtual/pkgconfig |
102 |
+ >=sys-devel/autoconf-2.65 |
103 |
+ !sys-devel/gcc[libffi]" |
104 |
+RDEPEND+=" !build? ( app-misc/mime-types ) |
105 |
+ doc? ( dev-python/python-docs:${SLOT} )" |
106 |
+PDEPEND="app-eselect/eselect-python |
107 |
+ app-admin/python-updater" |
108 |
+ |
109 |
+S="${WORKDIR}/${MY_P}" |
110 |
+ |
111 |
+pkg_setup() { |
112 |
+ if use berkdb; then |
113 |
+ ewarn "'bsddb' module is out-of-date and no longer maintained inside" |
114 |
+ ewarn "dev-lang/python. 'bsddb' and 'dbhash' modules have been additionally" |
115 |
+ ewarn "removed in Python 3. A maintained alternative of 'bsddb3' module" |
116 |
+ ewarn "is provided by dev-python/bsddb3." |
117 |
+ else |
118 |
+ if has_version "=${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"; then |
119 |
+ ewarn "You are migrating from =${CATEGORY}/${PN}-${PV%%.*}*[berkdb]" |
120 |
+ ewarn "to =${CATEGORY}/${PN}-${PV%%.*}*[-berkdb]." |
121 |
+ ewarn "You might need to migrate your databases." |
122 |
+ fi |
123 |
+ fi |
124 |
+} |
125 |
+ |
126 |
+src_prepare() { |
127 |
+ # Ensure that internal copies of expat, libffi and zlib are not used. |
128 |
+ rm -r Modules/expat || die |
129 |
+ rm -r Modules/_ctypes/libffi* || die |
130 |
+ rm -r Modules/zlib || die |
131 |
+ |
132 |
+ if tc-is-cross-compiler; then |
133 |
+ local EPATCH_EXCLUDE="*_regenerate_platform-specific_modules.patch" |
134 |
+ fi |
135 |
+ |
136 |
+ EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches" |
137 |
+ |
138 |
+ # Fix for cross-compiling. |
139 |
+ epatch "${FILESDIR}/python-2.7.5-nonfatal-compileall.patch" |
140 |
+ epatch "${FILESDIR}/python-2.7.9-ncurses-pkg-config.patch" |
141 |
+ epatch "${FILESDIR}/python-2.7.10-cross-compile-warn-test.patch" |
142 |
+ epatch "${FILESDIR}/python-2.7.10-system-libffi.patch" |
143 |
+ |
144 |
+ sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ |
145 |
+ Lib/distutils/command/install.py \ |
146 |
+ Lib/distutils/sysconfig.py \ |
147 |
+ Lib/site.py \ |
148 |
+ Lib/sysconfig.py \ |
149 |
+ Lib/test/test_site.py \ |
150 |
+ Makefile.pre.in \ |
151 |
+ Modules/Setup.dist \ |
152 |
+ Modules/getpath.c \ |
153 |
+ setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" |
154 |
+ |
155 |
+ epatch_user |
156 |
+ |
157 |
+ eautoreconf |
158 |
+} |
159 |
+ |
160 |
+src_configure() { |
161 |
+ # dbm module can be linked against berkdb or gdbm. |
162 |
+ # Defaults to gdbm when both are enabled, #204343. |
163 |
+ local disable |
164 |
+ use berkdb || use gdbm || disable+=" dbm" |
165 |
+ use berkdb || disable+=" _bsddb" |
166 |
+ use gdbm || disable+=" gdbm" |
167 |
+ use ncurses || disable+=" _curses _curses_panel" |
168 |
+ use readline || disable+=" readline" |
169 |
+ use sqlite || disable+=" _sqlite3" |
170 |
+ use ssl || export PYTHON_DISABLE_SSL="1" |
171 |
+ use tk || disable+=" _tkinter" |
172 |
+ use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. |
173 |
+ export PYTHON_DISABLE_MODULES="${disable}" |
174 |
+ |
175 |
+ if ! use xml; then |
176 |
+ ewarn "You have configured Python without XML support." |
177 |
+ ewarn "This is NOT a recommended configuration as you" |
178 |
+ ewarn "may face problems parsing any XML documents." |
179 |
+ fi |
180 |
+ |
181 |
+ if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then |
182 |
+ einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" |
183 |
+ fi |
184 |
+ |
185 |
+ if [[ "$(gcc-major-version)" -ge 4 ]]; then |
186 |
+ append-flags -fwrapv |
187 |
+ fi |
188 |
+ |
189 |
+ filter-flags -malign-double |
190 |
+ |
191 |
+ [[ "${ARCH}" == "alpha" ]] && append-flags -fPIC |
192 |
+ |
193 |
+ # https://bugs.gentoo.org/show_bug.cgi?id=50309 |
194 |
+ if is-flagq -O3; then |
195 |
+ is-flagq -fstack-protector-all && replace-flags -O3 -O2 |
196 |
+ use hardened && replace-flags -O3 -O2 |
197 |
+ fi |
198 |
+ |
199 |
+ if tc-is-cross-compiler; then |
200 |
+ # Force some tests that try to poke fs paths. |
201 |
+ export ac_cv_file__dev_ptc=no |
202 |
+ export ac_cv_file__dev_ptmx=yes |
203 |
+ fi |
204 |
+ |
205 |
+ # Export CXX so it ends up in /usr/lib/python2.X/config/Makefile. |
206 |
+ tc-export CXX |
207 |
+ # The configure script fails to use pkg-config correctly. |
208 |
+ # http://bugs.python.org/issue15506 |
209 |
+ export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG) |
210 |
+ |
211 |
+ # Set LDFLAGS so we link modules with -lpython2.7 correctly. |
212 |
+ # Needed on FreeBSD unless Python 2.7 is already installed. |
213 |
+ # Please query BSD team before removing this! |
214 |
+ append-ldflags "-L." |
215 |
+ |
216 |
+ local dbmliborder |
217 |
+ if use gdbm; then |
218 |
+ dbmliborder+="${dbmliborder:+:}gdbm" |
219 |
+ fi |
220 |
+ if use berkdb; then |
221 |
+ dbmliborder+="${dbmliborder:+:}bdb" |
222 |
+ fi |
223 |
+ |
224 |
+ BUILD_DIR="${WORKDIR}/${CHOST}" |
225 |
+ mkdir -p "${BUILD_DIR}" || die |
226 |
+ cd "${BUILD_DIR}" || die |
227 |
+ |
228 |
+ ECONF_SOURCE="${S}" OPT="" \ |
229 |
+ econf \ |
230 |
+ --with-fpectl \ |
231 |
+ --enable-shared \ |
232 |
+ $(use_enable ipv6) \ |
233 |
+ $(use_with threads) \ |
234 |
+ $(use wide-unicode && echo "--enable-unicode=ucs4" || echo "--enable-unicode=ucs2") \ |
235 |
+ --infodir='${prefix}/share/info' \ |
236 |
+ --mandir='${prefix}/share/man' \ |
237 |
+ --with-computed-gotos \ |
238 |
+ --with-dbmliborder="${dbmliborder}" \ |
239 |
+ --with-libc="" \ |
240 |
+ --enable-loadable-sqlite-extensions \ |
241 |
+ --with-system-expat \ |
242 |
+ --with-system-ffi \ |
243 |
+ --without-ensurepip |
244 |
+ |
245 |
+ if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then |
246 |
+ eerror "configure has detected that the sem_open function is broken." |
247 |
+ eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." |
248 |
+ die "Broken sem_open function (bug 496328)" |
249 |
+ fi |
250 |
+} |
251 |
+ |
252 |
+src_compile() { |
253 |
+ # Avoid invoking pgen for cross-compiles. |
254 |
+ touch Include/graminit.h Python/graminit.c |
255 |
+ |
256 |
+ cd "${BUILD_DIR}" || die |
257 |
+ emake |
258 |
+ |
259 |
+ # Work around bug 329499. See also bug 413751 and 457194. |
260 |
+ if has_version dev-libs/libffi[pax_kernel]; then |
261 |
+ pax-mark E python |
262 |
+ else |
263 |
+ pax-mark m python |
264 |
+ fi |
265 |
+} |
266 |
+ |
267 |
+src_test() { |
268 |
+ # Tests will not work when cross compiling. |
269 |
+ if tc-is-cross-compiler; then |
270 |
+ elog "Disabling tests due to crosscompiling." |
271 |
+ return |
272 |
+ fi |
273 |
+ |
274 |
+ cd "${BUILD_DIR}" || die |
275 |
+ |
276 |
+ # Skip failing tests. |
277 |
+ local skipped_tests="distutils gdb" |
278 |
+ |
279 |
+ for test in ${skipped_tests}; do |
280 |
+ mv "${S}"/Lib/test/test_${test}.py "${T}" |
281 |
+ done |
282 |
+ |
283 |
+ # Rerun failed tests in verbose mode (regrtest -w). |
284 |
+ emake test EXTRATESTOPTS="-w" < /dev/tty |
285 |
+ local result="$?" |
286 |
+ |
287 |
+ for test in ${skipped_tests}; do |
288 |
+ mv "${T}/test_${test}.py" "${S}"/Lib/test |
289 |
+ done |
290 |
+ |
291 |
+ elog "The following tests have been skipped:" |
292 |
+ for test in ${skipped_tests}; do |
293 |
+ elog "test_${test}.py" |
294 |
+ done |
295 |
+ |
296 |
+ elog "If you would like to run them, you may:" |
297 |
+ elog "cd '${EPREFIX}/usr/$(get_libdir)/python${SLOT}/test'" |
298 |
+ elog "and run the tests separately." |
299 |
+ |
300 |
+ if [[ "${result}" -ne 0 ]]; then |
301 |
+ die "emake test failed" |
302 |
+ fi |
303 |
+} |
304 |
+ |
305 |
+src_install() { |
306 |
+ local libdir=${ED}/usr/$(get_libdir)/python${SLOT} |
307 |
+ |
308 |
+ cd "${BUILD_DIR}" || die |
309 |
+ emake DESTDIR="${D}" altinstall |
310 |
+ |
311 |
+ sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die "sed failed" |
312 |
+ |
313 |
+ # Fix collisions between different slots of Python. |
314 |
+ mv "${ED}usr/bin/2to3" "${ED}usr/bin/2to3-${SLOT}" |
315 |
+ mv "${ED}usr/bin/pydoc" "${ED}usr/bin/pydoc${SLOT}" |
316 |
+ mv "${ED}usr/bin/idle" "${ED}usr/bin/idle${SLOT}" |
317 |
+ rm -f "${ED}usr/bin/smtpd.py" |
318 |
+ |
319 |
+ use berkdb || rm -r "${libdir}/"{bsddb,dbhash.py,test/test_bsddb*} || die |
320 |
+ use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die |
321 |
+ use tk || rm -r "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk} || die |
322 |
+ use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test} |
323 |
+ |
324 |
+ use threads || rm -r "${libdir}/multiprocessing" || die |
325 |
+ use wininst || rm -r "${libdir}/distutils/command/"wininst-*.exe || die |
326 |
+ |
327 |
+ dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS} |
328 |
+ |
329 |
+ if use examples; then |
330 |
+ insinto /usr/share/doc/${PF}/examples |
331 |
+ doins -r "${S}"/Tools |
332 |
+ fi |
333 |
+ insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 |
334 |
+ local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ |
335 |
+ emake --no-print-directory -s -f - 2>/dev/null) |
336 |
+ newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py |
337 |
+ |
338 |
+ newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} |
339 |
+ newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT} |
340 |
+ sed \ |
341 |
+ -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${SLOT/./_}_PORT:" \ |
342 |
+ -e "s:@PYDOC@:pydoc${SLOT}:" \ |
343 |
+ -i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed" |
344 |
+ |
345 |
+ # for python-exec |
346 |
+ local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR ) |
347 |
+ |
348 |
+ # if not using a cross-compiler, use the fresh binary |
349 |
+ if ! tc-is-cross-compiler; then |
350 |
+ local -x PYTHON=./python |
351 |
+ local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}. |
352 |
+ else |
353 |
+ vars=( PYTHON "${vars[@]}" ) |
354 |
+ fi |
355 |
+ |
356 |
+ python_export "python${SLOT}" "${vars[@]}" |
357 |
+ echo "EPYTHON='${EPYTHON}'" > epython.py || die |
358 |
+ python_domodule epython.py |
359 |
+ |
360 |
+ # python-exec wrapping support |
361 |
+ local pymajor=${SLOT%.*} |
362 |
+ mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die |
363 |
+ # python and pythonX |
364 |
+ ln -s "../../../bin/python${SLOT}" \ |
365 |
+ "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die |
366 |
+ ln -s "python${pymajor}" \ |
367 |
+ "${D}${PYTHON_SCRIPTDIR}/python" || die |
368 |
+ # python-config and pythonX-config |
369 |
+ ln -s "../../../bin/python${SLOT}-config" \ |
370 |
+ "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die |
371 |
+ ln -s "python${pymajor}-config" \ |
372 |
+ "${D}${PYTHON_SCRIPTDIR}/python-config" || die |
373 |
+ # 2to3, pydoc, pyvenv |
374 |
+ ln -s "../../../bin/2to3-${SLOT}" \ |
375 |
+ "${D}${PYTHON_SCRIPTDIR}/2to3" || die |
376 |
+ ln -s "../../../bin/pydoc${SLOT}" \ |
377 |
+ "${D}${PYTHON_SCRIPTDIR}/pydoc" || die |
378 |
+} |
379 |
+ |
380 |
+pkg_preinst() { |
381 |
+ if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version "${CATEGORY}/${PN}:2.7"; then |
382 |
+ python_updater_warning="1" |
383 |
+ fi |
384 |
+} |
385 |
+ |
386 |
+eselect_python_update() { |
387 |
+ if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then |
388 |
+ eselect python update |
389 |
+ fi |
390 |
+ |
391 |
+ if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then |
392 |
+ eselect python update --python${PV%%.*} |
393 |
+ fi |
394 |
+} |
395 |
+ |
396 |
+pkg_postinst() { |
397 |
+ eselect_python_update |
398 |
+ |
399 |
+ if [[ "${python_updater_warning}" == "1" ]]; then |
400 |
+ ewarn "You have just upgraded from an older version of Python." |
401 |
+ ewarn "You should switch active version of Python ${PV%%.*} and run" |
402 |
+ ewarn "'python-updater [options]' to rebuild Python modules." |
403 |
+ fi |
404 |
+} |
405 |
+ |
406 |
+pkg_postrm() { |
407 |
+ eselect_python_update |
408 |
+} |