Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] dev/mgorny:master commit in: dev-binpkg/pypy/
Date: Fri, 27 Nov 2015 16:48:07
Message-Id: 1448642765.6fb82d45cc4789136fa40eca75f5083af144b7ee.mgorny@gentoo
1 commit: 6fb82d45cc4789136fa40eca75f5083af144b7ee
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Nov 27 16:46:05 2015 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Nov 27 16:46:05 2015 +0000
6 URL: https://gitweb.gentoo.org/dev/mgorny.git/commit/?id=6fb82d45
7
8 dev-binpkg/pypy: Remove old
9
10 dev-binpkg/pypy/pypy-2.5.1.ebuild | 197 --------------------------------------
11 1 file changed, 197 deletions(-)
12
13 diff --git a/dev-binpkg/pypy/pypy-2.5.1.ebuild b/dev-binpkg/pypy/pypy-2.5.1.ebuild
14 deleted file mode 100644
15 index 6551c6e..0000000
16 --- a/dev-binpkg/pypy/pypy-2.5.1.ebuild
17 +++ /dev/null
18 @@ -1,197 +0,0 @@
19 -# Copyright 1999-2015 Gentoo Foundation
20 -# Distributed under the terms of the GNU General Public License v2
21 -# $Header: /var/cvsroot/gentoo-x86/dev-python/pypy/pypy-2.5.0.ebuild,v 1.1 2015/03/22 08:56:03 idella4 Exp $
22 -
23 -EAPI=5
24 -
25 -PYTHON_COMPAT=( python2_7 pypy )
26 -inherit check-reqs eutils multilib multiprocessing pax-utils python-any-r1 toolchain-funcs versionator
27 -
28 -DESCRIPTION="A fast, compliant alternative implementation of the Python language"
29 -HOMEPAGE="http://pypy.org/"
30 -SRC_URI="https://bitbucket.org/pypy/pypy/downloads/${P}-src.tar.bz2"
31 -
32 -LICENSE="MIT"
33 -SLOT="0/$(get_version_component_range 1-2 ${PV})"
34 -KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
35 -IUSE="bzip2 +jit low-memory ncurses sandbox shadowstack cpu_flags_x86_sse2"
36 -
37 -DEPEND=">=sys-libs/zlib-1.1.3:0=
38 - virtual/libffi:0=
39 - virtual/libintl:0=
40 - dev-libs/expat:0=
41 - dev-libs/openssl:0=
42 - bzip2? ( app-arch/bzip2:0= )
43 - ncurses? ( sys-libs/ncurses:0= )
44 - app-arch/xz-utils
45 - ${PYTHON_DEPS}"
46 -
47 -S="${WORKDIR}/${P}-src"
48 -
49 -pkg_pretend() {
50 - if use low-memory; then
51 - if ! python_is_installed pypy; then
52 - eerror "USE=low-memory requires a (possibly old) version of dev-python/pypy"
53 - eerror "or dev-python/pypy-bin being installed. Please install it using e.g.:"
54 - eerror
55 - eerror " $ emerge -1v dev-python/pypy-bin"
56 - eerror
57 - eerror "before attempting to build dev-python/pypy[low-memory]."
58 - die "dev-python/pypy-bin (or dev-python/pypy) needs to be installed for USE=low-memory"
59 - fi
60 -
61 - CHECKREQS_MEMORY="1750M"
62 - use amd64 && CHECKREQS_MEMORY="3500M"
63 - else
64 - CHECKREQS_MEMORY="3G"
65 - use amd64 && CHECKREQS_MEMORY="6G"
66 - fi
67 -
68 - check-reqs_pkg_pretend
69 -
70 - [[ ${PYPY_BINPKG_STORE} ]] || die 'PYPY_BINPKG_STORE unset, wtf?!'
71 -}
72 -
73 -pkg_setup() {
74 - pkg_pretend
75 -
76 - if python_is_installed pypy; then
77 - if [[ ! ${EPYTHON} || ${EPYTHON} == pypy ]] || use low-memory; then
78 - einfo "Using already-installed PyPy to perform the translation."
79 - local EPYTHON=pypy
80 - else
81 - einfo "Using ${EPYTHON} to perform the translation. Please note that upstream"
82 - einfo "recommends using PyPy for that. If you wish to do so, please unset"
83 - einfo "the EPYTHON variable."
84 - fi
85 - fi
86 -
87 - python-any-r1_pkg_setup
88 -
89 - local cpu
90 - if use amd64; then
91 - # common denominator between Intel & AMD
92 - cpu='x86-64'
93 - elif use x86; then
94 - if use cpu_flags_x86_sse2; then
95 - # lowest with SSE2
96 - cpu='pentium-m'
97 - else
98 - # lowest with SSE, compat. with athlon-xp
99 - # TODO: do we want to support something older?
100 - cpu='pentium3'
101 - fi
102 - else
103 - die "Unsupported arch ${ARCH}"
104 - fi
105 -
106 - export CFLAGS="-march=${cpu} -mtune=generic -O2 -pipe"
107 - export CXXFLAGS=${CFLAGS}
108 -
109 - elog "CFLAGS: ${CFLAGS}"
110 -}
111 -
112 -src_prepare() {
113 - epatch "${FILESDIR}/1.9-scripts-location.patch" \
114 - "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch" \
115 - "${FILESDIR}"/2.5.0-shared-lib.patch # 517002
116 -
117 - pushd lib-python/2.7 > /dev/null || die
118 - epatch "${FILESDIR}"/2.5.0_all_distutils_cxx.patch
119 - popd > /dev/null || die
120 -
121 - epatch_user
122 -}
123 -
124 -src_compile() {
125 - tc-export CC
126 -
127 - local jit_backend
128 - if use jit; then
129 - jit_backend='--jit-backend='
130 -
131 - # We only need the explicit sse2 switch for x86.
132 - # On other arches we can rely on autodetection which uses
133 - # compiler macros. Plus, --jit-backend= doesn't accept all
134 - # the modern values...
135 -
136 - if use x86; then
137 - if use cpu_flags_x86_sse2; then
138 - jit_backend+=x86
139 - else
140 - jit_backend+=x86-without-sse2
141 - fi
142 - else
143 - jit_backend+=auto
144 - fi
145 - fi
146 -
147 - local args=(
148 - --shared
149 - $(usex jit -Ojit -O2)
150 - $(usex shadowstack --gcrootfinder=shadowstack '')
151 - $(usex sandbox --sandbox '')
152 -
153 - ${jit_backend}
154 - --make-jobs=$(makeopts_jobs)
155 -
156 - pypy/goal/targetpypystandalone
157 - )
158 -
159 - # Avoid linking against libraries disabled by use flags
160 - local opts=(
161 - bzip2:bz2
162 - ncurses:_minimal_curses
163 - )
164 -
165 - local opt
166 - for opt in "${opts[@]}"; do
167 - local flag=${opt%:*}
168 - local mod=${opt#*:}
169 -
170 - args+=(
171 - $(usex ${flag} --withmod --withoutmod)-${mod}
172 - )
173 - done
174 -
175 - local interp=( "${PYTHON}" )
176 - if use low-memory; then
177 - interp=( env PYPY_GC_MAX_DELTA=200MB
178 - "${PYTHON}" --jit loop_longevity=300 )
179 - fi
180 -
181 - set -- "${interp[@]}" rpython/bin/rpython --batch "${args[@]}"
182 - echo -e "\033[1m${@}\033[0m"
183 - "${@}" || die "compile error"
184 -
185 - pax-mark m "${ED%/}${INSDESTTREE}/pypy-c"
186 -}
187 -
188 -src_install() {
189 - local flags=( bzip2 jit ncurses sandbox shadowstack )
190 - use x86 && flags+=( cpu_flags_x86_sse2 )
191 - local f suffix="-${ARCH}"
192 -
193 - for f in ${flags[@]}; do
194 - use ${f} && suffix+="+${f#cpu_flags_x86_}"
195 - done
196 -
197 - local BIN_P=pypy-bin-${PV}
198 -
199 - einfo "Zipping PyPy ..."
200 - mkdir "${BIN_P}${suffix}"{,/include} || die
201 - mv pypy-c libpypy-c.so "${BIN_P}${suffix}"/ || die
202 - mv include/pypy_* "${BIN_P}${suffix}"/include/ || die
203 - chmod +x "${BIN_P}${suffix}"/pypy-c || die
204 -
205 - tar -cf "${BIN_P}${suffix}.tar" "${BIN_P}${suffix}" || die
206 - xz -vz9e "${BIN_P}${suffix}.tar" || die
207 -}
208 -
209 -# Yup, very hacky.
210 -pkg_preinst() {
211 - # integrity check.
212 - [[ ${PYPY_BINPKG_STORE} ]] || die 'PYPY_BINPKG_STORE unset, wtf?!'
213 - mkdir -p "${ROOT%/}${PYPY_BINPKG_STORE}" || die
214 - mv "${S}"/*.tar.xz "${ROOT%/}${PYPY_BINPKG_STORE}" || die
215 -}