dev-python/pypy-bin: Bump to 7.2.0
authorMichał Górny <mgorny@gentoo.org>
Fri, 18 Oct 2019 15:54:15 +0000 (17:54 +0200)
committerMichał Górny <mgorny@gentoo.org>
Fri, 18 Oct 2019 16:24:20 +0000 (18:24 +0200)
Signed-off-by: Michał Górny <mgorny@gentoo.org>
dev-python/pypy-bin/Manifest
dev-python/pypy-bin/pypy-bin-7.2.0.ebuild [new file with mode: 0644]

index faec8ae0817dfd0c664ac8357ebbfba21f08628a..de743c9b6123509fe1cd4ac8cef1c8e5ba039f87 100644 (file)
@@ -8,5 +8,10 @@ DIST pypy-bin-7.1.1-x86+bzip2+libressl+ncurses+sse2.tar.lz 6092434 BLAKE2B 71141
 DIST pypy-bin-7.1.1-x86+bzip2+libressl+ncurses.tar.lz 6060032 BLAKE2B 660d834c3a76ed699170b7c13d36f6dc00df3b4811a09c5dec161af7f9b0416c7fda461ca04481ad656bea39b6ed25f5220b8d38c8ec02c9634a025e3b3d6cfc SHA512 21baa8cd6bd255a335c67a1197ccef856553987740f517e1b33c27758e57b61c22b8274419b445a257ad32511d3c07901d4550151047e04adcd39c9cbf20058e
 DIST pypy-bin-7.1.1-x86+bzip2+ncurses+sse2.tar.lz 6091202 BLAKE2B c173cf6890143e27677e6d6ee68b2a1f55ec97897817622559c25f2f49ca5bbb5a0a2c32785a3356a6bb8f4899ff19164e550fd2762003ee018faadf80227c95 SHA512 a630e380177da78daef288e69f15a4cb333c4ef1ab2da8b4b6cf76ec139c1961d692873c7ec119e54f596ef4e1435a6c6b3ef933edca2b0b5cd6fc24963d3b0d
 DIST pypy-bin-7.1.1-x86+bzip2+ncurses.tar.lz 6088838 BLAKE2B 555bca61d4693b3e5d3c8344bac3781cfe06acc4a50bcd74add2d122c68f177258ef438a7801ca4633a006e8a001500110287934f232ceb52789f3cc72b9b34b SHA512 0748e14e903b0863bb2a067b558826f47cad2063c31c935b84249eee2a9cf96cfa36a5d5ef92f0facca61356499f4b9cfee6496a6cc3228bae7729e50edf6be0
+DIST pypy-bin-7.2.0-amd64+bzip2+jit+ncurses.tar.lz 13208672 BLAKE2B 526e2f4eeb57d1f169344244384f3aa35d77bd0f9dc4e1f463248eeac023e7c98a21e565080d0cc3e56c1950128450b1fc6e830e33032e8267aa21c5beb4f80b SHA512 d49942d1cd97ab580850b95590cf0982eb7f53e0b88681408392266cdad814d00d195edd757b106e4016d8df9e0d3c53bf937de145f9257313f33ffb86c2229e
+DIST pypy-bin-7.2.0-amd64+bzip2+ncurses.tar.lz 7865924 BLAKE2B 1d3cf776274285aee433de2dc8ebd5e0bf52a7cc700f1bbfb16ca071ac5b6017dddad211d9dcdf809f97289e12d38e5758023dbd80c6a68323ffaa02e8c72614 SHA512 ad481a62359c615a0fcb1bb3e57b84c536b43d569ac88393000bd8b9e9d0fc3e685c3907cfcf241c3dc60479589d042009ffe1382a27be2581c8ab421e7f0397
+DIST pypy-bin-7.2.0-x86+bzip2+jit+ncurses+sse2.tar.lz 9887935 BLAKE2B 177780ff596b1256f623982ba44ec2ec1c951e420a4521520ffee93e6e480864c59e8e55769f583841a0622693a578f84f408f6e577f97e7812ced7fb7594104 SHA512 dd0c71bff27beaef98ab0ce114108cd586863ef2d6eac999dbb0bdbef7cda1f5f568b465e803339a7b92262354bfe674cc6161ee1c0d479545c6d7bcd58ec3cd
+DIST pypy-bin-7.2.0-x86+bzip2+ncurses+sse2.tar.lz 6092349 BLAKE2B e285f4c5443c356cba90c0e56dcf9ad75357613bcf486e80816d4304bc9459ba53250a58f09155382f6ebb624610780a9f77c312aeb55a28236474cedf994e26 SHA512 0a4d782f5b074cc5fb206cd2843a59ea59c3a17ac8fd8bf2c74f0997d906e5f722142f0d33a20cdb3a7c7eb476f3799a797d5c2ccac2632c425317d38cb54b7c
 DIST pypy2.7-v7.1.1-src.tar.bz2 20027876 BLAKE2B a411d7312ed3b9be9297e7ff4cc569530529272156117ca037bbe29ad477e7ce3b8903d13c6a5a35e9867a8ccbfaa418061a7b37317b4b713508c429a41ffe9a SHA512 f998931ecf4f9aeee24f0fed95589716175971816c00e50bc53de6de0cfe2a8537b89c1aee636d15faecf91df8c29943295485686185f5247a3e0913fa514f48
