Mercurial > hgrepos > FreeBSD > ports > PyPy
comparison Makefile @ 2:5797a1bc38cb origin
ADD: the latest easily available port of lang/pypy
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Wed, 28 Sep 2022 22:14:32 +0200 |
| parents | |
| children | c269f1e91387 |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 2:5797a1bc38cb |
|---|---|
| 1 # Created by: David Naylor <naylor.b.david@gmail.com> | |
| 2 # $FreeBSD: head/lang/pypy/Makefile 559974 2021-01-02 21:48:19Z rene $ | |
| 3 | |
| 4 PORTNAME?= pypy | |
| 5 CATEGORIES= lang python | |
| 6 MASTER_SITES= https://bitbucket.org/pypy/pypy/downloads/ http://buildbot.pypy.org/mirror/ | |
| 7 DISTNAME?= ${PORTNAME}2.7-v${DISTVERSION}-src | |
| 8 | |
| 9 MAINTAINER= python@FreeBSD.org | |
| 10 COMMENT= Fast, compliant implementation of the Python language | |
| 11 | |
| 12 LICENSE= MIT PSFL | |
| 13 LICENSE_COMB= multi | |
| 14 LICENSE_FILE_MIT= ${WRKSRC}/LICENSE | |
| 15 | |
| 16 BROKEN_armv6= fails to package: pypy_objspace_std.c: Crash in JIT! | |
| 17 BROKEN_armv7= fails to package: pypy_objspace_std.c: Crash in JIT! | |
| 18 BROKEN_powerpc64= fails to compile: platcheck_109.c: fatal error: linux/auxvec.h: No such file or directory | |
| 19 ONLY_FOR_ARCHS?= amd64 armv6 armv7 i386 powerpc64 powerpc64le | |
| 20 ONLY_FOR_ARCHS_REASON?= PyPy JIT only supported on these architectures | |
| 21 | |
| 22 PATCH_SITES= https://foss.heptapod.net/pypy/pypy/-/commit/ | |
| 23 PATCHFILES+= 455e1f635110df4bdc2981a3a0abf02e3d4d21b2.diff:-p1 | |
| 24 | |
| 25 LIB_DEPENDS= libexpat.so:textproc/expat2 \ | |
| 26 libffi.so:devel/libffi | |
| 27 TEST_DEPENDS= ${LOCALBASE}/${PYPY_DIR}/lib_pypy/_gdbm_cffi.${PYPY_CFFI_VER}.so:databases/pypy-gdbm \ | |
| 28 ${LOCALBASE}/${PYPY_DIR}/lib_pypy/_sqlite3_cffi.${PYPY_CFFI_VER}.so:databases/pypy-sqlite3 \ | |
| 29 ${LOCALBASE}/${PYPY_DIR}/lib_pypy/_tkinter/tklib_cffi.${PYPY_CFFI_VER}.so:x11-toolkits/pypy-tkinter | |
| 30 | |
| 31 USES= gettext-runtime gmake shebangfix ssl tar:bzip2 | |
| 32 USE_LDCONFIG= ${PREFIX}/${PYPY_DIR}/bin | |
| 33 | |
| 34 OPTIONS_SINGLE= TRANS | |
| 35 OPTIONS_SINGLE_TRANS= PYTHON | |
| 36 PYTHON_DESC= Use Python-2.7 to translate (slowest) | |
| 37 PYPY_DESC= Use PyPy to translate (fastest, highest memory usage) | |
| 38 PYPY_MINMEM_DESC= Use PyPy to translate (lowest memory usage) | |
| 39 TRANS_DESC= Translation method | |
| 40 LOCALBASE?= /usr/local | |
| 41 # Only allow building with pypy if it wouldn't cause a dependency loop (pypy depending on itself) | |
| 42 .if exists(${LOCALBASE}/bin/pypy) || ${PORTNAME} != pypy | |
| 43 OPTIONS_SINGLE_TRANS+= PYPY PYPY_MINMEM | |
| 44 . if exists(${LOCALBASE}/bin/pypy) | |
| 45 OPTIONS_DEFAULT= PYPY_MINMEM | |
| 46 . else | |
| 47 OPTIONS_DEFAULT= PYTHON | |
| 48 . endif | |
| 49 .else | |
| 50 OPTIONS_SLAVE= PYTHON | |
| 51 .endif | |
| 52 | |
| 53 ALL_TARGET= ${PORTNAME}-c | |
| 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-tk | |
| 57 LLD_UNSAFE= yes | |
| 58 SHEBANG_FILES?= lib-python/2.7/plat-mac/appletrunner.py \ | |
| 59 lib-python/2.7/plat-mac/bundlebuilder.py \ | |
| 60 lib-python/2.7/keyword.py \ | |
| 61 lib-python/2.7/test/regrtest.py \ | |
| 62 lib-python/2.7/test/pystone.py \ | |
| 63 lib-python/2.7/test/curses_tests.py \ | |
| 64 lib-python/2.7/test/re_tests.py \ | |
| 65 lib-python/2.7/test/crashers/recursive_call.py \ | |
| 66 lib-python/2.7/UserString.py \ | |
| 67 lib-python/2.7/pdb.py \ | |
| 68 lib-python/2.7/mimify.py \ | |
| 69 lib-python/2.7/pydoc.py \ | |
| 70 lib-python/2.7/uu.py \ | |
| 71 lib-python/2.7/trace.py \ | |
| 72 lib-python/2.7/platform.py \ | |
| 73 lib-python/2.7/profile.py \ | |
| 74 lib-python/2.7/tabnanny.py \ | |
| 75 lib-python/2.7/lib2to3/tests/pytree_idempotency.py \ | |
| 76 lib-python/2.7/lib2to3/tests/data/false_encoding.py \ | |
| 77 lib-python/2.7/lib2to3/tests/data/different_encoding.py \ | |
| 78 lib-python/2.7/lib2to3/pgen2/token.py \ | |
| 79 lib-python/2.7/encodings/rot_13.py \ | |
| 80 lib-python/2.7/base64.py \ | |
| 81 lib-python/2.7/webbrowser.py \ | |
| 82 lib-python/2.7/idlelib/PyShell.py \ | |
| 83 lib-python/2.7/cgi.py \ | |
| 84 lib-python/2.7/symbol.py \ | |
| 85 lib-python/2.7/cProfile.py \ | |
| 86 lib-python/2.7/smtpd.py \ | |
| 87 lib-python/2.7/quopri.py \ | |
| 88 lib-python/2.7/timeit.py \ | |
| 89 lib-python/2.7/smtplib.py \ | |
| 90 lib_pypy/_cffi_ssl/tools/make_ssl_data.py | |
| 91 | |
| 92 python_OLD_CMD= ${LOCALBASE}/bin/python | |
| 93 python_CMD= ${PREFIX}/bin/${PORTNAME} | |
| 94 | |
| 95 .if ${PORTNAME} != pypy | |
| 96 PYPY_BUILD_DEPENDS= pypy:lang/pypy | |
| 97 PYPY_MINMEM_BUILD_DEPENDS= pypy:lang/pypy | |
| 98 .endif | |
| 99 PYPY_VARS= PYTHON_CMD=${LOCALBASE}/bin/pypy | |
| 100 PYPY_MINMEM_VARS= PYTHON_CMD="${SETENV} PYPY_GC_MAX_DELTA=200MB ${LOCALBASE}/bin/pypy --jit loop_longevity=300" | |
| 101 PYTHON_BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pycparser>=2.10:devel/py-pycparser@${PY_FLAVOR} | |
| 102 PYTHON_USES= python:2.7,build | |
| 103 | |
| 104 DESCR= ${.CURDIR}/pkg-descr | |
| 105 DISTINFO_FILE= ${.CURDIR}/distinfo | |
| 106 PATCHDIR= ${.CURDIR}/files | |
| 107 PLIST= ${.CURDIR}/pkg-plist | |
| 108 | |
| 109 .include "bsd.pypy.mk" | |
| 110 .include <bsd.port.pre.mk> | |
| 111 | |
| 112 .if ${OPSYS} == FreeBSD && ${ARCH} != i386 && ${ARCH} != amd64 | |
| 113 PYPY_ARGS= --withoutmod-_vmprof | |
| 114 .else | |
| 115 LIB_DEPENDS+= libunwind.so:devel/libunwind | |
| 116 .endif | |
| 117 | |
| 118 pre-build: | |
| 119 if [ ! -f ${BUILD_WRKSRC}/Makefile ]; then \ | |
| 120 ${RM} -r ${WRKDIR}/build; \ | |
| 121 ${MKDIR} ${WRKDIR}/build; \ | |
| 122 (cd ${WRKSRC}/pypy/goal; \ | |
| 123 ${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build PYPY_USESSION_BASENAME=${PORTNAME} \ | |
| 124 ${PYTHON_CMD} ../../rpython/bin/rpython --source -Ojit targetpypystandalone.py ${PYPY_ARGS}); \ | |
| 125 fi | |
| 126 | |
| 127 post-build: | |
| 128 ${CP} ${BUILD_WRKSRC}/${PORTNAME}-c ${BUILD_WRKSRC}/lib${PORTNAME}-c.so ${WRKSRC}/pypy/goal/ | |
| 129 | |
| 130 do-install: | |
| 131 ${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build \ | |
| 132 ${PYTHON_CMD} ${WRKSRC}/pypy/tool/release/package.py --builddir ${WRKDIR}/build --archive-name ${PYPY_DIR} \ | |
| 133 ${PACKAGE_ARGS} | |
| 134 ${EXTRACT_CMD} -C ${STAGEDIR}${PREFIX} -xf ${WRKDIR}/build/${PYPY_DIR}.tar.bz2 | |
| 135 ${LN} -fs ../${PYPY_DIR}/bin/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${PORTNAME} | |
| 136 ${FIND} ${STAGEDIR}${PREFIX}/${PYPY_DIR}/lib_pypy/ -name '*.so' | ${XARGS} ${STRIP_CMD} | |
| 137 | |
| 138 do-test: | |
| 139 # See https://bitbucket.org/pypy/buildbot/src/default/bot2/pypybuildbot/builds.py?at=default#builds.py-386 | |
| 140 # add_translated_tests() | |
| 141 (cd ${WRKSRC}; \ | |
| 142 ${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build PYTHONPATH=${WRKSRC} \ | |
| 143 ${WRKSRC}/pypy/goal/pypy-c testrunner/runner.py --root pypy --logfile=pytest-A.log \ | |
| 144 --parallel-runs ${MAKE_JOBS_NUMBER} \ | |
| 145 --config pypy/pytest-A.cfg --config pypy/pytest-A.py) | |
| 146 .for dir in lib-python pypy/module/pypyjit/test | |
| 147 (cd ${WRKSRC}; \ | |
| 148 ${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build PYTHONPATH=${WRKSRC} \ | |
| 149 ${WRKSRC}/pypy/goal/pypy-c pypy/test_all.py --basetemp ${WRKDIR}/build --pypy pypy/goal/pypy-c \ | |
| 150 ${dir} ) | |
| 151 .endfor | |
| 152 (cd ${WRKSRC}/lib-python/2.7/test; \ | |
| 153 ${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build PYTHONPATH=${WRKSRC} \ | |
| 154 ${WRKSRC}/pypy/goal/pypy-c regrtest.py -vvu all) | |
| 155 | |
| 156 pkg-plist: stage | |
| 157 ${TAR} -tf ${WRKDIR}/build/${PYPY_DIR}.tar.bz2 > ${WRKDIR}/.plist-files-gen | |
| 158 ${REINPLACE_CMD} -e 's|^${PYPY_DIR}|%%PYPY_DIR%%|g' \ | |
| 159 -e 's|${PYPY_CFFI_VER}|%%PYPY_CFFI_VER%%|g' \ | |
| 160 -e 's/\(.*\/__pycache__\)\/$$/@dir \1/g' \ | |
| 161 -e '/\/$$/d' \ | |
| 162 ${WRKDIR}/.plist-files-gen | |
| 163 ${ECHO} bin/${PORTNAME} > ${WRKDIR}/pkg-plist | |
| 164 ${SORT} ${WRKDIR}/.plist-files-gen | ${GREP} -v '\.orig' >> ${WRKDIR}/pkg-plist | |
| 165 ${CP} ${WRKDIR}/pkg-plist ${.CURDIR}/pkg-plist | |
| 166 | |
| 167 .include <bsd.port.post.mk> |
