Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/python/
Date: Sun, 13 Dec 2015 15:13:31
Message-Id: 1450019570.f67bfb1fa38d2457272fe0318b4449e8e513ffd9.floppym@gentoo
1 commit: f67bfb1fa38d2457272fe0318b4449e8e513ffd9
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Sun Dec 13 15:12:50 2015 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sun Dec 13 15:12:50 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f67bfb1f
7
8 dev-lang/python: Bump to 3.5.1
9
10 Package-Manager: portage-2.2.26_p27
11
12 dev-lang/python/Manifest | 2 +
13 dev-lang/python/python-3.5.1.ebuild | 348 ++++++++++++++++++++++++++++++++++++
14 2 files changed, 350 insertions(+)
15
16 diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
17 index 9e23c72..711f532 100644
18 --- a/dev-lang/python/Manifest
19 +++ b/dev-lang/python/Manifest
20 @@ -3,8 +3,10 @@ DIST Python-2.7.11.tar.xz 12277476 SHA256 962b4c45af50124ea61f11a30deb4342fc0bc2
21 DIST Python-3.3.5.tar.xz 12116308 SHA256 abe99b484434503d8b23be0f243ec27139e743a4798cd71c1dce3cf40e63b6e5 SHA512 562ebd85291f29ff18d37f05682763fc45aa9d070688006f4ef5c89392a48022357c3ca9ee1d795e9e863bdef413e6bab77b8d65581d374a76dbe7cacec65550 WHIRLPOOL f4b6010d32b28b7bb038cbb7c5f98d325cc4253fd1be9a0a1089ed6fd7dd414c5169931d21ef819137d5c1084517a650828f260cf2a1d8ce871bc67aeef3fff8
22 DIST Python-3.4.3.tar.xz 14421964 SHA256 b5b3963533768d5fc325a4d7a6bd6f666726002d696f1d399ec06b043ea996b8 SHA512 55b2d7c07da8ad3a3971b4687da2e45809c6f1474732e93b0432f121f287d0b63ad8a9bf381987ea70f47a03d9474c3e55b7d86d14800bf7ef29b3324d8d35b9 WHIRLPOOL f851dedc6a1ea35adec83d60784a5fbcd9dfcf6aa8858bb5ada114fa2ff55add1fbf323ab94ec039ecdedb26d59e8f2e6e171cd9fc1ed41ad9cfa434a555cff3
23 DIST Python-3.5.0.tar.xz 14808460 SHA256 d6d7aa1634a5eeeca6ed4fca266982a04f84bd8f3945a9179e20b24ad2e2be91 SHA512 f06bd652484aa89371021d0f9fcb08e6e905e90b39ae065d7df75b367e66b7ea43a818ca33ce04aa3d6746b5e8b1b83e90b709ac2203324fb7a595c1017be149 WHIRLPOOL aef3970297911324537e4e1e9d0e179c925bf51fea9d6a6413a08e3f349fd244d834e6fe732e9120669b762c302b47f821de170ce083d2cc39b7e35f51fdd1f0
24 +DIST Python-3.5.1.tar.xz 14830408 SHA256 c6d57c0c366d9060ab6c0cdf889ebf3d92711d466cc0119c441dbf2746f725c9 SHA512 261c9e42ae351853c718707a8887817e308b3ba7a37e9463a0bc8f50ee9be9ac1a011b2891f8877ecdb40beab99279bcfa8e04f813b8998fcf6cefb7fd52d850 WHIRLPOOL 7ff4ddb852c74f75d1f327e418f5af09ae66403cc3fb2431ab31786c046cec2d761ee57e8c6674a92bb08f95cfff7c7c7d5ddd965994096a0380fbd6b55fcc8f
25 DIST python-gentoo-patches-2.7.10-0.tar.xz 12892 SHA256 c9a838bd62ae50cc385da23a837acfd05f2b74e4f086c9c76eb4d3aa5366ef6d SHA512 5f100944635e360691dc0a2b340a906646c4ae9ee558246ddffc56e8b15d389f25f1fbdc1db4cc08e7d29560d04d66b058b3904902899d58ecae8c408ebdf056 WHIRLPOOL f69e9a518bb7ee50c1b262a21e70e1e2443f859ee6d2f4fa84421120dbd054a06ce8dd6cfea8512cbc64bce806322b879c25c561d5eb05e1ba6cc15035b373a9
26 DIST python-gentoo-patches-2.7.11-0.tar.xz 12916 SHA256 e14b47bb1fd64d366d7dfb8339cc2cbf4a53fc288b11dd83f575eb36a8a6408d SHA512 f0447bb699a163afc08df39b111394377539935546ae23732d7239e78d2bff0c04bc94949f86aef0c1be83736127dbd25c2c531e49befed2d638c3cd4940ac52 WHIRLPOOL 305992849d9d244da1e308e739c9bf62a3ef5c74eb65c765bdc666fb5767eb16c7a609f7c442c17da17f76c3ab81e4b09fa8c21e43f89366539a6a9d656bea77
27 DIST python-gentoo-patches-3.3.5-0.tar.xz 12892 SHA256 a7240de9598033cb40f8f273d8104d4e2b1dcaea028d45ac28efaa3c680ff6f7 SHA512 27eef4c2b3f631b000db3f6a5c426d9b498d63a08fe82b1ab7c2c010fb72208109461a5f008d47703852526655b70a734ea95be8742897026db5750bb9cc9d16 WHIRLPOOL edab9222d7da94cab3b1de0e1a27c6c7dbd49194b813a0a1cf9e532063029c4e4f19151c9f4878eeabed3168ff1f97eae7f008280c7ed2897fc14c5516c68d7e
28 DIST python-gentoo-patches-3.4.3-0.tar.xz 11736 SHA256 917a9d98d40a91379c81ea57922a8632ba3c6f6db6f304ed6262bc88c5044946 SHA512 7ad1b30cf8bb7900fe518ed71e4ee55dd92ce7e23ae583a1f2f851b26cfa8c4f4271d28f418e780f3725a48d4ca8eeb8fd083f850810c66c29fb08c430828d72 WHIRLPOOL 074e8c0055b49a028eebda21d1acfb8a25ec968eb8b350c2bed37e042f9f354871e413db13e0ef2fe41d7e56d647178a7b3622019f36c4819c2c68f088366eb1
29 DIST python-gentoo-patches-3.5.0-0.tar.xz 11872 SHA256 8d1830aee5f7e019250447ee084203e26143bdf47c95435861e3e0eda5106eb6 SHA512 d7b6c7fdfdea9d7577b14febf2e4680839908a8eba05f3bc17e71f2fe4c360816a8126de5fa69cfba6930be9793bf1b9cafcde2ae621c1150cb9f1ffecc4a3d4 WHIRLPOOL 01202442c789cd9f54748ec80f9c5b1d2728c5df876a2c8fa417c3078a6e9cc55103ee07fce76f402b15afe1625c5b0497734dc4b601fb304e75bf652ce2f058
30 +DIST python-gentoo-patches-3.5.1-0.tar.xz 11788 SHA256 668fabdb9326ba3df81dd299619d5245b7806934e9341ef89a06f90c9a98018b SHA512 3948af801e3e70b55b15165d6cc56fb33cdb9fcc9d80b913550c8609273bad28db0c10ec64cb14d010b80020716a1e45d720e08864f6ac850291cb1713800a1a WHIRLPOOL 2fd3b25186c26412dc642f76228d8e75f24cdc7452407dd105f027be5841b1b865f6b5b74a0072a0299153e5d5af699542253b366e4eb78dfbf114ad02b14bcc
31
32 diff --git a/dev-lang/python/python-3.5.1.ebuild b/dev-lang/python/python-3.5.1.ebuild
33 new file mode 100644
34 index 0000000..cce4c7d
35 --- /dev/null
36 +++ b/dev-lang/python/python-3.5.1.ebuild
37 @@ -0,0 +1,348 @@
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
46 +
47 +MY_P="Python-${PV/_/}"
48 +PATCHSET_VERSION="3.5.1-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%_rc*}/${MY_P}.tar.xz
53 + https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz"
54 +
55 +LICENSE="PSF-2"
56 +SLOT="3.5/3.5m"
57 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
58 +IUSE="build elibc_uclibc examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl +threads tk 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 + app-arch/xz-utils:0=
67 + >=sys-libs/zlib-1.1.3:0=
68 + virtual/libffi
69 + virtual/libintl
70 + gdbm? ( sys-libs/gdbm:0=[berkdb] )
71 + ncurses? (
72 + >=sys-libs/ncurses-5.2:0=
73 + readline? ( >=sys-libs/readline-4.1:0= )
74 + )
75 + sqlite? ( >=dev-db/sqlite-3.3.8:3= )
76 + ssl? (
77 + !libressl? ( dev-libs/openssl:0= )
78 + libressl? ( dev-libs/libressl:= )
79 + )
80 + tk? (
81 + >=dev-lang/tcl-8.0:0=
82 + >=dev-lang/tk-8.0:0=
83 + dev-tcltk/blt:0=
84 + dev-tcltk/tix
85 + )
86 + xml? ( >=dev-libs/expat-2.1:0= )
87 + !!<sys-apps/sandbox-2.6-r1"
88 +DEPEND="${RDEPEND}
89 + virtual/pkgconfig
90 + !sys-devel/gcc[libffi(-)]"
91 +RDEPEND+=" !build? ( app-misc/mime-types )"
92 +PDEPEND=">=app-eselect/eselect-python-20151117-r1"
93 +
94 +S="${WORKDIR}/${MY_P}"
95 +
96 +PYVER=${SLOT%/*}
97 +
98 +src_prepare() {
99 + # Ensure that internal copies of expat, libffi and zlib are not used.
100 + rm -fr Modules/expat
101 + rm -fr Modules/_ctypes/libffi*
102 + rm -fr Modules/zlib
103 +
104 + if tc-is-cross-compiler; then
105 + # Invokes BUILDPYTHON, which is built for the host arch
106 + local EPATCH_EXCLUDE="*_regenerate_platform-specific_modules.patch"
107 + fi
108 +
109 + EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
110 + epatch "${FILESDIR}/${PN}-3.4.3-ncurses-pkg-config.patch"
111 + epatch "${FILESDIR}/3.5-secondary-targets.patch"
112 +
113 + sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
114 + configure.ac \
115 + Lib/distutils/command/install.py \
116 + Lib/distutils/sysconfig.py \
117 + Lib/site.py \
118 + Lib/sysconfig.py \
119 + Lib/test/test_site.py \
120 + Makefile.pre.in \
121 + Modules/getpath.c \
122 + Modules/Setup.dist \
123 + setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
124 +
125 + #sed -i -e 's/\$(GRAMMAR_H): \$(GRAMMAR_INPUT) \$(PGEN)/$(GRAMMAR_H): \$(GRAMMAR_INPUT)/' Makefile.pre.in || die
126 +
127 + epatch_user
128 +
129 + eautoreconf
130 +}
131 +
132 +src_configure() {
133 + local disable
134 + use gdbm || disable+=" gdbm"
135 + use ncurses || disable+=" _curses _curses_panel"
136 + use readline || disable+=" readline"
137 + use sqlite || disable+=" _sqlite3"
138 + use ssl || export PYTHON_DISABLE_SSL="1"
139 + use tk || disable+=" _tkinter"
140 + use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
141 + export PYTHON_DISABLE_MODULES="${disable}"
142 +
143 + if ! use xml; then
144 + ewarn "You have configured Python without XML support."
145 + ewarn "This is NOT a recommended configuration as you"
146 + ewarn "may face problems parsing any XML documents."
147 + fi
148 +
149 + if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then
150 + einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}"
151 + fi
152 +
153 + if [[ "$(gcc-major-version)" -ge 4 ]]; then
154 + append-flags -fwrapv
155 + fi
156 +
157 + filter-flags -malign-double
158 +
159 + [[ "${ARCH}" == "alpha" ]] && append-flags -fPIC
160 +
161 + # https://bugs.gentoo.org/show_bug.cgi?id=50309
162 + if is-flagq -O3; then
163 + is-flagq -fstack-protector-all && replace-flags -O3 -O2
164 + use hardened && replace-flags -O3 -O2
165 + fi
166 +
167 + # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
168 + tc-export CXX
169 +
170 + # The configure script fails to use pkg-config correctly.
171 + # http://bugs.python.org/issue15506
172 + export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG)
173 +
174 + # Set LDFLAGS so we link modules with -lpython3.2 correctly.
175 + # Needed on FreeBSD unless Python 3.2 is already installed.
176 + # Please query BSD team before removing this!
177 + append-ldflags "-L."
178 +
179 + local dbmliborder
180 + if use gdbm; then
181 + dbmliborder+="${dbmliborder:+:}gdbm"
182 + fi
183 +
184 + BUILD_DIR="${WORKDIR}/${CHOST}"
185 + mkdir -p "${BUILD_DIR}" || die
186 + cd "${BUILD_DIR}" || die
187 +
188 + local myeconfargs=(
189 + --with-fpectl
190 + --enable-shared
191 + $(use_enable ipv6)
192 + $(use_with threads)
193 + --infodir='${prefix}/share/info'
194 + --mandir='${prefix}/share/man'
195 + --with-computed-gotos
196 + --with-dbmliborder="${dbmliborder}"
197 + --with-libc=
198 + --enable-loadable-sqlite-extensions
199 + --without-ensurepip
200 + --with-system-expat
201 + --with-system-ffi
202 + )
203 +
204 + ECONF_SOURCE="${S}" OPT="" econf "${myeconfargs[@]}"
205 +
206 + if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
207 + eerror "configure has detected that the sem_open function is broken."
208 + eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777."
209 + die "Broken sem_open function (bug 496328)"
210 + fi
211 +}
212 +
213 +src_compile() {
214 + # Avoid regenerating these for cross-compiles
215 + touch Include/graminit.h Python/graminit.c Python/importlib.h Python/importlib_external.h || die
216 +
217 + cd "${BUILD_DIR}" || die
218 +
219 + emake CPPFLAGS= CFLAGS= LDFLAGS=
220 +
221 + # Work around bug 329499. See also bug 413751 and 457194.
222 + if has_version dev-libs/libffi[pax_kernel]; then
223 + pax-mark E python
224 + else
225 + pax-mark m python
226 + fi
227 +}
228 +
229 +src_test() {
230 + # Tests will not work when cross compiling.
231 + if tc-is-cross-compiler; then
232 + elog "Disabling tests due to crosscompiling."
233 + return
234 + fi
235 +
236 + cd "${BUILD_DIR}" || die
237 +
238 + # Skip failing tests.
239 + local skipped_tests="gdb"
240 +
241 + for test in ${skipped_tests}; do
242 + mv "${S}"/Lib/test/test_${test}.py "${T}"
243 + done
244 +
245 + local -x PYTHONDONTWRITEBYTECODE=
246 + emake test EXTRATESTOPTS="-u-network" CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
247 + local result=$?
248 +
249 + for test in ${skipped_tests}; do
250 + mv "${T}/test_${test}.py" "${S}"/Lib/test
251 + done
252 +
253 + elog "The following tests have been skipped:"
254 + for test in ${skipped_tests}; do
255 + elog "test_${test}.py"
256 + done
257 +
258 + elog "If you would like to run them, you may:"
259 + elog "cd '${EPREFIX}/usr/$(get_libdir)/python${PYVER}/test'"
260 + elog "and run the tests separately."
261 +
262 + if [[ ${result} -ne 0 ]]; then
263 + die "emake test failed"
264 + fi
265 +}
266 +
267 +src_install() {
268 + local libdir=${ED}/usr/$(get_libdir)/python${PYVER}
269 +
270 + cd "${BUILD_DIR}" || die
271 +
272 + emake DESTDIR="${D}" altinstall
273 +
274 + sed \
275 + -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
276 + -e "s/\(PY_LDFLAGS=\).*/\1/" \
277 + -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed"
278 +
279 + # Fix collisions between different slots of Python.
280 + rm -f "${ED}usr/$(get_libdir)/libpython3.so"
281 +
282 + # Cheap hack to get version with ABIFLAGS
283 + local abiver=$(cd "${ED}usr/include"; echo python*)
284 + # Replace python3.X with a symlink if appropriate
285 + if [[ ${abiver} != python${PYVER} ]]; then
286 + rm "${ED}usr/bin/python${PYVER}" || die
287 + dosym "${abiver}" "/usr/bin/python${PYVER}"
288 + fi
289 +
290 + use elibc_uclibc && rm -fr "${libdir}/test"
291 + use sqlite || rm -fr "${libdir}/"{sqlite3,test/test_sqlite*}
292 + use tk || rm -fr "${ED}usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*}
293 +
294 + use threads || rm -fr "${libdir}/multiprocessing"
295 + use wininst || rm -f "${libdir}/distutils/command/"wininst-*.exe
296 +
297 + dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS}
298 +
299 + if use examples; then
300 + insinto /usr/share/doc/${PF}/examples
301 + find "${S}"/Tools -name __pycache__ -print0 | xargs -0 rm -fr
302 + doins -r "${S}"/Tools
303 + fi
304 + insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
305 + local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
306 + emake --no-print-directory -s -f - 2>/dev/null)
307 + newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
308 +
309 + newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
310 + newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
311 + sed \
312 + -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
313 + -e "s:@PYDOC@:pydoc${PYVER}:" \
314 + -i "${ED}etc/conf.d/pydoc-${PYVER}" "${ED}etc/init.d/pydoc-${PYVER}" || die "sed failed"
315 +
316 + # for python-exec
317 + local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
318 +
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}:}.
323 + else
324 + vars=( PYTHON "${vars[@]}" )
325 + fi
326 +
327 + python_export "python${PYVER}" "${vars[@]}"
328 + echo "EPYTHON='${EPYTHON}'" > epython.py || die
329 + python_domodule epython.py
330 +
331 + # python-exec wrapping support
332 + local pymajor=${PYVER%.*}
333 + mkdir -p "${D}${PYTHON_SCRIPTDIR}" || die
334 + # python and pythonX
335 + ln -s "../../../bin/${abiver}" \
336 + "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
337 + ln -s "python${pymajor}" \
338 + "${D}${PYTHON_SCRIPTDIR}/python" || die
339 + # python-config and pythonX-config
340 + ln -s "../../../bin/${abiver}-config" \
341 + "${D}${PYTHON_SCRIPTDIR}/python${pymajor}-config" || die
342 + ln -s "python${pymajor}-config" \
343 + "${D}${PYTHON_SCRIPTDIR}/python-config" || die
344 + # 2to3, pydoc, pyvenv
345 + ln -s "../../../bin/2to3-${PYVER}" \
346 + "${D}${PYTHON_SCRIPTDIR}/2to3" || die
347 + ln -s "../../../bin/pydoc${PYVER}" \
348 + "${D}${PYTHON_SCRIPTDIR}/pydoc" || die
349 + ln -s "../../../bin/pyvenv-${PYVER}" \
350 + "${D}${PYTHON_SCRIPTDIR}/pyvenv" || die
351 +
352 + # Compatibility link for stuff that calls ${PYTHON}-config
353 + # Remove this when all revdeps have been fixed to not do that.
354 + dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
355 +}
356 +
357 +pkg_preinst() {
358 + if has_version "<${CATEGORY}/${PN}-${PYVER}" && ! has_version ">=${CATEGORY}/${PN}-${PYVER}_alpha"; then
359 + python_updater_warning="1"
360 + fi
361 +}
362 +
363 +eselect_python_update() {
364 + if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
365 + eselect python update
366 + fi
367 +
368 + if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; 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 +}