comparison lang/pypy2/Makefile @ 65:9e9df3f25e7d

Move the old imported pypy repo into the lang/pypy2 folder
author Franz Glasner <fzglas.hg@dom66.de>
date Fri, 12 Jan 2024 09:18:14 +0100
parents Makefile@4f846c664620
children b907e948fed9
comparison
equal deleted inserted replaced
64:4f846c664620 65:9e9df3f25e7d
1 # Created by: David Naylor <naylor.b.david@gmail.com>
2
3 PORTNAME?= pypy
4 PORTREVISION?= 0
5 CATEGORIES= lang python
6 MASTER_SITES= https://downloads.python.org/pypy/
7 DISTNAME?= ${PYTHON_IMPL_MINOR}-v${DISTVERSION}-src
8
9 MAINTAINER= python@FreeBSD.org
10 COMMENT= Fast, compliant implementation of the Python language
11 WWW= http://pypy.org
12
13 LICENSE= MIT PSFL
14 LICENSE_COMB= multi
15 LICENSE_FILE_MIT= ${WRKSRC}/LICENSE
16
17 BROKEN_armv6= fails to package: pypy_objspace_std.c: Crash in JIT!
18 BROKEN_armv7= fails to package: pypy_objspace_std.c: Crash in JIT!
19 BROKEN_powerpc64= fails to compile: platcheck_109.c: fatal error: linux/auxvec.h: No such file or directory
20 ONLY_FOR_ARCHS?= amd64 armv6 armv7 i386 powerpc64 powerpc64le
21 ONLY_FOR_ARCHS_REASON?= PyPy JIT only supported on these architectures
22
23 LIB_DEPENDS+= libexpat.so:textproc/expat2 \
24 libffi.so:devel/libffi
25 TEST_DEPENDS= ${LOCALBASE}/${PYPY_DIR}/lib_pypy/_gdbm_cffi.${PYPY_CFFI_VER}.so:databases/pypy-gdbm \
26 ${LOCALBASE}/${PYPY_DIR}/lib_pypy/_sqlite3_cffi.${PYPY_CFFI_VER}.so:databases/pypy-sqlite3 \
27 ${LOCALBASE}/${PYPY_DIR}/lib_pypy/_tkinter/tklib_cffi.${PYPY_CFFI_VER}.so:x11-toolkits/pypy-tkinter
28
29 USES= gettext-runtime gmake shebangfix ssl tar:bzip2
30 USE_LDCONFIG= ${PREFIX}/${PYPY_DIR}/bin
31
32 OPTIONS_SINGLE= TRANS
33 OPTIONS_SINGLE_TRANS= PYTHON
34 PYTHON_DESC= Use Python-2.7 to translate (slowest)
35 PYPY_DESC= Use PyPy to translate (fastest, highest memory usage)
36 PYPY_MINMEM_DESC= Use PyPy to translate (lowest memory usage)
37 TRANS_DESC= Translation method
38
39 # Only allow building with pypy if it wouldn't cause a dependency loop (pypy depending on itself)
40 .if exists(${LOCALBASE}/bin/pypy) || ${PORTNAME} != pypy
41 OPTIONS_SINGLE_TRANS+= PYPY PYPY_MINMEM
42 . if exists(${LOCALBASE}/bin/pypy)
43 OPTIONS_DEFAULT= PYPY_MINMEM
44 . else
45 OPTIONS_DEFAULT= PYTHON
46 . endif
47 .else
48 OPTIONS_SLAVE= PYTHON
49 .endif
50
51 LOCALBASE?= /usr/local
52
53 ALL_TARGET= ${PYPY_EXECUTABLE}
54 BUILD_WRKSRC?= ${WRKDIR}/build/usession-${PORTNAME}-0/testing_1
55 MAKE_ENV+= PYPY_LOCALBASE=${LOCALBASE} LDSHARED="${CC} -shared"
56 PACKAGE_ARGS?= --without-gdbm --without-sqlite3 --without-_tkinter
57 LLD_UNSAFE= yes
58
59 python_OLD_CMD= ${LOCALBASE}/bin/python
60 python_CMD= ${PREFIX}/bin/${PORTNAME}
61
62 .if ${PORTNAME} != pypy
63 PYPY_BUILD_DEPENDS= pypy:lang/pypy
64 PYPY_MINMEM_BUILD_DEPENDS= pypy:lang/pypy
65 .endif
66 PYPY_VARS= PYTHON_CMD=${LOCALBASE}/bin/pypy
67 PYPY_MINMEM_VARS= PYTHON_CMD="${SETENV} PYPY_GC_MAX_DELTA=200MB ${LOCALBASE}/bin/pypy --jit loop_longevity=300"
68 PYTHON_BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pycparser>=2.10:devel/py-pycparser@${PY_FLAVOR}
69 PYTHON_USES= python:2.7,build
70
71 DESCR= ${.CURDIR}/pkg-descr
72 PATCHDIR= ${.CURDIR}/files
73
74 .include "bsd.pypy.mk"
75 #.include <bsd.port.pre.mk>
76
77 DISTINFO_FILE?= ${.CURDIR}/distinfo
78 PLIST?= ${.CURDIR}/pkg-plist
79
80 .if ${OPSYS} == FreeBSD && ${ARCH} != i386 && ${ARCH} != amd64
81 PYPY_ARGS= --withoutmod-_vmprof
82 .else
83 LIB_DEPENDS+= libunwind.so:devel/libunwind
84 .endif
85
86 .if ${PORTNAME} == pypy
87 SHEBANG_FILES= lib-python/2.7/plat-mac/appletrunner.py \
88 lib-python/2.7/plat-mac/bundlebuilder.py \
89 lib-python/2.7/keyword.py \
90 lib-python/2.7/test/regrtest.py \
91 lib-python/2.7/test/pystone.py \
92 lib-python/2.7/test/curses_tests.py \
93 lib-python/2.7/test/re_tests.py \
94 lib-python/2.7/test/crashers/recursive_call.py \
95 lib-python/2.7/test/bisect_cmd.py \
96 lib-python/2.7/UserString.py \
97 lib-python/2.7/pdb.py \
98 lib-python/2.7/mimify.py \
99 lib-python/2.7/pydoc.py \
100 lib-python/2.7/uu.py \
101 lib-python/2.7/trace.py \
102 lib-python/2.7/platform.py \
103 lib-python/2.7/profile.py \
104 lib-python/2.7/tabnanny.py \
105 lib-python/2.7/lib2to3/tests/pytree_idempotency.py \
106 lib-python/2.7/lib2to3/tests/data/false_encoding.py \
107 lib-python/2.7/lib2to3/tests/data/different_encoding.py \
108 lib-python/2.7/lib2to3/pgen2/token.py \
109 lib-python/2.7/encodings/rot_13.py \
110 lib-python/2.7/base64.py \
111 lib-python/2.7/webbrowser.py \
112 lib-python/2.7/idlelib/PyShell.py \
113 lib-python/2.7/cgi.py \
114 lib-python/2.7/symbol.py \
115 lib-python/2.7/cProfile.py \
116 lib-python/2.7/smtpd.py \
117 lib-python/2.7/quopri.py \
118 lib-python/2.7/timeit.py \
119 lib-python/2.7/smtplib.py \
120 lib_pypy/_cffi_ssl/tools/make_ssl_data.py
121
122 .else
123 .if ${PORT_OPTIONS:MFORPYIMPL37}
124 SHEBANG_FILES= \
125 lib-python/3/base64.py \
126 lib-python/3/cProfile.py \
127 lib-python/3/cgi.py \
128 lib-python/3/encodings/rot_13.py \
129 lib-python/3/keyword.py \
130 lib-python/3/idlelib/pyshell.py \
131 lib-python/3/lib2to3/pgen2/token.py \
132 lib-python/3/lib2to3/tests/data/different_encoding.py \
133 lib-python/3/lib2to3/tests/data/false_encoding.py \
134 lib-python/3/lib2to3/tests/pytree_idempotency.py \
135 lib-python/3/pdb.py \
136 lib-python/3/platform.py \
137 lib-python/3/profile.py \
138 lib-python/3/pydoc.py \
139 lib-python/3/quopri.py \
140 lib-python/3/smtpd.py \
141 lib-python/3/smtplib.py \
142 lib-python/3/symbol.py \
143 lib-python/3/tabnanny.py \
144 lib-python/3/tarfile.py \
145 lib-python/3/test/bisect_cmd.py \
146 lib-python/3/test/crashers/recursive_call.py \
147 lib-python/3/test/curses_tests.py \
148 lib-python/3/test/pystone.py \
149 lib-python/3/test/re_tests.py \
150 lib-python/3/test/regrtest.py \
151 lib-python/3/timeit.py \
152 lib-python/3/trace.py \
153 lib-python/3/turtledemo/bytedesign.py \
154 lib-python/3/turtledemo/clock.py \
155 lib-python/3/turtledemo/forest.py \
156 lib-python/3/turtledemo/fractalcurves.py \
157 lib-python/3/turtledemo/lindenmayer.py \
158 lib-python/3/turtledemo/minimal_hanoi.py \
159 lib-python/3/turtledemo/paint.py \
160 lib-python/3/turtledemo/peace.py \
161 lib-python/3/turtledemo/penrose.py \
162 lib-python/3/turtledemo/planet_and_moon.py \
163 lib-python/3/turtledemo/tree.py \
164 lib-python/3/turtledemo/yinyang.py \
165 lib-python/3/uu.py \
166 lib-python/3/webbrowser.py \
167 lib_pypy/_cffi_ssl/tools/make_ssl_data.py
168 .elif ${PORT_OPTIONS:MFORPYIMPL38}
169 SHEBANG_FILES= \
170 lib-python/3/base64.py \
171 lib-python/3/cProfile.py \
172 lib-python/3/cgi.py \
173 lib-python/3/encodings/rot_13.py \
174 lib-python/3/keyword.py \
175 lib-python/3/idlelib/pyshell.py \
176 lib-python/3/lib2to3/pgen2/token.py \
177 lib-python/3/lib2to3/tests/data/different_encoding.py \
178 lib-python/3/lib2to3/tests/data/false_encoding.py \
179 lib-python/3/lib2to3/tests/pytree_idempotency.py \
180 lib-python/3/pdb.py \
181 lib-python/3/platform.py \
182 lib-python/3/profile.py \
183 lib-python/3/pydoc.py \
184 lib-python/3/quopri.py \
185 lib-python/3/smtpd.py \
186 lib-python/3/smtplib.py \
187 lib-python/3/symbol.py \
188 lib-python/3/tabnanny.py \
189 lib-python/3/tarfile.py \
190 lib-python/3/test/bisect_cmd.py \
191 lib-python/3/test/crashers/recursive_call.py \
192 lib-python/3/test/curses_tests.py \
193 lib-python/3/test/pystone.py \
194 lib-python/3/test/re_tests.py \
195 lib-python/3/test/regrtest.py \
196 lib-python/3/timeit.py \
197 lib-python/3/trace.py \
198 lib-python/3/turtledemo/bytedesign.py \
199 lib-python/3/turtledemo/clock.py \
200 lib-python/3/turtledemo/forest.py \
201 lib-python/3/turtledemo/fractalcurves.py \
202 lib-python/3/turtledemo/lindenmayer.py \
203 lib-python/3/turtledemo/minimal_hanoi.py \
204 lib-python/3/turtledemo/paint.py \
205 lib-python/3/turtledemo/peace.py \
206 lib-python/3/turtledemo/penrose.py \
207 lib-python/3/turtledemo/planet_and_moon.py \
208 lib-python/3/turtledemo/tree.py \
209 lib-python/3/turtledemo/yinyang.py \
210 lib-python/3/uu.py \
211 lib-python/3/webbrowser.py \
212 lib-python/3/test/ziptestdata/header.sh \
213 lib-python/3/test/ziptestdata/exe_with_z64 \
214 lib-python/3/test/ziptestdata/exe_with_zip \
215 lib_pypy/_cffi_ssl/tools/make_ssl_data.py
216 .elif ${PORT_OPTIONS:MFORPYIMPL39}
217 SHEBANG_FILES= \
218 lib-python/3/base64.py \
219 lib-python/3/cProfile.py \
220 lib-python/3/cgi.py \
221 lib-python/3/encodings/rot_13.py \
222 lib-python/3/keyword.py \
223 lib-python/3/idlelib/pyshell.py \
224 lib-python/3/lib2to3/pgen2/token.py \
225 lib-python/3/lib2to3/tests/data/different_encoding.py \
226 lib-python/3/lib2to3/tests/data/false_encoding.py \
227 lib-python/3/lib2to3/tests/pytree_idempotency.py \
228 lib-python/3/pdb.py \
229 lib-python/3/platform.py \
230 lib-python/3/profile.py \
231 lib-python/3/pydoc.py \
232 lib-python/3/quopri.py \
233 lib-python/3/smtpd.py \
234 lib-python/3/smtplib.py \
235 lib-python/3/symbol.py \
236 lib-python/3/tabnanny.py \
237 lib-python/3/tarfile.py \
238 lib-python/3/test/bisect_cmd.py \
239 lib-python/3/test/crashers/recursive_call.py \
240 lib-python/3/test/curses_tests.py \
241 lib-python/3/test/pystone.py \
242 lib-python/3/test/re_tests.py \
243 lib-python/3/test/regrtest.py \
244 lib-python/3/timeit.py \
245 lib-python/3/trace.py \
246 lib-python/3/turtledemo/bytedesign.py \
247 lib-python/3/turtledemo/clock.py \
248 lib-python/3/turtledemo/forest.py \
249 lib-python/3/turtledemo/fractalcurves.py \
250 lib-python/3/turtledemo/lindenmayer.py \
251 lib-python/3/turtledemo/minimal_hanoi.py \
252 lib-python/3/turtledemo/paint.py \
253 lib-python/3/turtledemo/peace.py \
254 lib-python/3/turtledemo/penrose.py \
255 lib-python/3/turtledemo/planet_and_moon.py \
256 lib-python/3/turtledemo/sorting_animate.py \
257 lib-python/3/turtledemo/tree.py \
258 lib-python/3/turtledemo/yinyang.py \
259 lib-python/3/turtledemo/__main__.py \
260 lib-python/3/uu.py \
261 lib-python/3/webbrowser.py \
262 lib_pypy/_cffi_ssl/tools/make_ssl_data.py \
263 lib-python/3/test/ziptestdata/header.sh \
264 lib-python/3/test/ziptestdata/exe_with_z64 \
265 lib-python/3/test/ziptestdata/exe_with_zip
266 .elif ${PORT_OPTIONS:MFORPYIMPL310}
267 SHEBANG_FILES= \
268 lib-python/3/base64.py \
269 lib-python/3/cProfile.py \
270 lib-python/3/cgi.py \
271 lib-python/3/encodings/rot_13.py \
272 lib-python/3/keyword.py \
273 lib-python/3/idlelib/pyshell.py \
274 lib-python/3/lib2to3/pgen2/token.py \
275 lib-python/3/lib2to3/tests/data/different_encoding.py \
276 lib-python/3/lib2to3/tests/data/false_encoding.py \
277 lib-python/3/lib2to3/tests/pytree_idempotency.py \
278 lib-python/3/pdb.py \
279 lib-python/3/platform.py \
280 lib-python/3/profile.py \
281 lib-python/3/pydoc.py \
282 lib-python/3/quopri.py \
283 lib-python/3/smtpd.py \
284 lib-python/3/smtplib.py \
285 lib-python/3/tabnanny.py \
286 lib-python/3/tarfile.py \
287 lib-python/3/test/bisect_cmd.py \
288 lib-python/3/test/crashers/recursive_call.py \
289 lib-python/3/test/curses_tests.py \
290 lib-python/3/test/pystone.py \
291 lib-python/3/test/re_tests.py \
292 lib-python/3/test/regrtest.py \
293 lib-python/3/timeit.py \
294 lib-python/3/trace.py \
295 lib-python/3/turtledemo/bytedesign.py \
296 lib-python/3/turtledemo/clock.py \
297 lib-python/3/turtledemo/forest.py \
298 lib-python/3/turtledemo/fractalcurves.py \
299 lib-python/3/turtledemo/lindenmayer.py \
300 lib-python/3/turtledemo/minimal_hanoi.py \
301 lib-python/3/turtledemo/paint.py \
302 lib-python/3/turtledemo/peace.py \
303 lib-python/3/turtledemo/penrose.py \
304 lib-python/3/turtledemo/planet_and_moon.py \
305 lib-python/3/turtledemo/sorting_animate.py \
306 lib-python/3/turtledemo/tree.py \
307 lib-python/3/turtledemo/yinyang.py \
308 lib-python/3/turtledemo/__main__.py \
309 lib-python/3/uu.py \
310 lib-python/3/webbrowser.py \
311 lib_pypy/_cffi_ssl/tools/make_ssl_data.py \
312 lib-python/3/test/ziptestdata/header.sh \
313 lib-python/3/test/ziptestdata/exe_with_z64 \
314 lib-python/3/test/ziptestdata/exe_with_zip
315 .endif
316 .endif
317
318 pre-build:
319 if [ ! -f ${BUILD_WRKSRC}/Makefile ]; then \
320 ${RM} -r ${WRKDIR}/build; \
321 ${MKDIR} ${WRKDIR}/build; \
322 (cd ${WRKSRC}/pypy/goal; \
323 ${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build PYPY_USESSION_BASENAME=${PORTNAME} \
324 ${PYTHON_CMD} ../../rpython/bin/rpython --source --opt=jit targetpypystandalone.py ${PYPY_ARGS}); \
325 fi
326
327 post-build:
328 ${CP} ${BUILD_WRKSRC}/${PYPY_EXECUTABLE} ${BUILD_WRKSRC}/${PYPY_LDLIBRARY} ${WRKSRC}/pypy/goal/
329
330 do-install:
331 (cd ${WRKSRC}; \
332 ${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build \
333 ${PYTHON_CMD} ${WRKSRC}/pypy/tool/release/package.py --builddir ${WRKDIR}/build --archive-name ${PYPY_DIR} \
334 ${PACKAGE_ARGS})
335 ${EXTRACT_CMD} -C ${STAGEDIR}${PREFIX} -xf ${WRKDIR}/build/${PYPY_DIR}.tar.bz2
336 ${LN} -fs ../${PYPY_DIR}/bin/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
337 .if ${PORT_OPTIONS:MFORPYIMPL38} || ${PORT_OPTIONS:MFORPYIMPL39} || ${PORT_OPTIONS:MFORPYIMPL310}
338 ${FIND} ${STAGEDIR}${PREFIX}/${PYPY_DIR}/lib/${PYTHON_IMPL_MINOR} -name '*.so' | ${XARGS} ${STRIP_CMD}
339 .else
340 ${FIND} ${STAGEDIR}${PREFIX}/${PYPY_DIR}/lib_pypy/ -name '*.so' | ${XARGS} ${STRIP_CMD}
341 .endif
342 .if ${PORT_OPTIONS:MFORPYIMPL39} || ${PORT_OPTIONS:MFORPYIMPL310}
343 .if ${PORT_OPTIONS:MBYTECOMPILE}
344 @echo Byte-compile the Python standard library for optimization levels 0, 1 and 2 with invalidation mode ${COMPILEALL_INVALIDATIONMODE}
345 (cd ${STAGEDIR}${PREFIX}/${PYPY_DIR} && ${SETENV} LD_LIBRARY_PATH=${WRKSRC}/pypy/goal \
346 ${WRKSRC}/pypy/goal/${PYPY_EXECUTABLE} -B -I -m compileall --invalidation-mode=${COMPILEALL_INVALIDATIONMODE} -q -x '/tests?/' -o 0 -o 1 -o 2 -d "${PREFIX}/${PYPY_DIR}/lib" lib)
347 .else
348 @echo Distribution of byte-compiled standard library files is deactivated
349 .endif
350 .else
351 @echo Byte-compilation of standard library files is not yet supported
352 .endif
353
354 do-test:
355 # See https://bitbucket.org/pypy/buildbot/src/default/bot2/pypybuildbot/builds.py?at=default#builds.py-386
356 # add_translated_tests()
357 (cd ${WRKSRC}; \
358 ${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build PYTHONPATH=${WRKSRC} \
359 ${WRKSRC}/pypy/goal/pypy-c testrunner/runner.py --root pypy --logfile=pytest-A.log \
360 --parallel-runs ${MAKE_JOBS_NUMBER} \
361 --config pypy/pytest-A.cfg --config pypy/pytest-A.py)
362 .for dir in lib-python pypy/module/pypyjit/test
363 (cd ${WRKSRC}; \
364 ${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build PYTHONPATH=${WRKSRC} \
365 ${WRKSRC}/pypy/goal/pypy-c pypy/test_all.py --basetemp ${WRKDIR}/build --pypy pypy/goal/pypy-c \
366 ${dir} )
367 .endfor
368 (cd ${WRKSRC}/lib-python/2.7/test; \
369 ${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build PYTHONPATH=${WRKSRC} \
370 ${WRKSRC}/pypy/goal/pypy-c regrtest.py -vvu all)
371
372 pkg-plist: stage
373 ${TAR} -tf ${WRKDIR}/build/${PYPY_DIR}.tar.bz2 > ${WRKDIR}/.plist-files-gen
374 ${REINPLACE_CMD} -e 's|^${PYPY_DIR}|%%PYPY_DIR%%|g' \
375 -e 's|${PYPY_CFFI_VER}|%%PYPY_CFFI_VER%%|g' \
376 -e 's/\(.*\/__pycache__\)\/$$/@dir \1/g' \
377 -e '/\/$$/d' \
378 ${WRKDIR}/.plist-files-gen
379 ${ECHO} bin/${PORTNAME} > ${WRKDIR}/pkg-plist
380 ${SORT} ${WRKDIR}/.plist-files-gen | ${GREP} -v '\.orig' >> ${WRKDIR}/pkg-plist
381 ${CP} ${WRKDIR}/pkg-plist ${.CURDIR}/pkg-plist
382
383 .include <bsd.port.post.mk>