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-bin/
Date: Thu, 04 Oct 2018 17:10:22
Message-Id: 1538672993.43f216a25f973282b9f5ecffc7e9a16d2f3657e1.mgorny@gentoo
1 commit: 43f216a25f973282b9f5ecffc7e9a16d2f3657e1
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Thu Oct 4 15:20:28 2018 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Thu Oct 4 17:09:53 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=43f216a2
7
8 dev-python/pypy3-bin: Add a version built against libffi.so.7
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/pypy3-bin/Manifest | 5 +
13 dev-python/pypy3-bin/pypy3-bin-6.0.0-r100.ebuild | 183 +++++++++++++++++++++++
14 2 files changed, 188 insertions(+)
15
16 diff --git a/dev-python/pypy3-bin/Manifest b/dev-python/pypy3-bin/Manifest
17 index 78048a44c10..238fe3e36bf 100644
18 --- a/dev-python/pypy3-bin/Manifest
19 +++ b/dev-python/pypy3-bin/Manifest
20 @@ -5,6 +5,11 @@ DIST pypy3-bin-5.10.1-x86+bzip2+ncurses+sse2.tar.lz 5351320 BLAKE2B e45ede827a98
21 DIST pypy3-bin-5.10.1-x86+bzip2+ncurses.tar.lz 5343927 BLAKE2B 27c5842a1f00ff9b56c1417c290ab677bc8e1cff36ce5d226f1e3e262b14c0f0e8a5f3d474e23bcaef467b8210357d0724e752d9249f275c16cc645e59cd1530 SHA512 6f7ff616d6d0532ce4919d5e6cd69a46fd81c548efda2869653ce07d736d83f256f302040726931d85c83a297ab4c7f6e15675a17576fbffa4313a48435e182e
22 DIST pypy3-bin-6.0.0-amd64+bzip2+jit+ncurses.tar.lz 10674209 BLAKE2B f9e00ba0cdc113ebe156212c5497e122a45bc9544cb242ad02273e06210eb691f930aee7faf1d4ed3a7b14080905a9cb6d30b309c38a2c3795f2183750b4469f SHA512 52e615e2b51a43a2c91f9a2a8f0cec16a6090bfd230ef08dda462bb530da9ee66acec9c449e77f299e0b3363d6bcbc7150b14e7adbe9862d36f4738dfc6be1ca
23 DIST pypy3-bin-6.0.0-amd64+bzip2+ncurses.tar.lz 6703329 BLAKE2B 64ad2b2ae1580833735dc5ce4b821f79458c98c5f761d7c9834624aff172204ac16e23582e3a776baa85accd221a9fd2225c22099de1de9c319b4f29b5f15071 SHA512 57b2e2f0ddc8d6f78beff6c049adb0a8d316db1d9f7bf5e07e4e593fa363e5ced37d212f549c0a5305459207694ac5a6aac9698a1ca3a4bf56a4437899b7e97b
24 +DIST pypy3-bin-6.0.0-ffi7-amd64+bzip2+jit+ncurses.tar.lz 10697120 BLAKE2B 3e368d0fb6b875472d79b531bef926bedddf73c1f2bb25e00f56cd41c4349be119281d2c2d52239bd2769f3f9810280f8c00d9332e02b8664e46de06f2c112d8 SHA512 2e9c405212d35289a8add374cae185bf9096a46604c4e2935f1a58bee51aa756b311e5b611098e917da7fbd10194706fca809249f627b7d4b8c628bf9b38aa54
25 +DIST pypy3-bin-6.0.0-ffi7-amd64+bzip2+ncurses.tar.lz 6710567 BLAKE2B 239badab3e3f4cb17116f2d2b3cbf58f7a481bdbc78d813563f5a7c2c67002cce598de70ebdbdd8d5dc348ec5db07559a2f35e712ebe46d1f472f2b2ccb9fa05 SHA512 ae3e76c2df50a2ec39e8f447fcacf913a1e9a3cf1268324ddc303b35e8a7a07413278e313e92579c311238ec185cb61d3d97fcbf6e972846859dc423792f55f0
26 +DIST pypy3-bin-6.0.0-ffi7-x86+bzip2+jit+ncurses+sse2.tar.lz 8253376 BLAKE2B 6ea95d691a5ccbb89bfd5f9351199f3d3cd4cb855d44937db58ac6327b80b71ed5d15f5dcbdc961ccf5ea1fa945ba31917716a3b9ff79327f4db3a99961569c2 SHA512 e68722eb0004680df884ff98bda906e94a5252c4e6b3ca55fe2df48a5a18d9dccc0218906c6b71a579a7a97da3a4633bb42317a276ee2640a16a9d31c1939f8e
27 +DIST pypy3-bin-6.0.0-ffi7-x86+bzip2+ncurses+sse2.tar.lz 5384351 BLAKE2B 952676b1ec9c71b5ec477011ec4c5020512508f7c40009d8715972726469319bccb30546105dd68be22a02572f6646f06057495442da12d889ac9695a1b14537 SHA512 c4b4289b9348ad35f79f0581e2d3a8cf1109a3edfb52cccf8e04a0089c706ae12de819d901f875bff3a439680694a98c85605c1b9abfd7fd4ff825846c2c89e3
28 +DIST pypy3-bin-6.0.0-ffi7-x86+bzip2+ncurses.tar.lz 5384380 BLAKE2B 7e452d0b163f401d0741e95aa2f55e84eb223eb3152f0299b365d1dd53268d315496977d988149c29e0e3439834d7283bfa9a9e05f2d7a8abb3f3d65aa05e567 SHA512 d743c4275abfbce1ef1ae2949e93097faeca8377e38761183ff7d0cc23b92d93700bf370d1511c968743e769a0b41acfeae01543885cc55bef8cdd2c6817af0f
29 DIST pypy3-bin-6.0.0-x86+bzip2+jit+ncurses+sse2.tar.lz 8268406 BLAKE2B 8200d7cfc5bd813cf3138017c96cace1c07bc031f68d5a9df2f71cb887a5dd3bb979dbc67d395389c965904037935a518bf6c1492b04ce5a9f21a9bb3bb5504a SHA512 4c09c454b25faa51024c5319ba5e91f4b1883bdd25f504694f83011ef1faffe7aa28a51369d3c5c6bb9f0d8eb53d1292d57608343b731c67ceeb99f41736b044
30 DIST pypy3-bin-6.0.0-x86+bzip2+ncurses+sse2.tar.lz 5363942 BLAKE2B d53b89ef73c2d4ee2bc00360a0c4a791fd8b6ac2d28dfeeb7510a465e6302f79c378aacebbaf4993b6ee55dbc6d85876149fe3f5a0d689713f029c928d93a729 SHA512 ce72d84200dd275841e691810dbf402423883b282cacbe8bbdae9285936869d40b3d43d053b0f3d4904c7ced72f35480d1780358180a1c98e8111852fef1f77f
31 DIST pypy3-bin-6.0.0-x86+bzip2+ncurses.tar.lz 5366917 BLAKE2B 338a9c221048dabc548250edec05256be64dd5d1aeb5b2fff839d7d5e8dda29e7d4e0a03b1fc0c9cd418685c558bb47598c625e2d28cd4caabc45e21eee9f4f8 SHA512 5274535d01564a9087aea486320921c8784cabcc7bde3634c27b9006988fdc745e6e5e5c2fb8e7b0318fd5ca6fda3fce208743cfa079a7474ea44277237ea873
32
33 diff --git a/dev-python/pypy3-bin/pypy3-bin-6.0.0-r100.ebuild b/dev-python/pypy3-bin/pypy3-bin-6.0.0-r100.ebuild
34 new file mode 100644
35 index 00000000000..d98c618d9eb
36 --- /dev/null
37 +++ b/dev-python/pypy3-bin/pypy3-bin-6.0.0-r100.ebuild
38 @@ -0,0 +1,183 @@
39 +# Copyright 1999-2018 Gentoo Foundation
40 +# Distributed under the terms of the GNU General Public License v2
41 +
42 +EAPI=6
43 +
44 +# Test runner needs Python 2.
45 +PYTHON_COMPAT=( python2_7 pypy )
46 +inherit pax-utils python-any-r1 unpacker versionator
47 +
48 +BINHOST="https://dev.gentoo.org/~mgorny/dist/pypy3-bin/${PV}-ffi7"
49 +MY_P=pypy3-v${PV}
50 +
51 +DESCRIPTION="A fast, compliant alternative implementation of Python 3.3 (binary package)"
52 +HOMEPAGE="http://pypy.org/"
53 +SRC_URI="https://bitbucket.org/pypy/pypy/downloads/${MY_P}-src.tar.bz2
54 + amd64? (
55 + jit? ( ${BINHOST}/${P}-ffi7-amd64+bzip2+jit+ncurses.tar.lz )
56 + !jit? ( ${BINHOST}/${P}-ffi7-amd64+bzip2+ncurses.tar.lz )
57 + )
58 + x86? (
59 + cpu_flags_x86_sse2? (
60 + jit? ( ${BINHOST}/${P}-ffi7-x86+bzip2+jit+ncurses+sse2.tar.lz )
61 + !jit? ( ${BINHOST}/${P}-ffi7-x86+bzip2+ncurses+sse2.tar.lz )
62 + )
63 + !cpu_flags_x86_sse2? (
64 + !jit? ( ${BINHOST}/${P}-ffi7-x86+bzip2+ncurses.tar.lz )
65 + )
66 + )"
67 +
68 +# Supported variants
69 +REQUIRED_USE="x86? ( !cpu_flags_x86_sse2? ( !jit ) )"
70 +
71 +LICENSE="MIT"
72 +# pypy -c 'import sysconfig; print sysconfig.get_config_var("SOABI")'
73 +SLOT="0/60"
74 +KEYWORDS="~amd64 ~x86"
75 +IUSE="gdbm +jit libressl sqlite cpu_flags_x86_sse2 test tk"
76 +
77 +RDEPEND="
78 + app-arch/bzip2:0/1
79 + dev-libs/expat:0/0
80 + dev-libs/libffi:0/7
81 + sys-devel/gcc:*
82 + sys-libs/glibc
83 + sys-libs/ncurses:0/6
84 + sys-libs/zlib:0/1
85 + gdbm? ( sys-libs/gdbm:0= )
86 + !libressl? ( dev-libs/openssl:0=[-bindist] )
87 + libressl? ( dev-libs/libressl:0= )
88 + sqlite? ( dev-db/sqlite:3= )
89 + tk? (
90 + dev-lang/tk:0=
91 + dev-tcltk/tix:0=
92 + )
93 + !dev-python/pypy3:0"
94 +DEPEND="${RDEPEND}
95 + app-arch/lzip
96 + app-arch/xz-utils
97 + test? ( ${PYTHON_DEPS} )"
98 +
99 +S=${WORKDIR}/${MY_P}-src
100 +
101 +QA_PREBUILT="
102 + usr/lib*/pypy3/pypy3-c
103 + usr/lib*/pypy3/libpypy3-c.so"
104 +
105 +src_prepare() {
106 + eapply "${FILESDIR}/4.0.0-gentoo-path.patch"
107 + eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
108 +
109 + sed -e "s^@EPREFIX@^${EPREFIX}^" \
110 + -e "s^@libdir@^$(get_libdir)^" \
111 + -i lib-python/3/distutils/command/install.py || die
112 +
113 + # apply CPython stdlib patches
114 + pushd lib-python/3 > /dev/null || die
115 + eapply "${FILESDIR}"/5.8.0_all_distutils_cxx.patch
116 + eapply "${FILESDIR}"/python-3.5-distutils-OO-build.patch
117 + popd > /dev/null || die
118 +
119 + eapply_user
120 +}
121 +
122 +src_compile() {
123 + # Tadaam! PyPy compiled!
124 + mv "${WORKDIR}"/${P}*/{libpypy3-c.so,pypy3-c} . || die
125 + mv "${WORKDIR}"/${P}*/include/*.h include/ || die
126 + mv pypy/module/cpyext/include/*.h include/ || die
127 + mv pypy/module/cpyext/parse/*.h include/ || die
128 +
129 + pax-mark m pypy3-c libpypy3-c.so
130 +
131 + einfo "Generating caches and CFFI modules ..."
132 +
133 + # Generate Grammar and PatternGrammar pickles.
134 + ./pypy3-c -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
135 + || die "Generation of Grammar and PatternGrammar pickles failed"
136 +
137 + # Generate cffi modules
138 + # Please keep in sync with pypy/tool/build_cffi_imports.py!
139 +#cffi_build_scripts = {
140 +# "sqlite3": "_sqlite3_build.py",
141 +# "audioop": "_audioop_build.py",
142 +# "tk": "_tkinter/tklib_build.py",
143 +# "curses": "_curses_build.py" if sys.platform != "win32" else None,
144 +# "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
145 +# "_gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
146 +# "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
147 +# "resource": "_resource_build.py" if sys.platform != "win32" else None,
148 +# "lzma": "_lzma_build.py",
149 +# "_decimal": "_decimal_build.py",
150 +# "ssl": "_ssl_build.py",
151 + cffi_targets=( audioop curses syslog pwdgrp resource lzma decimal ssl )
152 + use gdbm && cffi_targets+=( gdbm )
153 + use sqlite && cffi_targets+=( sqlite3 )
154 + use tk && cffi_targets+=( tkinter/tklib )
155 +
156 + local t
157 + # all modules except tkinter output to .
158 + # tkinter outputs to the correct dir ...
159 + cd lib_pypy || die
160 + for t in "${cffi_targets[@]}"; do
161 + # tkinter doesn't work via -m
162 + ../pypy3-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
163 + done
164 +
165 + # Cleanup temporary objects
166 + find -name "_cffi_*.[co]" -delete || die
167 + find -type d -empty -delete || die
168 +}
169 +
170 +src_test() {
171 + # (unset)
172 + local -x PYTHONDONTWRITEBYTECODE=
173 +
174 + # Test runner requires Python 2 too. However, it spawns PyPy3
175 + # internally so that we end up testing the correct interpreter.
176 + "${PYTHON}" ./pypy/test_all.py --pypy=./pypy3-c -vv lib-python || die
177 +}
178 +
179 +src_install() {
180 + local dest=/usr/$(get_libdir)/pypy3
181 + einfo "Installing PyPy ..."
182 + exeinto "${dest}"
183 + doexe pypy3-c libpypy3-c.so
184 + pax-mark m "${ED%/}${dest}/pypy3-c" "${ED%/}${dest}/libpypy3-c.so"
185 + insinto "${dest}"
186 + # preserve mtimes to avoid obsoleting caches
187 + insopts -p
188 + doins -r include lib_pypy lib-python
189 + dosym ../$(get_libdir)/pypy3/pypy3-c /usr/bin/pypy3
190 + dodoc README.rst
191 +
192 + if ! use gdbm; then
193 + rm -r "${ED%/}${dest}"/lib_pypy/_gdbm* || die
194 + fi
195 + if ! use sqlite; then
196 + rm -r "${ED%/}${dest}"/lib-python/*3/sqlite3 \
197 + "${ED%/}${dest}"/lib_pypy/_sqlite3* \
198 + "${ED%/}${dest}"/lib-python/*3/test/test_sqlite.py || die
199 + fi
200 + if ! use tk; then
201 + rm -r "${ED%/}${dest}"/lib-python/*3/{idlelib,tkinter} \
202 + "${ED%/}${dest}"/lib_pypy/_tkinter \
203 + "${ED%/}${dest}"/lib-python/*3/test/test_{tcl,tk,ttk*}.py || die
204 + fi
205 +
206 + einfo "Generating caches and byte-compiling ..."
207 +
208 + local -x PYTHON=${ED%/}${dest}/pypy3-c
209 + # we can't use eclass function since PyPy is dumb and always gives
210 + # paths relative to the interpreter
211 + local PYTHON_SITEDIR=${EPREFIX}/usr/$(get_libdir)/pypy3/site-packages
212 + python_export pypy3 EPYTHON
213 +
214 + echo "EPYTHON='${EPYTHON}'" > epython.py || die
215 + python_domodule epython.py
216 +
217 + einfo "Byte-compiling Python standard library..."
218 +
219 + # compile the installed modules
220 + python_optimize "${ED%/}${dest}"
221 +}