Index: Makefile =================================================================== --- Makefile (revision 393429) +++ Makefile (working copy) @@ -18,6 +18,9 @@ LIB_DEPENDS= libexpat.so:${PORTSDIR}/textproc/expat2 \ libffi.so:${PORTSDIR}/devel/libffi +ONLY_FOR_ARCHS= i386 amd64 arm +ONLY_FOR_ARCHS_REASON= PyPy JIT only supported on these architectures + 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) @@ -34,12 +37,10 @@ ALL_TARGET= pypy-c BUILD_WRKSRC= ${WRKDIR}/build/usession-release-${DISTVERSION}-0/testing_1 MAKE_ENV+= PYPY_LOCALBASE=${LOCALBASE} - USE_LDCONFIG= ${PREFIX}/${PYPY_DIR}/bin USES= compiler:c11 gettext-runtime tar:bzip2 WRKSRC= ${WRKDIR}/pypy-pypy-295ee98b6928 - -PYPY_DIR= pypy-${DISTVERSION:C|([0-9])\.([0-9]).*|\1.\2|} +PYPY_DIR= pypy${DISTVERSION:C|([0-9])\.([0-9]).*|\1.\2|} PLIST_SUB+= PYPY_DIR=${PYPY_DIR} .include @@ -48,55 +49,48 @@ PYTHON_CMD?= ${LOCALBASE}/bin/pypy .elif ${PORT_OPTIONS:MPYPY_MINMEM} PYTHON_CMD?= "${SETENV} PYPY_GC_MAX_DELTA=200MB ${LOCALBASE}/bin/pypy --jit loop_longevity=300" -.else +.else # if ${PORT_OPTIONS:MPYTHON} USES+= python:2,build .endif -# Translate FreeBSD ARCH types to PyPy ARCH types -# Pypy officially only supports i386 and amd64, the other platforms are -# untested (and do not have jit support). -.if ${ARCH} == "i386" -PYPY_ARCH= x86_32 +.if ${ARCH} == "i386" || ${ARCH} == "arm" PYPY_BITS= 32 .elif ${ARCH} == "amd64" -PYPY_ARCH= x86_64 PYPY_BITS= 64 -.elif ${ARCH} == "powerpc" -PYPY_ARCH= ppc_32 -PYPY_BITS= 32 -.elif ${ARCH} == "powerpc64" -PYPY_ARCH= ppc_64 -PYPY_BITS= 64 -.else -PYPY_ARCH= ${ARCH} -PYPY_BITS= 32 .endif -PLIST_SUB+= PYPY_ARCH="${PYPY_ARCH}" PLIST_SUB+= PYPY_BITS="${PYPY_BITS}" -pre-build: ${BUILD_WRKSRC}/Makefile +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); \ + ${REINPLACE_CMD} -e 's|^%.o: %.c$$|.c.o:|g' ${BUILD_WRKSRC}/Makefile; \ + fi -${BUILD_WRKSRC}/Makefile: - ${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) - ${REINPLACE_CMD} -e 's|^%.o: %.c$$|.c.o:|g' ${BUILD_WRKSRC}/Makefile - 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 --without-cffi --builddir ${WRKDIR}/build --archive-name ${PYPY_DIR} + ${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} -s ../${PYPY_DIR}/bin/pypy ${STAGEDIR}${PREFIX}/bin/pypy regression-test: build + # 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 \ - ${WRKSRC}/pypy/goal/pypy-c pypy/test_all.py --basetemp ${WRKDIR}/build pypy lib-python) + ${WRKSRC}/pypy/goal/pypy-c testrunner/runner.py --root pypy \ + --config pypy/pytest-A.cfg --config pypy/pytest-A.py) + (cd ${WRKSRC}; \ + ${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build \ + ${WRKSRC}/pypy/goal/pypy-c pypy/test_all.py --basetemp ${WRKDIR}/build --pypy pypy/goal/pypy-c \ + lib-python pypy/module/pypyjit/test ) pkg-plist: build ${TAR} -tf ${WRKDIR}/build/${PYPY_DIR}.tar.bz2 > ${WRKDIR}/.plist-files-gen Index: files/patch-rpython_config_test_test__support.py =================================================================== --- files/patch-rpython_config_test_test__support.py (revision 0) +++ files/patch-rpython_config_test_test__support.py (working copy) @@ -0,0 +1,44 @@ +--- rpython/config/test/test_support.py.orig 2015-05-31 07:19:51 UTC ++++ rpython/config/test/test_support.py +@@ -52,25 +52,30 @@ def test_cpuinfo_linux(): + finally: + os.environ = saved + +-def test_cpuinfo_darwin(): +- if sys.platform != 'darwin': +- py.test.skip('mac only') +- saved_func = support.darwin_get_cpu_count ++def test_cpuinfo_sysctl(): ++ if sys.platform != 'darwin' and not sys.platform.startswith('freebsd'): ++ py.test.skip('mac and bsd only') ++ saved_func = support.sysctl_get_cpu_count + saved = os.environ +- def count(): ++ def count(cmd): ++ if sys.platform == 'darwin': ++ assert cmd == '/usr/sbin/sysctl' ++ else: ++ assert cmd == '/sbin/sysctl' + return 42 + try: +- support.darwin_get_cpu_count = count ++ support.sysctl_get_cpu_count = count + os.environ = FakeEnviron(None) + assert support.detect_number_of_processors() == 42 + os.environ = FakeEnviron('-j2') + assert support.detect_number_of_processors() == 1 + finally: + os.environ = saved +- support.darwin_get_cpu_count = saved_func ++ support.sysctl_get_cpu_count = saved_func + +-def test_darwin_get_cpu_count(): +- if sys.platform != 'darwin': ++def test_sysctl_get_cpu_count(): ++ if sys.platform != 'darwin' and not sys.platform.startswith('freebsd'): + py.test.skip('mac only') +- assert support.darwin_get_cpu_count() > 0 # hopefully +- assert support.darwin_get_cpu_count("false") == 1 ++ cmd = '/usr/sbin/sysctl' if sys.platform != 'darwin' else '/sbin/sysctl' ++ assert support.sysctl_get_cpu_count(cmd) > 0 # hopefully ++ assert support.sysctl_get_cpu_count(cmd, "false") == 1 Property changes on: files/patch-rpython_config_test_test__support.py ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: files/patch-rpython_jit_backend_detect__cpu.py =================================================================== --- files/patch-rpython_jit_backend_detect__cpu.py (revision 0) +++ files/patch-rpython_jit_backend_detect__cpu.py (working copy) @@ -0,0 +1,10 @@ +--- rpython/jit/backend/detect_cpu.py.orig 2015-08-11 18:20:39 UTC ++++ rpython/jit/backend/detect_cpu.py +@@ -63,6 +63,7 @@ def detect_model_from_host_platform(): + 'AMD64': MODEL_X86, # win64 + 'armv7l': MODEL_ARM, + 'armv6l': MODEL_ARM, ++ 'arm': MODEL_ARM, # freebsd + }.get(mach) + + if result is None: Property changes on: files/patch-rpython_jit_backend_detect__cpu.py ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property