+DIST pypy2.7-v7.2.0-src.tar.bz2 20219532 BLAKE2B 225e2cebdfa3ceb310f2a047b1d9e1d375b181c10707822890f39fc0a5ec9e6ddd7a8cf6e073074067960b766a0a813294042513a08b8e7e02b011f612e17917 SHA512 8f724490f9fa06686c8e25ddd3592b260bbffae460395de4c7d29d983780ce9b8925fa87434aac6446aac2034381cc1a13074faf252f5d1ac466a252f219f1ae
 DIST python-gentoo-patches-2.7.15.tar.xz 16208 BLAKE2B 5739c2b3a236d48f8e33f0fe6515bfe7a8f99096f6223b402653988feac2513d37d26b6e40e5e049852f42657358170e468ca60097e0e2294e760787c12ad591 SHA512 687fd008d1d41b1e65ce5417f6f6aba84ffd42f7af44ef97c03a7806b28e6888f8df043a0c15187a8b229cc17642853e6feb25494db97f4d10f8a66f8ebcbcca
diff --git a/dev-python/pypy-bin/pypy-bin-7.2.0.ebuild b/dev-python/pypy-bin/pypy-bin-7.2.0.ebuild
new file mode 100644 (file)
index 0000000..5cc2d81
--- /dev/null
@@ -0,0 +1,188 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit pax-utils python-utils-r1 unpacker
+
+BINHOST="https://dev.gentoo.org/~mgorny/dist/pypy-bin/${PV}"
+CPY_PATCHSET_VERSION="2.7.15"
+MY_P=pypy2.7-v${PV}
+
+DESCRIPTION="Pre-built version of PyPy"
+HOMEPAGE="https://pypy.org/"
+SRC_URI="https://bitbucket.org/pypy/pypy/downloads/${MY_P}-src.tar.bz2
+       https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${CPY_PATCHSET_VERSION}.tar.xz
+       amd64? (
+               jit? ( ${BINHOST}/${P}-amd64+bzip2+jit+ncurses.tar.lz )
+               !jit? ( ${BINHOST}/${P}-amd64+bzip2+ncurses.tar.lz )
+       )
+       x86? (
+               cpu_flags_x86_sse2? (
+                       jit? ( ${BINHOST}/${P}-x86+bzip2+jit+ncurses+sse2.tar.lz )
+                       !jit? ( ${BINHOST}/${P}-x86+bzip2+ncurses+sse2.tar.lz )
+               )
+       )"
+
+LICENSE="MIT"
+# pypy -c 'import sysconfig; print sysconfig.get_config_var("SOABI")'
+# pypy 7.0.0: install directory changed to 'pypy2.7'
+SLOT="0/41-py27"
+KEYWORDS="~amd64 ~x86"
+IUSE="gdbm +jit libressl sqlite cpu_flags_x86_sse2 tk"
+# Supported variants
+REQUIRED_USE="x86? ( cpu_flags_x86_sse2 )"
+
+RDEPEND="
+       app-arch/bzip2:0/1
+       dev-libs/expat:0/0
+       dev-libs/libffi:0/7
+       sys-devel/gcc:*
+       >=sys-libs/glibc-2.28
+       sys-libs/ncurses:0/6
+       sys-libs/zlib:0/1
+       gdbm? ( sys-libs/gdbm:0= )
+       !libressl? ( dev-libs/openssl:0=[-bindist] )
+       libressl? ( dev-libs/libressl:0= )
+       sqlite? ( dev-db/sqlite:3= )
+       tk? (
+               dev-lang/tk:0=
+               dev-tcltk/tix:0=
+       )
+       !dev-python/pypy:0"
+DEPEND="${RDEPEND}
+       app-arch/lzip
+       app-arch/xz-utils"
+
+S=${WORKDIR}/${MY_P}-src
+
+QA_PREBUILT="
+       usr/lib/pypy2.7/pypy-c
+       usr/lib/pypy2.7/libpypy-c.so"
+
+src_prepare() {
+       eapply "${FILESDIR}/7.0.0-gentoo-path.patch"
+       eapply "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
+
+       sed -e "s^@EPREFIX@^${EPREFIX}^" \
+               -i lib-python/2.7/distutils/command/install.py || die
+
+       # apply CPython stdlib patches
+       pushd lib-python/2.7 > /dev/null || die
+       # TODO: cpy turkish locale patch now fixes C code
+       # probably needs better port to pypy, if it is broken there
+       eapply "${FILESDIR}"/5.8.0_all_distutils_cxx.patch
+       eapply -p2 "${WORKDIR}"/patches/0011-use_pyxml.patch
+       popd > /dev/null || die
+
+       eapply_user
+}
+
+src_compile() {
+       # Tadaam! PyPy compiled!
+       mv "${WORKDIR}"/${P}*/{libpypy-c.so,pypy-c} . || die
+       mv "${WORKDIR}"/${P}*/include/*.h include/ || die
+       # (not installed by pypy)
+       rm pypy/module/cpyext/include/_numpypy/numpy/README || die
+       mv pypy/module/cpyext/include/* include/ || die
+       mv pypy/module/cpyext/parse/*.h include/ || die
+
+       pax-mark m pypy-c libpypy-c.so
+
+       einfo "Generating caches and CFFI modules ..."
+
+       # Generate Grammar and PatternGrammar pickles.
+       ./pypy-c -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \
+               || die "Generation of Grammar and PatternGrammar pickles failed"
+
+       # Generate cffi modules
+       # Please keep in sync with pypy/tool/build_cffi_imports.py!
+#cffi_build_scripts = {
+#    "_ssl": "_ssl_build.py",
+#    "sqlite3": "_sqlite3_build.py",
+#    "audioop": "_audioop_build.py",
+#    "tk": "_tkinter/tklib_build.py",
+#    "curses": "_curses_build.py" if sys.platform != "win32" else None,
+#    "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
+#    "gdbm": "_gdbm_build.py"  if sys.platform != "win32" else None,
+#    "pwdgrp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
+#    "resource": "_resource_build.py" if sys.platform != "win32" else None,
+       cffi_targets=( ssl audioop curses syslog pwdgrp resource )
+       use gdbm && cffi_targets+=( gdbm )
+       use sqlite && cffi_targets+=( sqlite3 )
+       use tk && cffi_targets+=( tkinter/tklib )
+
+       local t
+       # all modules except tkinter output to .
+       # tkinter outputs to the correct dir ...
+       cd lib_pypy || die
+       for t in "${cffi_targets[@]}"; do
+               # tkinter doesn't work via -m
+               ../pypy-c "_${t}_build.py" || die "Failed to build CFFI bindings for ${t}"
+       done
+
+       # Cleanup temporary objects
+       find -name "_cffi_*.[co]" -delete || die
+       find -type d -empty -delete || die
+}
+
+src_test() {
+       # (unset)
+       local -x PYTHONDONTWRITEBYTECODE=
+
+       local ignored_tests=(
+               # network
+               --ignore=lib-python/2.7/test/test_urllibnet.py
+               --ignore=lib-python/2.7/test/test_urllib2net.py
+               # lots of free space
+               --ignore=lib-python/2.7/test/test_zipfile64.py
+               # no module named 'worker' -- a lot
+               --ignore=lib-python/2.7/test/test_xpickle.py
+       )
+
+       ./pypy-c ./pypy/test_all.py --pypy=./pypy-c -vv \
+               "${ignored_tests[@]}" lib-python || die
+}
+
+src_install() {
+       local dest=/usr/lib/pypy2.7
+       einfo "Installing PyPy ..."
+       exeinto "${dest}"
+       doexe pypy-c libpypy-c.so
+       pax-mark m "${ED}${dest}/pypy-c" "${ED}${dest}/libpypy-c.so"
+       insinto "${dest}"
+       # preserve mtimes to avoid obsoleting caches
+       insopts -p
+       doins -r include lib_pypy lib-python
+       dosym ../lib/pypy2.7/pypy-c /usr/bin/pypy
+       dodoc README.rst
+
+       if ! use gdbm; then
+               rm -r "${ED}${dest}"/lib_pypy/gdbm.py \
+                       "${ED}${dest}"/lib-python/*2.7/test/test_gdbm.py || die
+       fi
+       if ! use sqlite; then
+               rm -r "${ED}${dest}"/lib-python/*2.7/sqlite3 \
+                       "${ED}${dest}"/lib_pypy/_sqlite3.py \
+                       "${ED}${dest}"/lib-python/*2.7/test/test_sqlite.py || die
+       fi
+       if ! use tk; then
+               rm -r "${ED}${dest}"/lib-python/*2.7/{idlelib,lib-tk} \
+                       "${ED}${dest}"/lib_pypy/_tkinter \
+                       "${ED}${dest}"/lib-python/*2.7/test/test_{tcl,tk,ttk*}.py || die
+       fi
+
+       local -x PYTHON=${ED}${dest}/pypy-c
+       # we can't use eclass function since PyPy is dumb and always gives
+       # paths relative to the interpreter
+       local PYTHON_SITEDIR=${EPREFIX}/usr/lib/pypy2.7/site-packages
+       python_export pypy EPYTHON
+
+       echo "EPYTHON='${EPYTHON}'" > epython.py || die
+       python_domodule epython.py
+
+       einfo "Byte-compiling Python standard library..."
+
+       # compile the installed modules
+       python_optimize "${ED}${dest}"
+}