View | Details | Raw Unified | Return to bug 202159 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-31 / +25 lines)
Lines 18-23 Link Here
18
LIB_DEPENDS=	libexpat.so:${PORTSDIR}/textproc/expat2 \
18
LIB_DEPENDS=	libexpat.so:${PORTSDIR}/textproc/expat2 \
19
		libffi.so:${PORTSDIR}/devel/libffi
19
		libffi.so:${PORTSDIR}/devel/libffi
20
20
21
ONLY_FOR_ARCHS=	i386 amd64 arm
22
ONLY_FOR_ARCHS_REASON=	PyPy JIT only supported on these architectures
23
21
PYTHON_DESC=	Use Python-2.7 to translate (slowest)
24
PYTHON_DESC=	Use Python-2.7 to translate (slowest)
22
PYPY_DESC=	Use PyPy to translate (fastest, highest memory usage)
25
PYPY_DESC=	Use PyPy to translate (fastest, highest memory usage)
23
PYPY_MINMEM_DESC=	Use PyPy to translate (lowest memory usage)
26
PYPY_MINMEM_DESC=	Use PyPy to translate (lowest memory usage)
Lines 34-45 Link Here
34
ALL_TARGET=	pypy-c
37
ALL_TARGET=	pypy-c
35
BUILD_WRKSRC=	${WRKDIR}/build/usession-release-${DISTVERSION}-0/testing_1
38
BUILD_WRKSRC=	${WRKDIR}/build/usession-release-${DISTVERSION}-0/testing_1
36
MAKE_ENV+=	PYPY_LOCALBASE=${LOCALBASE}
39
MAKE_ENV+=	PYPY_LOCALBASE=${LOCALBASE}
37
38
USE_LDCONFIG=	${PREFIX}/${PYPY_DIR}/bin
40
USE_LDCONFIG=	${PREFIX}/${PYPY_DIR}/bin
39
USES=		compiler:c11 gettext-runtime tar:bzip2
41
USES=		compiler:c11 gettext-runtime tar:bzip2
40
WRKSRC=		${WRKDIR}/pypy-pypy-295ee98b6928
42
WRKSRC=		${WRKDIR}/pypy-pypy-295ee98b6928
41
43
PYPY_DIR=	pypy${DISTVERSION:C|([0-9])\.([0-9]).*|\1.\2|}
42
PYPY_DIR=	pypy-${DISTVERSION:C|([0-9])\.([0-9]).*|\1.\2|}
43
PLIST_SUB+=	PYPY_DIR=${PYPY_DIR}
44
PLIST_SUB+=	PYPY_DIR=${PYPY_DIR}
44
45
45
.include <bsd.port.options.mk>
46
.include <bsd.port.options.mk>
Lines 48-102 Link Here
48
PYTHON_CMD?=	${LOCALBASE}/bin/pypy
49
PYTHON_CMD?=	${LOCALBASE}/bin/pypy
49
.elif ${PORT_OPTIONS:MPYPY_MINMEM}
50
.elif ${PORT_OPTIONS:MPYPY_MINMEM}
50
PYTHON_CMD?=	"${SETENV} PYPY_GC_MAX_DELTA=200MB ${LOCALBASE}/bin/pypy --jit loop_longevity=300"
51
PYTHON_CMD?=	"${SETENV} PYPY_GC_MAX_DELTA=200MB ${LOCALBASE}/bin/pypy --jit loop_longevity=300"
51
.else
52
.else # if ${PORT_OPTIONS:MPYTHON}
52
USES+=		python:2,build
53
USES+=		python:2,build
53
.endif
54
.endif
54
55
55
# Translate FreeBSD ARCH types to PyPy ARCH types
56
.if ${ARCH} == "i386" || ${ARCH} == "arm"
56
# Pypy officially only supports i386 and amd64, the other platforms are
57
# untested (and do not have jit support).
58
.if ${ARCH} == "i386"
59
PYPY_ARCH=	x86_32
60
PYPY_BITS=	32
57
PYPY_BITS=	32
61
.elif ${ARCH} == "amd64"
58
.elif ${ARCH} == "amd64"
62
PYPY_ARCH=	x86_64
63
PYPY_BITS=	64
59
PYPY_BITS=	64
64
.elif ${ARCH} == "powerpc"
65
PYPY_ARCH=	ppc_32
66
PYPY_BITS=	32
67
.elif ${ARCH} == "powerpc64"
68
PYPY_ARCH=	ppc_64
69
PYPY_BITS=	64
70
.else
71
PYPY_ARCH=	${ARCH}
72
PYPY_BITS=	32
73
.endif
60
.endif
74
PLIST_SUB+=	PYPY_ARCH="${PYPY_ARCH}"
75
PLIST_SUB+=	PYPY_BITS="${PYPY_BITS}"
61
PLIST_SUB+=	PYPY_BITS="${PYPY_BITS}"
76
62
77
pre-build: ${BUILD_WRKSRC}/Makefile
63
pre-build:
64
	if [ ! -f ${BUILD_WRKSRC}/Makefile ]; then \
