freebsd-ports/lang/pypy/Makefile

109 lines
3.9 KiB
Makefile
Raw Normal View History

# Created by: David Naylor <naylor.b.david@gmail.com>
# $FreeBSD$
PORTNAME= pypy
2016-05-11 13:01:57 +02:00
PORTVERSION= 5.1.1 # Also update bsd.pypy.cffi.mk
CATEGORIES= lang python
MASTER_SITES= https://bitbucket.org/pypy/pypy/downloads/
DISTVERSIONSUFFIX= -src
MAINTAINER= python@FreeBSD.org
COMMENT= Fast, compliant implementation of the Python language
2016-04-21 18:43:14 +02:00
BROKEN_powerpc64= Does not build
LIB_DEPENDS= libexpat.so:textproc/expat2 \
libffi.so:devel/libffi
TEST_DEPENDS= ${PREFIX}/${PYPY_DIR}/lib_pypy/_gdbm_cffi.pypy-${PYPY_CFFI_VER}.so:databases/pypy-gdbm \
${PREFIX}/${PYPY_DIR}/lib_pypy/_sqlite3_cffi.pypy-${PYPY_CFFI_VER}.so:databases/pypy-sqlite3 \
${PREFIX}/${PYPY_DIR}/lib_pypy/_tkinter/tklib_cffi.pypy-${PYPY_CFFI_VER}.so:x11-toolkits/pypy-tkinter
ONLY_FOR_ARCHS= i386 amd64 armv6 powerpc64
ONLY_FOR_ARCHS_REASON= PyPy JIT only supported on these architectures
OPTIONS_SINGLE= TRANS
OPTIONS_SINGLE_TRANS= PYTHON
PYTHON_DESC= Use Python-2.7 to translate (slowest)
PYPY_DESC= Use PyPy to translate (fastest, highest memory usage)
PYPY_MINMEM_DESC= Use PyPy to translate (lowest memory usage)
TRANS_DESC= Translation method
LOCALBASE?= /usr/local
.if exists(${LOCALBASE}/bin/pypy)
OPTIONS_DEFAULT= PYPY_MINMEM
OPTIONS_SINGLE_TRANS+= PYPY PYPY_MINMEM
.else
OPTIONS_SLAVE= PYTHON
.endif
CONFLICTS_INSTALL= pypy3-[0-9]*
ALL_TARGET= pypy-c
BUILD_WRKSRC= ${WRKDIR}/build/usession-release-${PORTVERSION:C/0\.0/0/}-0/testing_1
MAKE_ENV+= PYPY_LOCALBASE=${LOCALBASE}
USE_LDCONFIG= ${PREFIX}/${PYPY_DIR}/bin
USES= gettext-runtime gmake tar:bzip2
PYPY_VARS= PYTHON_CMD=${LOCALBASE}/bin/pypy
PYPY_MINMEM_VARS= PYTHON_CMD="${SETENV} PYPY_GC_MAX_DELTA=200MB ${LOCALBASE}/bin/pypy --jit loop_longevity=300"
PYTHON_USES= python:2,build
lang/pypy: update to 2.6.1 Changes: - Add external cffi ports (a la python): - databases/pypy-gdbm - databases/pypy-sqlite3 - x11-toolkits/pypy-tkinter - Add bsd.pypy.mk for consistency between pypy ports. - Add bsd.pypy.cffi.mk for consistency with external cffi ports. - Switch back to using $PREFIX/pypy-X.Y (the '-' separator is required to differentiate between lang/pypy and lang/pypy3) - Remove all patches (upstreamed, see announcement below) ChangeLog: - Bug Fixes - Revive non-SSE2 support - Fixes for detaching _io.Buffer* - Clear up contention in the garbage collector between trace-me-later and pinning - Issues reported with our previous release were resolved after reports from users on our issue tracker at https://bitbucket.org/pypy/pypy/issues or on IRC at #pypy. - New features: - cffi was updated to version 1.3 - The python stdlib was updated to 2.7.10 from 2.7.9 - vmprof now supports multiple threads - The translation process builds cffi import libraries for some stdlib packages, which should prevent confusion when package.py is not used - better support for gdb debugging - FreeBSD should be able to translate PyPy "out of the box" with no patches - Numpy: - Better support for record dtypes, including the align keyword - Implement casting and create output arrays accordingly (still missing some corner cases) - Support creation of unicode ndarrays - Better support ndarray.flags - Support axis argument in more functions - Refactor array indexing to support ellipses - Allow the docstrings of built-in numpy objects to be set at run-time - Support the buffered nditer creation keyword - Performance improvements: - Delay recursive calls to make them non-recursive - Skip loop unrolling if it compiles too much code - Tweak the heapcache - Add a list strategy for lists that store both floats and 32-bit integers. The latter are encoded as nonstandard NaNs. Benchmarks show that the speed of such lists is now very close to the speed of purely-int or purely-float lists. - Simplify implementation of ffi.gc() to avoid most weakrefs - Massively improve the performance of map() with more than one sequence argument Differential Revision: https://reviews.freebsd.org/D3285
2015-08-31 21:38:23 +02:00
.include ".${CURDIR}/bsd.pypy.mk"
.include <bsd.port.options.mk>
.if ${ARCH} == "i386" || ${ARCH} == "armv6"
PYPY_BITS= 32
.elif ${ARCH} == "amd64" || ${ARCH} == "powerpc64"
PYPY_BITS= 64
.endif
PLIST_SUB+= PYPY_BITS="${PYPY_BITS}"
pre-build:
if [ ! -f ${BUILD_WRKSRC}/Makefile ]; then \
${RM} -r ${WRKDIR}/build; \
${MKDIR} ${WRKDIR}/build; \
(cd ${WRKSRC}/pypy/goal; \
${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build \
${PYTHON_CMD} ../../rpython/bin/rpython --source -Ojit targetpypystandalone.py); \
fi
post-build:
${CP} ${BUILD_WRKSRC}/pypy-c ${BUILD_WRKSRC}/libpypy-c.so ${WRKSRC}/pypy/goal/
do-install:
${SETENV} TMPDIR=${WRKDIR}/build \
${PYTHON_CMD} ${WRKSRC}/pypy/tool/release/package.py --builddir ${WRKDIR}/build --archive-name ${PYPY_DIR} \
--without-gdbm --without-sqlite3 --without-tk
${EXTRACT_CMD} -C ${STAGEDIR}${PREFIX} -xf ${WRKDIR}/build/${PYPY_DIR}.tar.bz2
${LN} -fs ../${PYPY_DIR}/bin/pypy ${STAGEDIR}${PREFIX}/bin/pypy
do-test:
# See https://bitbucket.org/pypy/buildbot/src/default/bot2/pypybuildbot/builds.py?at=default#builds.py-386
# add_translated_tests()
(cd ${WRKSRC}; \
${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build PYTHONPATH=${WRKSRC} \
${WRKSRC}/pypy/goal/pypy-c testrunner/runner.py --root pypy --logfile=pytest-A.log \
--parallel-runs ${MAKE_JOBS_NUMBER} \
--config pypy/pytest-A.cfg --config pypy/pytest-A.py)
.for dir in lib-python pypy/module/pypyjit/test
(cd ${WRKSRC}; \
${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build PYTHONPATH=${WRKSRC} \
${WRKSRC}/pypy/goal/pypy-c pypy/test_all.py --basetemp ${WRKDIR}/build --pypy pypy/goal/pypy-c \
${dir} )
.endfor
(cd ${WRKSRC}/lib-python/2.7/test; \
${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build PYTHONPATH=${WRKSRC} \
${WRKSRC}/pypy/goal/pypy-c regrtest.py -vvu all)
pkg-plist: build
${TAR} -tf ${WRKDIR}/build/${PYPY_DIR}.tar.bz2 > ${WRKDIR}/.plist-files-gen
${REINPLACE_CMD} -e 's|^${PYPY_DIR}|%%PYPY_DIR%%|g' \
-e 's|_${PYPY_BITS}_|_%%PYPY_BITS%%_|g' \
lang/pypy: update to 4.0.1 Changes: - Remove plist-sub PYPY_BITS - Switch PYPY_VER to PYPY_CFFI_VER Change Log: - Highlighted features: - Update cffi to 1.3.1. - Update Python implementation to 2.7.10. - New vectorisation optimisations added to the JIT. To enable add --jit vec=1 (or --jit vec_all=1 for all vectorisation optimisations). - Improved JIT warmup time of ~20%. - Reduced memory consumption by ~20%. - Numpy's ndarray and numeric dtypes are almost feature complete. - Numpy's linalg, random and fft have been implemented as cffi modules using the same underlying libraries as upstream. - Bug Fixes - Fix a bug when unrolling double loops in JITted code - Fix multiple memory leaks in the ssl module, one of which affected CPython as well (thanks to Alex Gaynor for pointing those out) - Use pkg-config to find ssl headers on OS-X - Fix a crash on non-linux when running more than 20 threads - In cffi, ffi.new_handle() is more cpython compliant - Accept unicode in functions inside the _curses cffi backend exactly like cpython - Fix a segfault in itertools.islice() - Fix ndarray.copy() for upstream compatability when copying non-contiguous arrays - Fix assumption that lltype.UniChar is unsigned - Fix a subtle bug with stacklets on shadowstack - Improve support for the cpython capi in cpyext (our capi compatibility layer). Fixing these issues inspired some thought about cpyext in general, stay tuned for more improvements - When loading dynamic libraries, in case of a certain loading error, retry loading the library assuming it is actually a linker script, like on Arch and Gentoo - New features - Internal cleanup of RPython class handling - Support stackless and greenlets on PPC machines - Improve debug logging in subprocesses: use PYPYLOG=jit:log.%d for example to have all subprocesses write the JIT log to a file called ?log.%d?, with ?%d? replaced with the subprocess? PID. - Support PyOS_double_to_string in our cpyext capi compatibility layer - Add an optimization pass to vectorize loops using x86 SIMD intrinsics. - Support __stdcall on Windows in CFFI - Improve debug logging when using PYPYLOG=??? - Deal with platforms with no RAND_egd() in OpenSSL - Numpy - Improve support for __array_interface__ - Propagate most NAN mantissas through float16-float32-float64 conversions - Add support for ndarray.ctypes - Fast path for mixing numpy scalars and floats - Add support for creating Fortran-ordered ndarrays - Fix casting failures in linalg (by extending ufunc casting) - Recognize and disallow (for now) pickling of ndarrays with objects embedded in them - Performance improvements and refactorings - Improvements in slicing byte arrays - Improvements in enumerate() - Silence some warnings while translating - Reuse hashed keys across dictionaries and sets - Refactor JIT interals to improve warmup time by 20% or so at the cost of a minor regression in JIT speed - Recognize patterns of common sequences in the JIT backends and optimize them - Make the garbage collecter more incremental over external_malloc() calls - Share guard resume data where possible which reduces memory usage - Fast path for zip(list, list) - Reduce the number of checks in the JIT for lst[a:] - Move the non-optimizable part of callbacks outside the JIT - Factor in field immutability when invalidating heap information - Unroll itertools.izip_longest() with two sequences - Minor optimizations after analyzing output from vmprof and trace logs - Remove many class attributes in rpython classes - Handle getfield_gc_pure* and getfield_gc_* uniformly in heap.py - Improve simple trace function performance by lazily calling fast2locals and locals2fast only if truly necessary Submitted by: robak@ PR: 204743 (with modification)
2015-12-09 07:57:30 +01:00
-e 's|-${PYPY_CFFI_VER}|-%%PYPY_CFFI_VER%%|g' \
-e '/\/$$/d' \
${WRKDIR}/.plist-files-gen
${ECHO} bin/pypy > ${WRKDIR}/pkg-plist
${SORT} ${WRKDIR}/.plist-files-gen >> ${WRKDIR}/pkg-plist
${CP} ${WRKDIR}/pkg-plist ${.CURDIR}/pkg-plist
.include <bsd.port.mk>