Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pypy/
Date: Sun, 29 Apr 2018 06:34:00
Message-Id: 1524983044.c2b60504283f9b49197ea87cd081b2e6e5b2a4c3.mgorny@gentoo
1 commit: c2b60504283f9b49197ea87cd081b2e6e5b2a4c3
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Apr 29 06:19:08 2018 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Apr 29 06:24:04 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c2b60504
7
8 dev-python/pypy: Drop <5.10.0
9
10 dev-python/pypy/Manifest | 1 -
11 dev-python/pypy/pypy-5.9.0-r1.ebuild | 281 -----------------------------------
12 2 files changed, 282 deletions(-)
13
14 diff --git a/dev-python/pypy/Manifest b/dev-python/pypy/Manifest
15 index 2557dd1c6be..222168a0e5c 100644
16 --- a/dev-python/pypy/Manifest
17 +++ b/dev-python/pypy/Manifest
18 @@ -1,4 +1,3 @@
19 DIST pypy2-v5.10.0-src.tar.bz2 19181430 BLAKE2B 4a0808c74fb167a7e98625f1d5b8559bb3a0383445387a0c48f951d75d009c57806eb600a141a84a7cb800e2f53fe091367cbb0b23192bc52b995cb65246c076 SHA512 11892418d753ddc59e928a5f59b3406b7c22b8689ad6995eeb183182dbb5184117e68bb567c770ffa60a14d6763550d658e260584e65da5025ed481f48501379
20 -DIST pypy2-v5.9.0-src.tar.bz2 19175394 BLAKE2B 0d5fa0d013d8cdb9765bf0f535877894d7a3544c19481973f788187251d1bd2ba11f88950430e85c7608ea394cc952ae7dd7275b9843397ab098e153cf96ec7f SHA512 3170747e81088043c6a4885bd0bc92e911556420b6c2539a4ed7e62956f1c741651f772def0fb00d8826a1bef9d6f4e79a13682a4456a31d987f7c9bd8608a4d
21 DIST pypy2-v6.0.0-src.tar.bz2 19741694 BLAKE2B 55f5000e590613b516b12c3682a658fe6a17fbe264be3d61a81698cdf098b39177cf4355eb3f28980209c7a0e005498201cbad8884e3aa02cc86a228d1552046 SHA512 d3bdcd65fc83f2fda3203a604733fe6765049a17cca2715cd6045dc302a6159b4741a821c53fa4c97acf7297cef4c62e941a6a6eb7f8a253a93a28dcf2aa2ca0
22 DIST python-gentoo-patches-2.7.14-0.tar.xz 13428 BLAKE2B 0048e48ddaaa4bef08451354fde95a123042880f26dddc9267c7f9a90fd8abb40955e26ee8c9dfc5a1165556bb3e11585b27288e635d42a4000dd3d7654c41ad SHA512 6da5b52065752b54e9215d0f0809c75167dc3690d0e94fa21dd7595626925bc5c1dd065d31b3bd696d7087f3986de145d3a335a29eb7bd77442637a7ec2863c1
23
24 diff --git a/dev-python/pypy/pypy-5.9.0-r1.ebuild b/dev-python/pypy/pypy-5.9.0-r1.ebuild
25 deleted file mode 100644
26 index 7cfed8fcca3..00000000000
27 --- a/dev-python/pypy/pypy-5.9.0-r1.ebuild
28 +++ /dev/null
29 @@ -1,281 +0,0 @@
30 -# Copyright 1999-2017 Gentoo Foundation
31 -# Distributed under the terms of the GNU General Public License v2
32 -
33 -EAPI=6
34 -
35 -PYTHON_COMPAT=( python2_7 pypy )
36 -inherit check-reqs pax-utils python-any-r1 toolchain-funcs versionator
37 -
38 -# note: remember to update this to newest dev-lang/python:2.7 on bump
39 -CPY_PATCHSET_VERSION="2.7.14-0"
40 -MY_P=pypy2-v${PV}
41 -
42 -DESCRIPTION="A fast, compliant alternative implementation of the Python language"
43 -HOMEPAGE="http://pypy.org/"
44 -SRC_URI="https://bitbucket.org/pypy/pypy/downloads/${MY_P}-src.tar.bz2
45 - https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${CPY_PATCHSET_VERSION}.tar.xz"
46 -
47 -LICENSE="MIT"
48 -# pypy -c 'import sysconfig; print sysconfig.get_config_var("SOABI")'
49 -SLOT="0/41"
50 -KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
51 -IUSE="bzip2 doc gdbm +jit libressl low-memory ncurses sandbox sqlite cpu_flags_x86_sse2 test tk"
52 -
53 -RDEPEND=">=sys-libs/zlib-1.1.3:0=
54 - virtual/libffi:0=
55 - virtual/libintl:0=
56 - dev-libs/expat:0=
57 - !libressl? ( dev-libs/openssl:0=[-bindist] )
58 - libressl? ( dev-libs/libressl:0= )
59 - bzip2? ( app-arch/bzip2:0= )
60 - gdbm? ( sys-libs/gdbm:0= )
61 - ncurses? ( sys-libs/ncurses:0= )
62 - sqlite? ( dev-db/sqlite:3= )
63 - tk? (
64 - dev-lang/tk:0=
65 - dev-tcltk/tix:0=
66 - )
67 - !dev-python/pypy-bin:0"
68 -# don't enforce the dep on pypy with USE=low-memory since it's going
69 -# to cause either collisions or circular dep on itself
70 -DEPEND="${RDEPEND}
71 - doc? ( dev-python/sphinx )
72 - !low-memory? (
73 - || (
74 - dev-python/pypy
75 - dev-python/pypy-bin
76 - (
77 - dev-lang/python:2.7
78 - dev-python/pycparser[python_targets_python2_7(-),python_single_target_python2_7(+)]
79 - )
80 - )
81 - )"
82 -
83 -S="${WORKDIR}/${MY_P}-src"
84 -
85 -check_env() {
86 - if use low-memory; then
87 - if ! python_is_installed pypy; then
88 - eerror "USE=low-memory requires a (possibly old) version of dev-python/pypy"
89 - eerror "or dev-python/pypy-bin being installed. Please install it using e.g.:"
90 - eerror
91 - eerror " $ emerge -1v dev-python/pypy-bin"
92 - eerror
93 - eerror "before attempting to build dev-python/pypy[low-memory]."
94 - die "dev-python/pypy-bin (or dev-python/pypy) needs to be installed for USE=low-memory"
95 - fi
96 -
97 - CHECKREQS_MEMORY="1750M"
98 - use amd64 && CHECKREQS_MEMORY="3500M"
99 - else
100 - CHECKREQS_MEMORY="3G"
101 - use amd64 && CHECKREQS_MEMORY="6G"
102 - fi
103 -
104 - check-reqs_pkg_pretend
105 -}
106 -
107 -pkg_pretend() {
108 - [[ ${MERGE_TYPE} != binary ]] && check_env
109 -}
110 -
111 -pkg_setup() {
112 - if [[ ${MERGE_TYPE} != binary ]]; then
113 - check_env
114 -
115 - if python_is_installed pypy; then
116 - if [[ ! ${EPYTHON} || ${EPYTHON} == pypy ]] || use low-memory; then
117 - einfo "Using already-installed PyPy to perform the translation."
118 - local EPYTHON=pypy
119 - else
120 - einfo "Using ${EPYTHON} to perform the translation. Please note that upstream"
121 - einfo "recommends using PyPy for that. If you wish to do so, please unset"
122 - einfo "the EPYTHON variable."
123 - fi
124 - fi
125 -
126 - python-any-r1_pkg_setup
127 - fi
128 -}
129 -
130 -src_prepare() {
131 - eapply "${FILESDIR}/4.0.0-gentoo-path.patch"
132 - eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
133 - eapply "${FILESDIR}"/5.9.0-shared-lib.patch # 517002
134 -
135 - sed -e "s^@EPREFIX@^${EPREFIX}^" \
136 - -e "s^@libdir@^$(get_libdir)^" \
137 - -i lib-python/2.7/distutils/command/install.py || die
138 -
139 - # apply CPython stdlib patches
140 - pushd lib-python/2.7 > /dev/null || die
141 - # TODO: cpy turkish locale patch now fixes C code
142 - # probably needs better port to pypy, if it is broken there
143 - eapply "${FILESDIR}"/5.8.0_all_distutils_cxx.patch
144 - eapply "${WORKDIR}"/patches/62_all_xml.use_pyxml.patch
145 - popd > /dev/null || die
146 -
147 - eapply_user
148 -}
149 -
150 -src_configure() {
151 - tc-export CC
152 -
153 - local jit_backend
154 - if use jit; then
155 - jit_backend='--jit-backend='
156 -
157 - # We only need the explicit sse2 switch for x86.
158 - # On other arches we can rely on autodetection which uses
159 - # compiler macros. Plus, --jit-backend= doesn't accept all
160 - # the modern values...
161 -
162 - if use x86; then
163 - if use cpu_flags_x86_sse2; then
164 - jit_backend+=x86
165 - else
166 - jit_backend+=x86-without-sse2
167 - fi
168 - else
169 - jit_backend+=auto
170 - fi
171 - fi
172 -
173 - local args=(
174 - --shared
175 - $(usex jit -Ojit -O2)
176 - $(usex sandbox --sandbox '')
177 -
178 - ${jit_backend}
179 -
180 - pypy/goal/targetpypystandalone
181 - )
182 -
183 - # Avoid linking against libraries disabled by use flags
184 - local opts=(
185 - bzip2:bz2
186 - ncurses:_minimal_curses
187 - )
188 -
189 - local opt
190 - for opt in "${opts[@]}"; do
191 - local flag=${opt%:*}
192 - local mod=${opt#*:}
193 -
194 - args+=(
195 - $(usex ${flag} --withmod --withoutmod)-${mod}
196 - )
197 - done
198 -
199 - local interp=( "${PYTHON}" )
200 - if use low-memory; then
201 - interp=( env PYPY_GC_MAX_DELTA=200MB
202 - "${PYTHON}" --jit loop_longevity=300 )
203 - fi
204 -
205 - # translate into the C sources
206 - # we're going to make them ourselves since otherwise pypy does not
207 - # free up the unneeded memory before spawning the compiler
208 - set -- "${interp[@]}" rpython/bin/rpython --batch --source "${args[@]}"
209 - echo -e "\033[1m${@}\033[0m"
210 - "${@}" || die "translation failed"
211 -}
212 -
213 -src_compile() {
214 - emake -C "${T}"/usession*-0/testing_1
215 -
216 - # copy back to make sys.prefix happy
217 - cp -p "${T}"/usession*-0/testing_1/{pypy-c,libpypy-c.so} . || die
218 - pax-mark m pypy-c libpypy-c.so
219 -
220 - use doc && emake -C pypy/doc html
221 -
222 - einfo "Generating caches and CFFI modules ..."
223 -
224 - # Generate Grammar and PatternGrammar pickles.
225 - ./pypy-c -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
226 - || die "Generation of Grammar and PatternGrammar pickles failed"
227 -
228 - # Generate cffi modules
229 - # Please keep in sync with pypy/tool/build_cffi_imports.py!
230 -#cffi_build_scripts = {
231 -# "sqlite3": "_sqlite3_build.py",
232 -# "audioop": "_audioop_build.py",
233 -# "tk": "_tkinter/tklib_build.py",
234 -# "curses": "_curses_build.py" if sys.platform != "win32" else None,
235 -# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
236 -# "gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
237 -# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
238 -# "resource": "_resource_build.py" if sys.platform != "win32" else None,
239 - cffi_targets=( audioop syslog pwdgrp resource )
240 - use gdbm && cffi_targets+=( gdbm )
241 - use ncurses && cffi_targets+=( curses )
242 - use sqlite && cffi_targets+=( sqlite3 )
243 - use tk && cffi_targets+=( tkinter/tklib )
244 -
245 - local t
246 - # all modules except tkinter output to .
247 - # tkinter outputs to the correct dir ...
248 - cd lib_pypy || die
249 - for t in "${cffi_targets[@]}"; do
250 - # tkinter doesn't work via -m
251 - ../pypy-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
252 - done
253 -
254 - # Cleanup temporary objects
255 - find -name "_cffi_*.[co]" -delete || die
256 - find -type d -empty -delete || die
257 -}
258 -
259 -src_test() {
260 - # (unset)
261 - local -x PYTHONDONTWRITEBYTECODE
262 -
263 - ./pypy-c ./pypy/test_all.py --pypy=./pypy-c lib-python || die
264 -}
265 -
266 -src_install() {
267 - local dest=/usr/$(get_libdir)/pypy
268 - einfo "Installing PyPy ..."
269 - exeinto "${dest}"
270 - doexe pypy-c libpypy-c.so
271 - pax-mark m "${ED%/}${dest}/pypy-c" "${ED%/}${dest}/libpypy-c.so"
272 - insinto "${dest}"
273 - # preserve mtimes to avoid obsoleting caches
274 - insopts -p
275 - doins -r include lib_pypy lib-python
276 - dosym ../$(get_libdir)/pypy/pypy-c /usr/bin/pypy
277 - dodoc README.rst
278 -
279 - if ! use gdbm; then
280 - rm -r "${ED%/}${dest}"/lib_pypy/gdbm.py \
281 - "${ED%/}${dest}"/lib-python/*2.7/test/test_gdbm.py || die
282 - fi
283 - if ! use sqlite; then
284 - rm -r "${ED%/}${dest}"/lib-python/*2.7/sqlite3 \
285 - "${ED%/}${dest}"/lib_pypy/_sqlite3.py \
286 - "${ED%/}${dest}"/lib-python/*2.7/test/test_sqlite.py || die
287 - fi
288 - if ! use tk; then
289 - rm -r "${ED%/}${dest}"/lib-python/*2.7/{idlelib,lib-tk} \
290 - "${ED%/}${dest}"/lib_pypy/_tkinter \
291 - "${ED%/}${dest}"/lib-python/*2.7/test/test_{tcl,tk,ttk*}.py || die
292 - fi
293 -
294 - # Install docs
295 - use doc && dodoc -r pypy/doc/_build/html
296 -
297 - local -x PYTHON=${ED%/}${dest}/pypy-c
298 - # we can't use eclass function since PyPy is dumb and always gives
299 - # paths relative to the interpreter
300 - local PYTHON_SITEDIR=${EPREFIX}/usr/$(get_libdir)/pypy/site-packages
301 - python_export pypy EPYTHON
302 -
303 - echo "EPYTHON='${EPYTHON}'" > epython.py || die
304 - python_domodule epython.py
305 -
306 - einfo "Byte-compiling Python standard library..."
307 -
308 - # compile the installed modules
309 - python_optimize "${ED%/}${dest}"
310 -}