Mercurial > hgrepos > FreeBSD > ports > PyPy
comparison lang/pypy310/Makefile @ 134:cb43b563307b
Build of lang/pypy310 done
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sun, 14 Jan 2024 16:35:03 +0100 |
| parents | lang/pypy2/Makefile@fd184f6f2453 |
| children | 0110ab1309c1 |
comparison
equal
deleted
inserted
replaced
| 133:0281bf1e4f4c | 134:cb43b563307b |
|---|---|
| 1 # Created by: Franz Glasner <fzglas.hg@dom66.de> | |
| 2 # based on the port created by: David Naylor <naylor.b.david@gmail.com> | |
| 3 | |
| 4 PORTNAME= pypy310 | |
| 5 DISTVERSION= 7.3.14 | |
| 6 CATEGORIES= lang python | |
| 7 MASTER_SITES= https://downloads.python.org/pypy/ | |
| 8 DISTNAME= pypy${PYPY_PYTHON_IMPL_VER}-v${DISTVERSION}-src | |
| 9 | |
| 10 MAINTAINER= fzglas.hg@dom66.de | |
| 11 COMMENT= Fast, compliant implementation of the Python language | |
| 12 WWW= https://www.pypy.org | |
| 13 | |
| 14 LICENSE= MIT PSFL | |
| 15 LICENSE_COMB= multi | |
| 16 LICENSE_FILE_MIT= ${WRKSRC}/LICENSE | |
| 17 | |
| 18 BROKEN_armv6= fails to package: pypy_objspace_std.c: Crash in JIT! | |
| 19 BROKEN_armv7= fails to package: pypy_objspace_std.c: Crash in JIT! | |
| 20 BROKEN_powerpc64= fails to compile: platcheck_109.c: fatal error: linux/auxvec.h: No such file or directory | |
| 21 ONLY_FOR_ARCHS?= amd64 armv6 armv7 i386 powerpc64 powerpc64le | |
| 22 ONLY_FOR_ARCHS_REASON?= PyPy JIT only supported on these architectures | |
| 23 | |
| 24 LIB_DEPENDS= libexpat.so:textproc/expat2 \ | |
| 25 libffi.so:devel/libffi | |
| 26 # Without gdbm is not supported on v7.3.9 any more: no extra package needed | |
| 27 LIB_DEPENDS+= libgdbm.so:databases/gdbm | |
| 28 # We also need for dbm.ndbm the BerkeleyDB in version 5 | |
| 29 LIB_DEPENDS+= libdb-5.so:databases/db5 | |
| 30 TEST_DEPENDS= ${LOCALBASE}/${PYPY_DIR}/lib_pypy/_gdbm_cffi.${PYPY_CFFI_VER}.so:databases/pypy-gdbm \ | |
| 31 ${LOCALBASE}/${PYPY_DIR}/lib_pypy/_sqlite3_cffi.${PYPY_CFFI_VER}.so:databases/pypy-sqlite3 \ | |
| 32 ${LOCALBASE}/${PYPY_DIR}/lib_pypy/_tkinter/tklib_cffi.${PYPY_CFFI_VER}.so:x11-toolkits/pypy-tkinter | |
| 33 | |
| 34 USES= compiler:c11 gettext-runtime gmake shebangfix ssl tar:bzip2 | |
| 35 USE_LDCONFIG= ${PREFIX}/${PYPY_DIR}/bin | |
| 36 | |
| 37 OPTIONS_DEFINE= BYTECOMPILE | |
| 38 OPTIONS_DEFAULT= BYTECOMPILE PYTHON BCUNCHECKEDHASH | |
| 39 OPTIONS_SINGLE= TRANS BCSTYLE | |
| 40 OPTIONS_SINGLE_TRANS= PYTHON PYPY PYPY_MINMEM | |
| 41 OPTIONS_SINGLE_BCSTYLE= BCTIMESTAMP BCCHECKEDHASH BCUNCHECKEDHASH | |
| 42 OPTIONS_SUB= yes | |
| 43 | |
| 44 BYTECOMPILE_DESC= Enable to build byte-compiled Python files | |
| 45 TRANS_DESC= Translation method | |
| 46 BCSTYLE_DESC= PEP-552 .pyc-File Invalidation Modes | |
| 47 PYTHON_DESC= Use Python-2.7 to translate (slowest) | |
| 48 PYPY_DESC= Use PyPy to translate (fastest, highest memory usage) | |
| 49 PYPY_MINMEM_DESC= Use PyPy to translate (lowest memory usage) | |
| 50 BCTIMESTAMP_DESC= Traditional timestamp based .pyc file invalidataion | |
| 51 BCCHECKEDHASH_DESC= Use checked hash based .pyc file invalidataion | |
| 52 BCUNCHECKEDHASH_DESC= Use unchecked hash based .pyc file invalidataion | |
| 53 | |
| 54 PYTHON_BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pycparser>=2.10:devel/py-pycparser@${PY_FLAVOR} | |
| 55 PYTHON_USES= python:2.7,build | |
| 56 PYPY_BUILD_DEPENDS= pypy2:lang/pypy2 | |
| 57 PYPY_VARS= PYTHON_CMD=${LOCALBASE}/bin/pypy | |
| 58 PYPY_MINMEM_BUILD_DEPENDS= pypy2:lang/pypy2 | |
| 59 PYPY_MINMEM_VARS= PYTHON_CMD="${SETENV} PYPY_GC_MAX_DELTA=200MB ${LOCALBASE}/bin/pypy --jit loop_longevity=300" | |
| 60 BCTIMESTAMP_VARS= COMPILEALL_INVALIDATIONMODE=timestamp | |
| 61 BCCHECKEDHASH_VARS= COMPILEALL_INVALIDATIONMODE=checked-hash | |
| 62 BCUNCHECKEDHASH_VARS= COMPILEALL_INVALIDATIONMODE=unchecked-hash | |
| 63 | |
| 64 PYPY_TAG= pypy | |
| 65 PYPY_DIR= pypy${PYPY_PYTHON_IMPL_VER_MAJOR}-${DISTVERSION:C|([0-9]+)\.([0-9]+).*|\1.\2|} | |
| 66 | |
| 67 PYPY_PYTHON_IMPL_VER= 3.10 | |
| 68 PYPY_PYTHON_IMPL_VER_MAJOR= ${PYPY_PYTHON_IMPL_VER:C|([0-9]+)\.[0-9]+|\1|} | |
| 69 | |
| 70 PYPY_CFFI_VER= pypy${PYPY_PYTHON_IMPL_VER:S/.//}-pp${DISTVERSION:S|.||:C|\..*||}-${OPSYS:tl}${OSREL:C|\..*||} | |
| 71 PYPY_LDLIBRARY= libpypy${PYPY_PYTHON_IMPL_VER}-c.so | |
| 72 PYPY_EXECUTABLE= pypy${PYPY_PYTHON_IMPL_VER}-c | |
| 73 PYPY_BCTAG= .pypy${PYPY_PYTHON_IMPL_VER:S/.//} | |
| 74 | |
| 75 PYPY_ARGS= | |
| 76 | |
| 77 PLIST_SUB+= PYPY_DIR=${PYPY_DIR} \ | |
| 78 PYPY_CFFI_VER=${PYPY_CFFI_VER} \ | |
| 79 PYPY_LDLIBRARY=${PYPY_LDLIBRARY} \ | |
| 80 PYTHON_IMPL_MINOR=pypy${PYPY_PYTHON_IMPL_VER} \ | |
| 81 PY_VERSION_SHORT=${PYPY_PYTHON_IMPL_VER} \ | |
| 82 PYPY_BCTAG=${PYPY_BCTAG} | |
| 83 | |
| 84 ALL_TARGET= ${PYPY_EXECUTABLE} | |
| 85 BUILD_WRKSRC= ${WRKDIR}/build/usession-${PORTNAME}-0/testing_1 | |
| 86 MAKE_ENV+= PYPY_LOCALBASE=${LOCALBASE} LDSHARED="${CC} -shared" | |
| 87 PACKAGE_ARGS= --without-sqlite3 --without-_tkinter | |
| 88 LLD_UNSAFE= yes | |
| 89 | |
| 90 # shebang configuration | |
| 91 python_CMD= ${LOCALBASE}/bin/pypy${PYPY_PYTHON_IMPL_VER} | |
| 92 SHEBANG_FILES= \ | |
| 93 lib-python/3/base64.py \ | |
| 94 lib-python/3/cProfile.py \ | |
| 95 lib-python/3/cgi.py \ | |
| 96 lib-python/3/encodings/rot_13.py \ | |
| 97 lib-python/3/keyword.py \ | |
| 98 lib-python/3/idlelib/pyshell.py \ | |
| 99 lib-python/3/lib2to3/pgen2/token.py \ | |
| 100 lib-python/3/lib2to3/tests/data/different_encoding.py \ | |
| 101 lib-python/3/lib2to3/tests/data/false_encoding.py \ | |
| 102 lib-python/3/lib2to3/tests/pytree_idempotency.py \ | |
| 103 lib-python/3/pdb.py \ | |
| 104 lib-python/3/platform.py \ | |
| 105 lib-python/3/profile.py \ | |
| 106 lib-python/3/pydoc.py \ | |
| 107 lib-python/3/quopri.py \ | |
| 108 lib-python/3/smtpd.py \ | |
| 109 lib-python/3/smtplib.py \ | |
| 110 lib-python/3/tabnanny.py \ | |
| 111 lib-python/3/tarfile.py \ | |
| 112 lib-python/3/test/bisect_cmd.py \ | |
| 113 lib-python/3/test/crashers/recursive_call.py \ | |
| 114 lib-python/3/test/curses_tests.py \ | |
| 115 lib-python/3/test/pystone.py \ | |
| 116 lib-python/3/test/re_tests.py \ | |
| 117 lib-python/3/test/regrtest.py \ | |
| 118 lib-python/3/timeit.py \ | |
| 119 lib-python/3/trace.py \ | |
| 120 lib-python/3/turtledemo/bytedesign.py \ | |
| 121 lib-python/3/turtledemo/clock.py \ | |
| 122 lib-python/3/turtledemo/forest.py \ | |
| 123 lib-python/3/turtledemo/fractalcurves.py \ | |
| 124 lib-python/3/turtledemo/lindenmayer.py \ | |
| 125 lib-python/3/turtledemo/minimal_hanoi.py \ | |
| 126 lib-python/3/turtledemo/paint.py \ | |
| 127 lib-python/3/turtledemo/peace.py \ | |
| 128 lib-python/3/turtledemo/penrose.py \ | |
| 129 lib-python/3/turtledemo/planet_and_moon.py \ | |
| 130 lib-python/3/turtledemo/sorting_animate.py \ | |
| 131 lib-python/3/turtledemo/tree.py \ | |
| 132 lib-python/3/turtledemo/yinyang.py \ | |
| 133 lib-python/3/turtledemo/__main__.py \ | |
| 134 lib-python/3/uu.py \ | |
| 135 lib-python/3/webbrowser.py \ | |
| 136 lib_pypy/_cffi_ssl/tools/make_ssl_data.py \ | |
| 137 lib-python/3/test/ziptestdata/header.sh \ | |
| 138 lib-python/3/test/ziptestdata/exe_with_z64 \ | |
| 139 lib-python/3/test/ziptestdata/exe_with_zip | |
| 140 | |
| 141 #.include "bsd.pypy.mk" | |
| 142 .include <bsd.port.pre.mk> | |
| 143 | |
| 144 .if ${OPSYS} == FreeBSD && ${ARCH} != i386 && ${ARCH} != amd64 | |
| 145 PYPY_ARGS= --withoutmod-_vmprof | |
| 146 .else | |
| 147 LIB_DEPENDS+= libunwind.so:devel/libunwind | |
| 148 .endif | |
| 149 | |
| 150 pre-build: | |
| 151 if [ ! -f ${BUILD_WRKSRC}/Makefile ]; then \ | |
| 152 ${RM} -r ${WRKDIR}/build; \ | |
| 153 ${MKDIR} ${WRKDIR}/build; \ | |
| 154 (cd ${WRKSRC}/pypy/goal; \ | |
| 155 ${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build PYPY_USESSION_BASENAME=${PORTNAME} \ | |
| 156 ${PYTHON_CMD} ../../rpython/bin/rpython --source --opt=jit targetpypystandalone.py ${PYPY_ARGS}); \ | |
| 157 fi | |
| 158 | |
| 159 post-build: | |
| 160 ${CP} ${BUILD_WRKSRC}/${PYPY_EXECUTABLE} ${BUILD_WRKSRC}/${PYPY_LDLIBRARY} ${WRKSRC}/pypy/goal/ | |
| 161 | |
| 162 do-install: | |
| 163 (cd ${WRKSRC}; \ | |
| 164 ${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build \ | |
| 165 ${PYTHON_CMD} ${WRKSRC}/pypy/tool/release/package.py --builddir ${WRKDIR}/build --archive-name ${PYPY_DIR} \ | |
| 166 ${PACKAGE_ARGS}) | |
| 167 ${EXTRACT_CMD} -C ${STAGEDIR}${PREFIX} -xf ${WRKDIR}/build/${PYPY_DIR}.tar.bz2 | |
| 168 ${RM} ${STAGEDIR}${PREFIX}/${PYPY_DIR}/bin/${PYPY_TAG} | |
| 169 ${RM} ${STAGEDIR}${PREFIX}/${PYPY_DIR}/bin/${PYPY_TAG}${PYPY_PYTHON_IMPL_VER_MAJOR} | |
| 170 ${RM} ${STAGEDIR}${PREFIX}/${PYPY_DIR}/bin/python | |
| 171 ${RM} ${STAGEDIR}${PREFIX}/${PYPY_DIR}/bin/python${PYPY_PYTHON_IMPL_VER_MAJOR} | |
| 172 ${LN} -fs ../${PYPY_DIR}/bin/${PYPY_TAG}${PYPY_PYTHON_IMPL_VER} ${STAGEDIR}${PREFIX}/bin/${PYPY_TAG}${PYPY_PYTHON_IMPL_VER} | |
| 173 ${FIND} ${STAGEDIR}${PREFIX}/${PYPY_DIR}/lib/${PYTHON_IMPL_MINOR} -name '*.so' | ${XARGS} ${STRIP_CMD} | |
| 174 .if ${PORT_OPTIONS:MBYTECOMPILE} | |
| 175 @${ECHO} Byte-compile the Python standard library for optimization levels 0, 1 and 2 with invalidation mode ${COMPILEALL_INVALIDATIONMODE} | |
| 176 (cd ${STAGEDIR}${PREFIX}/${PYPY_DIR} && ${SETENV} LD_LIBRARY_PATH=${WRKSRC}/pypy/goal \ | |
| 177 ${WRKSRC}/pypy/goal/${PYPY_EXECUTABLE} -B -I -m compileall --invalidation-mode=${COMPILEALL_INVALIDATIONMODE} -q -x '/tests?/' -o 0 -o 1 -o 2 -d "${PREFIX}/${PYPY_DIR}/lib" lib) | |
| 178 .else | |
| 179 @${ECHO} Distribution of byte-compiled standard library files is deactivated | |
| 180 .endif | |
| 181 | |
| 182 do-test: | |
| 183 # See https://bitbucket.org/pypy/buildbot/src/default/bot2/pypybuildbot/builds.py?at=default#builds.py-386 | |
| 184 # add_translated_tests() | |
| 185 (cd ${WRKSRC}; \ | |
| 186 ${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build PYTHONPATH=${WRKSRC} \ | |
| 187 ${WRKSRC}/pypy/goal/pypy-c testrunner/runner.py --root pypy --logfile=pytest-A.log \ | |
| 188 --parallel-runs ${MAKE_JOBS_NUMBER} \ | |
| 189 --config pypy/pytest-A.cfg --config pypy/pytest-A.py) | |
| 190 .for dir in lib-python pypy/module/pypyjit/test | |
| 191 (cd ${WRKSRC}; \ | |
| 192 ${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build PYTHONPATH=${WRKSRC} \ | |
| 193 ${WRKSRC}/pypy/goal/pypy-c pypy/test_all.py --basetemp ${WRKDIR}/build --pypy pypy/goal/pypy-c \ | |
| 194 ${dir} ) | |
| 195 .endfor | |
| 196 (cd ${WRKSRC}/lib-python/2.7/test; \ | |
| 197 ${SETENV} ${MAKE_ENV} TMPDIR=${WRKDIR}/build PYTHONPATH=${WRKSRC} \ | |
| 198 ${WRKSRC}/pypy/goal/pypy-c regrtest.py -vvu all) | |
| 199 | |
| 200 pkg-plist: stage | |
| 201 ${TAR} -tf ${WRKDIR}/build/${PYPY_DIR}.tar.bz2 > ${WRKDIR}/.plist-files-gen | |
| 202 ${REINPLACE_CMD} -e 's|^${PYPY_DIR}|%%PYPY_DIR%%|g' \ | |
| 203 -e 's|${PYPY_CFFI_VER}|%%PYPY_CFFI_VER%%|g' \ | |
| 204 -e 's/\(.*\/__pycache__\)\/$$/@dir \1/g' \ | |
| 205 -e '/\/$$/d' \ | |
| 206 ${WRKDIR}/.plist-files-gen | |
| 207 ${ECHO} bin/${PYPY_TAG} > ${WRKDIR}/pkg-plist | |
| 208 ${SORT} ${WRKDIR}/.plist-files-gen | ${GREP} -v '\.orig' >> ${WRKDIR}/pkg-plist | |
| 209 ${CP} ${WRKDIR}/pkg-plist ${.CURDIR}/pkg-plist | |
| 210 | |
| 211 .include <bsd.port.post.mk> |