65
		${RM} -r ${WRKDIR}/build; \
66
		${MKDIR} ${WRKDIR}/build; \
67
		(cd ${WRKSRC}/pypy/goal; \
68
			${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build \
69
			${PYTHON_CMD} ../../rpython/bin/rpython --source -Ojit targetpypystandalone.py); \
70
		${REINPLACE_CMD} -e 's|^%.o: %.c$$|.c.o:|g' ${BUILD_WRKSRC}/Makefile; \
71
	fi
78
72
79
${BUILD_WRKSRC}/Makefile:
80
	${RM} -r ${WRKDIR}/build
81
	${MKDIR} ${WRKDIR}/build
82
	(cd ${WRKSRC}/pypy/goal; \
83
		${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build \
84
		${PYTHON_CMD} ../../rpython/bin/rpython --source -Ojit targetpypystandalone.py)
85
	${REINPLACE_CMD} -e 's|^%.o: %.c$$|.c.o:|g' ${BUILD_WRKSRC}/Makefile
86
87
post-build:
73
post-build:
88
	${CP} ${BUILD_WRKSRC}/pypy-c ${BUILD_WRKSRC}/libpypy-c.so ${WRKSRC}/pypy/goal/
74
	${CP} ${BUILD_WRKSRC}/pypy-c ${BUILD_WRKSRC}/libpypy-c.so ${WRKSRC}/pypy/goal/
89
75
90
do-install:
76
do-install:
91
	${SETENV} TMPDIR=${WRKDIR}/build \
77
	${SETENV} TMPDIR=${WRKDIR}/build \
92
		${PYTHON_CMD} ${WRKSRC}/pypy/tool/release/package.py --without-cffi --builddir ${WRKDIR}/build --archive-name ${PYPY_DIR}
78
		${PYTHON_CMD} ${WRKSRC}/pypy/tool/release/package.py --builddir ${WRKDIR}/build --archive-name ${PYPY_DIR} \
79
		--without-gdbm --without-sqlite3 --without-tk
93
	${EXTRACT_CMD} -C ${STAGEDIR}${PREFIX} -xf ${WRKDIR}/build/${PYPY_DIR}.tar.bz2
80
	${EXTRACT_CMD} -C ${STAGEDIR}${PREFIX} -xf ${WRKDIR}/build/${PYPY_DIR}.tar.bz2
94
	${LN} -s ../${PYPY_DIR}/bin/pypy ${STAGEDIR}${PREFIX}/bin/pypy
81
	${LN} -s ../${PYPY_DIR}/bin/pypy ${STAGEDIR}${PREFIX}/bin/pypy
95
82
96
regression-test: build
83
regression-test: build
84
	# See https://bitbucket.org/pypy/buildbot/src/default/bot2/pypybuildbot/builds.py?at=default#builds.py-386
85
	# add_translated_tests()
97
	(cd ${WRKSRC}; \
86
	(cd ${WRKSRC}; \
98
		${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build \
87
		${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build \
99
		${WRKSRC}/pypy/goal/pypy-c pypy/test_all.py --basetemp ${WRKDIR}/build pypy lib-python)
88
		${WRKSRC}/pypy/goal/pypy-c testrunner/runner.py --root pypy \
89
			--config pypy/pytest-A.cfg --config pypy/pytest-A.py)
90
	(cd ${WRKSRC}; \
91
		${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build \
92
		${WRKSRC}/pypy/goal/pypy-c pypy/test_all.py --basetemp ${WRKDIR}/build --pypy pypy/goal/pypy-c \
93
			lib-python pypy/module/pypyjit/test )
100
94
101
pkg-plist: build
95
pkg-plist: build
102
	${TAR} -tf ${WRKDIR}/build/${PYPY_DIR}.tar.bz2 > ${WRKDIR}/.plist-files-gen
96
	${TAR} -tf ${WRKDIR}/build/${PYPY_DIR}.tar.bz2 > ${WRKDIR}/.plist-files-gen
(-)files/patch-rpython_config_test_test__support.py (+44 lines)
Line 0 Link Here
1
--- rpython/config/test/test_support.py.orig	2015-05-31 07:19:51 UTC
2
+++ rpython/config/test/test_support.py
3
@@ -52,25 +52,30 @@ def test_cpuinfo_linux():
4
     finally:
5
         os.environ = saved
6
 
7
-def test_cpuinfo_darwin():
8
-    if sys.platform != 'darwin':
9
-        py.test.skip('mac only')
10
-    saved_func = support.darwin_get_cpu_count
11
+def test_cpuinfo_sysctl():
12
+    if sys.platform != 'darwin' and not sys.platform.startswith('freebsd'):
13
+        py.test.skip('mac and bsd only')
14
+    saved_func = support.sysctl_get_cpu_count
15
     saved = os.environ
16
-    def count():
17
+    def count(cmd):
18
+        if sys.platform == 'darwin':
19
+            assert cmd == '/usr/sbin/sysctl'
20
+        else:
21
+            assert cmd == '/sbin/sysctl'
22
         return 42
23
     try:
24
-        support.darwin_get_cpu_count = count
25
+        support.sysctl_get_cpu_count = count
26
         os.environ = FakeEnviron(None)
27
         assert support.detect_number_of_processors() == 42
28
         os.environ = FakeEnviron('-j2')
29
         assert support.detect_number_of_processors() == 1
30
     finally:
31
         os.environ = saved
32
-        support.darwin_get_cpu_count = saved_func
33
+        support.sysctl_get_cpu_count = saved_func
34
 
35
-def test_darwin_get_cpu_count():
36
-    if sys.platform != 'darwin':
37
+def test_sysctl_get_cpu_count():
38
+    if sys.platform != 'darwin' and not sys.platform.startswith('freebsd'):
39
         py.test.skip('mac only')
40
-    assert support.darwin_get_cpu_count() > 0 # hopefully
41
-    assert support.darwin_get_cpu_count("false") == 1
42
+    cmd = '/usr/sbin/sysctl' if sys.platform != 'darwin' else '/sbin/sysctl'
43
+    assert support.sysctl_get_cpu_count(cmd) > 0 # hopefully
44
+    assert support.sysctl_get_cpu_count(cmd, "false") == 1
(-)files/patch-rpython_jit_backend_detect__cpu.py (+10 lines)
Line 0 Link Here
1
--- rpython/jit/backend/detect_cpu.py.orig	2015-08-11 18:20:39 UTC
2
+++ rpython/jit/backend/detect_cpu.py
3
@@ -63,6 +63,7 @@ def detect_model_from_host_platform():
4
             'AMD64': MODEL_X86,    # win64
5
             'armv7l': MODEL_ARM,
6
             'armv6l': MODEL_ARM,
7
+            'arm': MODEL_ARM,      # freebsd
8
             }.get(mach)
9
 
10
     if result is None:

Return to bug 202159