Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/dev/mgorny:master commit in: dev-binpkg/pypy3/
Date: Sat, 20 Apr 2019 23:29:07
Message-Id: 1555673713.22c86b3ece8f8256edbbb437db543ec357373c18.mgorny@gentoo
1 commit: 22c86b3ece8f8256edbbb437db543ec357373c18
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Apr 19 11:35:13 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 19 11:35:13 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/dev/mgorny.git/commit/?id=22c86b3e
7
8 dev-binpkg/pypy3: Bump to 7.1.1
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-binpkg/pypy3/Manifest | 1 +
13 dev-binpkg/pypy3/pypy3-7.1.1.ebuild | 178 ++++++++++++++++++++++++++++++++++++
14 2 files changed, 179 insertions(+)
15
16 diff --git a/dev-binpkg/pypy3/Manifest b/dev-binpkg/pypy3/Manifest
17 index bd85b76..f058403 100644
18 --- a/dev-binpkg/pypy3/Manifest
19 +++ b/dev-binpkg/pypy3/Manifest
20 @@ -9,3 +9,4 @@ DIST pypy3.3-v5.2.0-alpha1-src.tar.bz2 24390595 BLAKE2B 597c2fde68b884592f2c0fb8
21 DIST pypy3.3-v5.5.0-alpha-src.tar.bz2 25122033 BLAKE2B 6d0fc60fd8f5461a043f7a48dc6faaf0fd886a83a87955053e4fd9aae33e3e0a84421319916284170ade4cb663d1aa3c0db761489745cda685a4d55efc0eccb1 SHA512 b2cf9700e45c452293297edffe08e572dffc3c567026b4b5d9165c1ba1b4d858ffc8a6754f5f28781020016c36440e5c02d07562d075b12444c9c32ea5dd2168
22 DIST pypy3.5-v7.0.0-src.tar.bz2 22730690 BLAKE2B 312aea1f88303b225bbfa5e82a28d3c2893d9977b03a3fd12923db15c4a77f04ec3fbce947f0684c4e27073836583ef8a5eaf5be05612e564172170740c2a6e3 SHA512 3facac26e06e254cbf244841824b35ec211859123f6ba9f095dc980292c10d9cf1d11de62cc6372cf77e92ee1cd2358bbd794b3ff25cb7172e1b21c02c8ce6c2
23 DIST pypy3.6-v7.1.0-src.tar.bz2 23167216 BLAKE2B 12a085c2d4820289643818d8bc1c17304e4cf4f4687054452d878c6f26fd36802bbbe5baee73f0ce2f0322e126dbccbcf7b48ca6569bb7eb8d59f473bd80d4b1 SHA512 1a0a9e9de31c63114c0537747c4a718504a28b780a2ef1f76bff6051a1ec68b496b574989f0b729c07611cd81e199135dd268834dfa6f9664e1e119db8ae20e4
24 +DIST pypy3.6-v7.1.1-src.tar.bz2 23171982 BLAKE2B be43528bc6f3e02d146016a4969bd8c7a9e880a3bd3b77f441aac6d22ef67700f71e0171ec000066bd2c0bd506db64af69d6b75b59a92222dd0353ee70e6629b SHA512 17e78f9c7080d597a6283d8e8247d1ca78f09a14ff221db8c3d90d255b5befc73102b317ca34a80979e544d5ee72f3e5e649f89d185a085f4cc15012da4d0473
25
26 diff --git a/dev-binpkg/pypy3/pypy3-7.1.1.ebuild b/dev-binpkg/pypy3/pypy3-7.1.1.ebuild
27 new file mode 100644
28 index 0000000..f1e198c
29 --- /dev/null
30 +++ b/dev-binpkg/pypy3/pypy3-7.1.1.ebuild
31 @@ -0,0 +1,178 @@
32 +# Copyright 1999-2019 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=7
36 +
37 +# pypy3 needs to be built using python 2
38 +PYTHON_COMPAT=( python2_7 pypy )
39 +inherit check-reqs pax-utils python-any-r1 toolchain-funcs
40 +
41 +MY_P=pypy3.6-v${PV}
42 +
43 +DESCRIPTION="A fast, compliant alternative implementation of the Python (3.6) language"
44 +HOMEPAGE="http://pypy.org/"
45 +SRC_URI="https://bitbucket.org/pypy/pypy/downloads/${MY_P}-src.tar.bz2"
46 +
47 +LICENSE="MIT"
48 +# pypy3 -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"))'
49 +SLOT="0/71"
50 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
51 +IUSE="bzip2 +jit libressl low-memory ncurses sandbox cpu_flags_x86_sse2"
52 +
53 +DEPEND=">=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 + ncurses? ( sys-libs/ncurses:0= )
61 + app-arch/lzip
62 + low-memory? ( virtual/pypy:0 )
63 + !low-memory? ( ${PYTHON_DEPS} )"
64 +# doc? ( dev-python/sphinx )
65 +
66 +S="${WORKDIR}/${MY_P}-src"
67 +
68 +pkg_pretend() {
69 + if [[ ${MERGE_TYPE} != binary ]]; then
70 + if use low-memory; then
71 + CHECKREQS_MEMORY="1750M"
72 + use amd64 && CHECKREQS_MEMORY="3500M"
73 + else
74 + CHECKREQS_MEMORY="3G"
75 + use amd64 && CHECKREQS_MEMORY="6G"
76 + fi
77 +
78 + check-reqs_pkg_pretend
79 + fi
80 +}
81 +
82 +pkg_setup() {
83 + if [[ ${MERGE_TYPE} != binary ]]; then
84 + pkg_pretend
85 +
86 + # unset to allow forcing pypy below :)
87 + use low-memory && local EPYTHON=
88 + if python_is_installed pypy && [[ ! ${EPYTHON} || ${EPYTHON} == pypy ]]; then
89 + einfo "Using PyPy to perform the translation."
90 + local EPYTHON=pypy
91 + else
92 + einfo "Using ${EPYTHON:-python2} to perform the translation. Please note that upstream"
93 + einfo "recommends using PyPy for that. If you wish to do so, please install"
94 + einfo "virtual/pypy and ensure that EPYTHON variable is unset."
95 + fi
96 +
97 + python-any-r1_pkg_setup
98 +
99 + local cpu
100 + if use amd64; then
101 + # common denominator between Intel & AMD
102 + cpu='x86-64'
103 + elif use x86; then
104 + if use cpu_flags_x86_sse2; then
105 + # lowest with SSE2
106 + cpu='pentium-m'
107 + else
108 + # lowest with SSE, compat. with athlon-xp
109 + # TODO: do we want to support something older?
110 + cpu='pentium3'
111 + fi
112 + else
113 + die "Unsupported arch ${ARCH}"
114 + fi
115 +
116 + export CFLAGS="-march=${cpu} -mtune=generic -O2 -pipe"
117 + export CXXFLAGS=${CFLAGS}
118 +
119 + elog "CFLAGS: ${CFLAGS}"
120 + fi
121 +}
122 +
123 +src_prepare() {
124 + eapply "${FILESDIR}"/5.9.0-shared-lib.patch # 517002
125 +
126 + eapply_user
127 +}
128 +
129 +src_configure() {
130 + tc-export CC
131 +
132 + local args=(
133 + --shared
134 + $(usex jit -Ojit -O2)
135 + $(usex sandbox --sandbox '')
136 +
137 + --jit-backend=auto
138 +
139 + pypy/goal/targetpypystandalone
140 + )
141 +
142 + # Avoid linking against libraries disabled by use flags
143 + local opts=(
144 + bzip2:bz2
145 + ncurses:_minimal_curses
146 + )
147 +
148 + local opt
149 + for opt in "${opts[@]}"; do
150 + local flag=${opt%:*}
151 + local mod=${opt#*:}
152 +
153 + args+=(
154 + $(usex ${flag} --withmod --withoutmod)-${mod}
155 + )
156 + done
157 +
158 + local interp=( "${PYTHON}" )
159 + if use low-memory; then
160 + interp=( env PYPY_GC_MAX_DELTA=200MB
161 + "${PYTHON}" --jit loop_longevity=300 )
162 + fi
163 +
164 + # translate into the C sources
165 + # we're going to make them ourselves since otherwise pypy does not
166 + # free up the unneeded memory before spawning the compiler
167 + set -- "${interp[@]}" rpython/bin/rpython --batch --source "${args[@]}"
168 + echo -e "\033[1m${@}\033[0m"
169 + "${@}" || die "translation failed"
170 +}
171 +
172 +src_compile() {
173 + emake -C "${T}"/usession*-0/testing_1
174 +
175 + # copy back to make sys.prefix happy
176 + cp -p "${T}"/usession*-0/testing_1/{pypy3-c,libpypy3-c.so} . || die
177 + pax-mark m pypy3-c libpypy3-c.so
178 +
179 + #use doc && emake -C pypy/doc html
180 +}
181 +
182 +src_install() {
183 + local flags=( bzip2 jit ncurses sandbox )
184 + use x86 && flags+=( cpu_flags_x86_sse2 )
185 + local f suffix="-${ARCH}"
186 +
187 + for f in ${flags[@]}; do
188 + use ${f} && suffix+="+${f#cpu_flags_x86_}"
189 + done
190 +
191 + local BIN_P=pypy3-bin-${PV}
192 +
193 + einfo "Zipping PyPy ..."
194 + mkdir "${BIN_P}${suffix}"{,/include} || die
195 + mv pypy3-c libpypy3-c.so "${BIN_P}${suffix}"/ || die
196 + mv include/pypy_* "${BIN_P}${suffix}"/include/ || die
197 + chmod +x "${BIN_P}${suffix}"/pypy3-c || die
198 +
199 + tar -cf "${BIN_P}${suffix}.tar" "${BIN_P}${suffix}" || die
200 + lzip -v9 "${BIN_P}${suffix}.tar" || die
201 +}
202 +
203 +# Yup, very hacky.
204 +pkg_preinst() {
205 + # integrity check.
206 + [[ ${PYPY_BINPKG_STORE} ]] || die 'PYPY_BINPKG_STORE unset, wtf?!'
207 + mkdir -p "${ROOT%/}${PYPY_BINPKG_STORE}" || die
208 + mv "${S}"/*.tar.lz "${ROOT%/}${PYPY_BINPKG_STORE}" || die
209 +}