2012-10-12 03:04:30 +02:00
|
|
|
# Created by: David Naylor <naylor.b.david@gmail.com>
|
2011-12-13 16:37:36 +01:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
PORTNAME= pypy
|
2016-05-11 13:01:57 +02:00
|
|
|
PORTVERSION= 5.1.1 # Also update bsd.pypy.cffi.mk
|
2013-12-10 08:57:46 +01:00
|
|
|
CATEGORIES= lang python
|
2016-03-13 19:58:27 +01:00
|
|
|
MASTER_SITES= https://bitbucket.org/pypy/pypy/downloads/
|
|
|
|
DISTVERSIONSUFFIX= -src
|
2011-12-13 16:37:36 +01:00
|
|
|
|
2015-12-13 14:16:31 +01:00
|
|
|
MAINTAINER= python@FreeBSD.org
|
2013-03-23 17:01:56 +01:00
|
|
|
COMMENT= Fast, compliant implementation of the Python language
|
2011-12-13 16:37:36 +01:00
|
|
|
|
2016-04-21 18:43:14 +02:00
|
|
|
BROKEN_powerpc64= Does not build
|
|
|
|
|
2016-04-01 16:08:37 +02:00
|
|
|
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
|
2011-12-13 16:37:36 +01:00
|
|
|
|
2015-12-13 14:16:31 +01:00
|
|
|
ONLY_FOR_ARCHS= i386 amd64 armv6 powerpc64
|
2015-08-12 20:13:23 +02:00
|
|
|
ONLY_FOR_ARCHS_REASON= PyPy JIT only supported on these architectures
|
|
|
|
|
2016-03-14 05:04:51 +01:00
|
|
|
OPTIONS_SINGLE= TRANS
|
|
|
|
OPTIONS_SINGLE_TRANS= PYTHON
|
2013-05-20 23:13:01 +02:00
|
|
|
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)
|
2013-12-10 08:57:46 +01:00
|
|
|
TRANS_DESC= Translation method
|
2013-03-23 17:01:56 +01:00
|
|
|
LOCALBASE?= /usr/local
|
|
|
|
.if exists(${LOCALBASE}/bin/pypy)
|
2016-03-14 05:04:51 +01:00
|
|
|
OPTIONS_DEFAULT= PYPY_MINMEM
|
|
|
|
OPTIONS_SINGLE_TRANS+= PYPY PYPY_MINMEM
|
|
|
|
.else
|
|
|
|
OPTIONS_SLAVE= PYTHON
|
2013-03-23 17:01:56 +01:00
|
|
|
.endif
|
2011-12-13 16:37:36 +01:00
|
|
|
|
2015-08-01 11:07:22 +02:00
|
|
|
CONFLICTS_INSTALL= pypy3-[0-9]*
|
lang/pypy: Fix build. Temporarily disable CFFI modules
Temporarily disable CFFI module compilation post-build and the shared
CFFI libraries in the packaging lists to due failures finding and
linking tkinter:
Building tk bindings failed.
You can either install development headers package,
add the --without-tk option to skip packaging this
binary CFFI extension, or say --without-cffi.
Traceback (most recent call last):
File "<builtin>/app_main.py", line 75, in run_toplevel
File "/usr/ports/lang/pypy/files/compile_cffi.py", line 15, in <module>
create_cffi_import_libraries(sys.executable, Options(cffi_build_scripts), py.path.local(basedir))
File "/wrkdirs/usr/ports/lang/pypy/work/pypy-pypy-295ee98b6928/pypy/tool/release/package.py", line 84, in create_cffi_import_libraries
raise MissingDependenciesError(module)
MissingDependenciesError: _tkinter/tklib_build.py
This change is being committed on behalf of and in leui of maintainer
providing a comprehensive fix, as they are currently AFK.
Reported by: hawkowl (via IRC, portsmon)
Reviewed by: dbn (maintainer)
Approved by: dbn (maintainer)
2015-06-04 08:45:37 +02:00
|
|
|
|
2015-08-01 11:07:22 +02:00
|
|
|
ALL_TARGET= pypy-c
|
2016-03-20 18:41:59 +01:00
|
|
|
BUILD_WRKSRC= ${WRKDIR}/build/usession-release-${PORTVERSION:C/0\.0/0/}-0/testing_1
|
2015-08-01 11:07:22 +02:00
|
|
|
MAKE_ENV+= PYPY_LOCALBASE=${LOCALBASE}
|
|
|
|
USE_LDCONFIG= ${PREFIX}/${PYPY_DIR}/bin
|
2016-03-13 19:58:27 +01:00
|
|
|
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
|
2011-12-13 16:37:36 +01:00
|
|
|
|
2015-08-31 21:38:23 +02:00
|
|
|
.include ".${CURDIR}/bsd.pypy.mk"
|
2011-12-13 16:37:36 +01:00
|
|
|
.include <bsd.port.options.mk>
|
|
|
|
|
2015-12-13 14:16:31 +01:00
|
|
|
.if ${ARCH} == "i386" || ${ARCH} == "armv6"
|
|
|
|
PYPY_BITS= 32
|
|
|
|
.elif ${ARCH} == "amd64" || ${ARCH} == "powerpc64"
|
|
|
|
PYPY_BITS= 64
|
|
|
|
.endif
|
|
|
|
PLIST_SUB+= PYPY_BITS="${PYPY_BITS}"
|
|
|
|
|
2015-08-12 20:13:23 +02:00
|
|
|
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
|
2011-12-13 16:37:36 +01:00
|
|
|
|
|
|
|
post-build:
|
2015-08-01 11:07:22 +02:00
|
|
|
${CP} ${BUILD_WRKSRC}/pypy-c ${BUILD_WRKSRC}/libpypy-c.so ${WRKSRC}/pypy/goal/
|
2011-12-13 16:37:36 +01:00
|
|
|
|
|
|
|
do-install:
|
2015-08-01 11:07:22 +02:00
|
|
|
${SETENV} TMPDIR=${WRKDIR}/build \
|
2015-08-12 20:13:23 +02:00
|
|
|
${PYTHON_CMD} ${WRKSRC}/pypy/tool/release/package.py --builddir ${WRKDIR}/build --archive-name ${PYPY_DIR} \
|
|
|
|
--without-gdbm --without-sqlite3 --without-tk
|
2015-08-01 11:07:22 +02:00
|
|
|
${EXTRACT_CMD} -C ${STAGEDIR}${PREFIX} -xf ${WRKDIR}/build/${PYPY_DIR}.tar.bz2
|
2015-08-12 20:13:23 +02:00
|
|
|
${LN} -fs ../${PYPY_DIR}/bin/pypy ${STAGEDIR}${PREFIX}/bin/pypy
|
2011-12-13 16:37:36 +01:00
|
|
|
|
2016-03-13 19:58:27 +01:00
|
|
|
do-test:
|
2015-08-12 20:13:23 +02:00
|
|
|
# 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
|
2015-08-01 11:07:22 +02:00
|
|
|
(cd ${WRKSRC}; \
|
2015-08-12 20:13:23 +02:00
|
|
|
${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
|
2016-03-13 19:58:27 +01:00
|
|
|
(cd ${WRKSRC}/lib-python/2.7/test; \
|
|
|
|
${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build PYTHONPATH=${WRKSRC} \
|
|
|
|
${WRKSRC}/pypy/goal/pypy-c regrtest.py -vvu all)
|
2011-12-13 16:37:36 +01:00
|
|
|
|
|
|
|
pkg-plist: build
|
2015-08-01 11:07:22 +02:00
|
|
|
${TAR} -tf ${WRKDIR}/build/${PYPY_DIR}.tar.bz2 > ${WRKDIR}/.plist-files-gen
|
|
|
|
${REINPLACE_CMD} -e 's|^${PYPY_DIR}|%%PYPY_DIR%%|g' \
|
2015-12-13 14:16:31 +01:00
|
|
|
-e 's|_${PYPY_BITS}_|_%%PYPY_BITS%%_|g' \
|
2015-12-09 07:57:30 +01:00
|
|
|
-e 's|-${PYPY_CFFI_VER}|-%%PYPY_CFFI_VER%%|g' \
|
2015-08-01 11:07:22 +02:00
|
|
|
-e '/\/$$/d' \
|
2012-06-30 01:06:06 +02:00
|
|
|
${WRKDIR}/.plist-files-gen
|
2015-08-01 11:07:22 +02:00
|
|
|
${ECHO} bin/pypy > ${WRKDIR}/pkg-plist
|
|
|
|
${SORT} ${WRKDIR}/.plist-files-gen >> ${WRKDIR}/pkg-plist
|
2011-12-13 16:37:36 +01:00
|
|
|
${CP} ${WRKDIR}/pkg-plist ${.CURDIR}/pkg-plist
|
|
|
|
|
|
|
|
.include <bsd.port.mk>
|