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/pypy3/
Date: Mon, 30 Dec 2019 11:59:05
Message-Id: 1577707072.46943772d0686118e32042c2041e32a839b37ebe.mgorny@gentoo
1 commit: 46943772d0686118e32042c2041e32a839b37ebe
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Mon Dec 30 11:04:14 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Mon Dec 30 11:57:52 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=46943772
7
8 dev-python/pypy3: Remove the live ebuild
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/pypy3/pypy3-9999.ebuild | 276 -------------------------------------
13 1 file changed, 276 deletions(-)
14
15 diff --git a/dev-python/pypy3/pypy3-9999.ebuild b/dev-python/pypy3/pypy3-9999.ebuild
16 deleted file mode 100644
17 index 10dbaca72bf..00000000000
18 --- a/dev-python/pypy3/pypy3-9999.ebuild
19 +++ /dev/null
20 @@ -1,276 +0,0 @@
21 -# Copyright 1999-2019 Gentoo Authors
22 -# Distributed under the terms of the GNU General Public License v2
23 -
24 -EAPI=7
25 -
26 -# pypy3 needs to be built using python 2
27 -PYTHON_COMPAT=( python2_7 pypy )
28 -EHG_PROJECT="pypy"
29 -EHG_REPO_URI="https://bitbucket.org/pypy/pypy"
30 -EHG_REVISION="py3.6"
31 -inherit check-reqs mercurial pax-utils python-any-r1 toolchain-funcs
32 -
33 -MY_P=pypy3.6-v${PV}
34 -
35 -DESCRIPTION="A fast, compliant alternative implementation of the Python (3.6) language"
36 -HOMEPAGE="https://pypy.org/"
37 -SRC_URI=""
38 -
39 -LICENSE="MIT"
40 -# pypy3 -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))'
41 -SLOT="0/72-py36"
42 -KEYWORDS=""
43 -IUSE="bzip2 cpu_flags_x86_sse2 gdbm +jit libressl low-memory ncurses
44 - sandbox sqlite tk"
45 -
46 -RDEPEND=">=sys-libs/zlib-1.1.3:0=
47 - virtual/libffi:0=
48 - virtual/libintl:0=
49 - dev-libs/expat:0=
50 - !libressl? ( dev-libs/openssl:0= )
51 - libressl? ( dev-libs/libressl:0= )
52 - bzip2? ( app-arch/bzip2:0= )
53 - gdbm? ( sys-libs/gdbm:0= )
54 - ncurses? ( sys-libs/ncurses:0= )
55 - sqlite? ( dev-db/sqlite:3= )
56 - tk? (
57 - dev-lang/tk:0=
58 - dev-tcltk/tix:0=
59 - )
60 - !dev-python/pypy3-bin:0"
61 -DEPEND="${RDEPEND}
62 - low-memory? ( virtual/pypy )
63 - !low-memory? (
64 - || (
65 - virtual/pypy
66 - (
67 - dev-lang/python:2.7
68 - dev-python/pycparser[python_targets_python2_7(-),python_single_target_python2_7(+)]
69 - )
70 - )
71 - )"
72 -
73 -S="${WORKDIR}/${MY_P}-src"
74 -
75 -check_env() {
76 - if use low-memory; then
77 - CHECKREQS_MEMORY="1750M"
78 - use amd64 && CHECKREQS_MEMORY="3500M"
79 - else
80 - CHECKREQS_MEMORY="3G"
81 - use amd64 && CHECKREQS_MEMORY="6G"
82 - fi
83 -
84 - check-reqs_pkg_pretend
85 -}
86 -
87 -pkg_pretend() {
88 - [[ ${MERGE_TYPE} != binary ]] && check_env
89 -}
90 -
91 -pkg_setup() {
92 - if [[ ${MERGE_TYPE} != binary ]]; then
93 - check_env
94 -
95 - # unset to allow forcing pypy below :)
96 - use low-memory && local EPYTHON=
97 - if python_is_installed pypy && [[ ! ${EPYTHON} || ${EPYTHON} == pypy ]]; then
98 - einfo "Using PyPy to perform the translation."
99 - local EPYTHON=pypy
100 - else
101 - einfo "Using ${EPYTHON:-python2} to perform the translation. Please note that upstream"
102 - einfo "recommends using PyPy for that. If you wish to do so, please install"
103 - einfo "virtual/pypy and ensure that EPYTHON variable is unset."
104 - fi
105 -
106 - python-any-r1_pkg_setup
107 - fi
108 -}
109 -
110 -src_unpack() {
111 - default
112 - mercurial_src_unpack
113 -}
114 -
115 -src_prepare() {
116 - eapply "${FILESDIR}/7.0.0-gentoo-path.patch"
117 - eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
118 - eapply "${FILESDIR}"/5.9.0-shared-lib.patch # 517002
119 - eapply "${FILESDIR}"/7.2.0-distutils-cxx.patch
120 -
121 - sed -e "s^@EPREFIX@^${EPREFIX}^" \
122 - -i lib-python/3/distutils/command/install.py || die
123 -
124 - # apply CPython stdlib patches
125 - pushd lib-python/3 > /dev/null || die
126 - eapply "${FILESDIR}"/python-3.5-distutils-OO-build.patch
127 - popd > /dev/null || die
128 -
129 - eapply_user
130 -}
131 -
132 -src_configure() {
133 - tc-export CC
134 -
135 - local jit_backend
136 - if use jit; then
137 - jit_backend='--jit-backend='
138 -
139 - # We only need the explicit sse2 switch for x86.
140 - # On other arches we can rely on autodetection which uses
141 - # compiler macros. Plus, --jit-backend= doesn't accept all
142 - # the modern values...
143 -
144 - if use x86; then
145 - if use cpu_flags_x86_sse2; then
146 - jit_backend+=x86
147 - else
148 - jit_backend+=x86-without-sse2
149 - fi
150 - else
151 - jit_backend+=auto
152 - fi
153 - fi
154 -
155 - local args=(
156 - --shared
157 - $(usex jit -Ojit -O2)
158 - $(usex sandbox --sandbox '')
159 -
160 - ${jit_backend}
161 -
162 - pypy/goal/targetpypystandalone
163 - )
164 -
165 - # Avoid linking against libraries disabled by use flags
166 - local opts=(
167 - bzip2:bz2
168 - ncurses:_minimal_curses
169 - )
170 -
171 - local opt
172 - for opt in "${opts[@]}"; do
173 - local flag=${opt%:*}
174 - local mod=${opt#*:}
175 -
176 - args+=(
177 - $(usex ${flag} --withmod --withoutmod)-${mod}
178 - )
179 - done
180 -
181 - local interp=( "${PYTHON}" )
182 - if use low-memory; then
183 - interp=( env PYPY_GC_MAX_DELTA=200MB
184 - "${PYTHON}" --jit loop_longevity=300 )
185 - fi
186 -
187 - # translate into the C sources
188 - # we're going to make them ourselves since otherwise pypy does not
189 - # free up the unneeded memory before spawning the compiler
190 - set -- "${interp[@]}" rpython/bin/rpython --batch --source "${args[@]}"
191 - echo -e "\033[1m${@}\033[0m"
192 - "${@}" || die "translation failed"
193 -}
194 -
195 -src_compile() {
196 - emake -C "${T}"/usession*-0/testing_1
197 -
198 - # copy back to make sys.prefix happy
199 - cp -p "${T}"/usession*-0/testing_1/{pypy3-c,libpypy3-c.so} . || die
200 - pax-mark m pypy3-c libpypy3-c.so
201 -
202 - einfo "Generating caches and CFFI modules ..."
203 -
204 - # Generate Grammar and PatternGrammar pickles.
205 - ./pypy3-c -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
206 - || die "Generation of Grammar and PatternGrammar pickles failed"
207 -
208 - # Generate cffi modules
209 - # Please keep in sync with pypy/tool/build_cffi_imports.py!
210 -#cffi_build_scripts = {
211 -# "_blake2": "_blake2/_blake2_build.py",
212 -# "_ssl": "_ssl_build.py",
213 -# "sqlite3": "_sqlite3_build.py",
214 -# "audioop": "_audioop_build.py",
215 -# "tk": "_tkinter/tklib_build.py",
216 -# "curses": "_curses_build.py" if sys.platform != "win32" else None,
217 -# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
218 -# "gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
219 -# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
220 -# "resource": "_resource_build.py" if sys.platform != "win32" else None,
221 -# "lzma": "_lzma_build.py",
222 -# "_decimal": "_decimal_build.py",
223 -# "_sha3": "_sha3/_sha3_build.py",
224 - cffi_targets=( blake2/_blake2 sha3/_sha3 ssl
225 - audioop syslog pwdgrp resource lzma decimal )
226 - use gdbm && cffi_targets+=( gdbm )
227 - use ncurses && cffi_targets+=( curses )
228 - use sqlite && cffi_targets+=( sqlite3 )
229 - use tk && cffi_targets+=( tkinter/tklib )
230 -
231 - local t
232 - # all modules except tkinter output to .
233 - # tkinter outputs to the correct dir ...
234 - cd lib_pypy || die
235 - for t in "${cffi_targets[@]}"; do
236 - # tkinter doesn't work via -m
237 - ../pypy3-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
238 - done
239 -
240 - # Cleanup temporary objects
241 - find -name "_cffi_*.[co]" -delete || die
242 - find -type d -empty -delete || die
243 -}
244 -
245 -src_test() {
246 - # (unset)
247 - local -x PYTHONDONTWRITEBYTECODE=
248 -
249 - # Test runner requires Python 2 too. However, it spawns PyPy3
250 - # internally so that we end up testing the correct interpreter.
251 - "${PYTHON}" ./pypy/test_all.py --pypy=./pypy3-c -vv lib-python || die
252 -}
253 -
254 -src_install() {
255 - local dest=/usr/lib/pypy3.6
256 - einfo "Installing PyPy ..."
257 - exeinto "${dest}"
258 - doexe pypy3-c libpypy3-c.so
259 - pax-mark m "${ED}${dest}/pypy3-c" "${ED}${dest}/libpypy3-c.so"
260 - insinto "${dest}"
261 - # preserve mtimes to avoid obsoleting caches
262 - insopts -p
263 - doins -r include lib_pypy lib-python
264 - dosym ../lib/pypy3.6/pypy3-c /usr/bin/pypy3
265 - dodoc README.rst
266 -
267 - if ! use gdbm; then
268 - rm -r "${ED}${dest}"/lib_pypy/_gdbm* || die
269 - fi
270 - if ! use sqlite; then
271 - rm -r "${ED}${dest}"/lib-python/*3/sqlite3 \
272 - "${ED}${dest}"/lib_pypy/_sqlite3* \
273 - "${ED}${dest}"/lib-python/*3/test/test_sqlite.py || die
274 - fi
275 - if ! use tk; then
276 - rm -r "${ED}${dest}"/lib-python/*3/{idlelib,tkinter} \
277 - "${ED}${dest}"/lib_pypy/_tkinter \
278 - "${ED}${dest}"/lib-python/*3/test/test_{tcl,tk,ttk*}.py || die
279 - fi
280 -
281 - einfo "Generating caches and byte-compiling ..."
282 -
283 - local -x PYTHON=${ED}${dest}/pypy3-c
284 - # we can't use eclass function since PyPy is dumb and always gives
285 - # paths relative to the interpreter
286 - local PYTHON_SITEDIR=${EPREFIX}/usr/lib/pypy3.6/site-packages
287 - python_export pypy3 EPYTHON
288 -
289 - echo "EPYTHON='${EPYTHON}'" > epython.py || die
290 - python_domodule epython.py
291 -
292 - einfo "Byte-compiling Python standard library..."
293 -
294 - # compile the installed modules
295 - python_optimize "${ED}${dest}"
296 -}