view Makefile @ 113:edb35c768cff

Apply byte-compilation for all optimization levels (0, 1, 2) after installing (i.e. staging). This is currently Python3 only. BUGS: Not tested for Python 3.7 and Python 3.8.
author Franz Glasner <f.glasner@feldmann-mg.com>
date Wed, 10 Jan 2024 14:45:45 +0100
parents cf8f8a3eea6b
children 8ae98a6ddf12
line wrap: on
line source

# Created by: David Naylor <dbn@FreeBSD.org>

PORTNAME=	pypy3
PORTREVISION=	0
DISTNAME=	${PYTHON_IMPL_MINOR}-v${DISTVERSION}-src

MASTERDIR=	${.CURDIR}/../pypy

WRKSRC=		${WRKDIR}/${PYTHON_IMPL_MINOR}-v${DISTVERSION:C/-.*//}-src

# Without gdbm is not supported on v7.3.9 any more: no extra package needed
LIB_DEPENDS+=	libgdbm.so:databases/gdbm
# We also need for dbm.ndbm the BerkeleyDB in version 5
LIB_DEPENDS+=	libdb-5.so:databases/db5

SHEBANG_FILES=	\
		lib-python/3/base64.py \
		lib-python/3/cProfile.py \
		lib-python/3/cgi.py \
		lib-python/3/encodings/rot_13.py \
		lib-python/3/keyword.py \
		lib-python/3/idlelib/pyshell.py \
		lib-python/3/lib2to3/pgen2/token.py \
		lib-python/3/lib2to3/tests/data/different_encoding.py \
		lib-python/3/lib2to3/tests/data/false_encoding.py \
		lib-python/3/lib2to3/tests/pytree_idempotency.py \
		lib-python/3/pdb.py \
		lib-python/3/platform.py \
		lib-python/3/profile.py \
		lib-python/3/pydoc.py \
		lib-python/3/quopri.py \
		lib-python/3/smtpd.py \
		lib-python/3/smtplib.py \
		lib-python/3/symbol.py \
		lib-python/3/tabnanny.py \
		lib-python/3/tarfile.py \
		lib-python/3/test/bisect_cmd.py \
		lib-python/3/test/crashers/recursive_call.py \
		lib-python/3/test/curses_tests.py \
		lib-python/3/test/pystone.py \
		lib-python/3/test/re_tests.py \
		lib-python/3/test/regrtest.py \
		lib-python/3/timeit.py \
		lib-python/3/trace.py \
		lib-python/3/turtledemo/bytedesign.py \
		lib-python/3/turtledemo/clock.py \
		lib-python/3/turtledemo/forest.py \
		lib-python/3/turtledemo/fractalcurves.py \
		lib-python/3/turtledemo/lindenmayer.py \
		lib-python/3/turtledemo/minimal_hanoi.py \
		lib-python/3/turtledemo/paint.py \
		lib-python/3/turtledemo/peace.py \
		lib-python/3/turtledemo/penrose.py \
		lib-python/3/turtledemo/planet_and_moon.py \
		lib-python/3/turtledemo/tree.py \
		lib-python/3/turtledemo/yinyang.py \
		lib-python/3/uu.py \
		lib-python/3/webbrowser.py \
		lib_pypy/_cffi_ssl/tools/make_ssl_data.py

FORPYIMPL37_VARS=	PLIST=${.CURDIR}/pkg-plist.py37

FORPYIMPL38_VARS=	SHEBANG_FILES+="lib-python/3/test/ziptestdata/header.sh lib-python/3/test/ziptestdata/exe_with_z64 lib-python/3/test/ziptestdata/exe_with_zip" \
			PLIST=${.CURDIR}/pkg-plist.py38

FORPYIMPL39_VARS=	SHEBANG_FILES+="lib-python/3/test/ziptestdata/header.sh lib-python/3/test/ziptestdata/exe_with_z64 lib-python/3/test/ziptestdata/exe_with_zip lib-python/3/turtledemo/sorting_animate.py lib-python/3/turtledemo/__main__.py" \
			PLIST=${.CURDIR}/pkg-plist.py39

FORPYIMPL310_VARS=	SHEBANG_FILES+="lib-python/3/test/ziptestdata/header.sh lib-python/3/test/ziptestdata/exe_with_z64 lib-python/3/test/ziptestdata/exe_with_zip lib-python/3/turtledemo/sorting_animate.py lib-python/3/turtledemo/__main__.py" \
			PLIST=${.CURDIR}/pkg-plist.py310

PACKAGE_ARGS=	--without-sqlite3 --without-_tkinter

pre-install:
	${FIND} ${WRKSRC} -name '*.pyc' -delete
	#${CHMOD} -R a-w ${WRKSRC}
	#${CHMOD} -R u+w ${WRKSRC}/lib_pypy

post-install:
	@cd ${STAGEDIR}${PREFIX}/${PYPY_DIR} && ${SETENV} LD_LIBRARY_PATH=${WRKSRC}/pypy/goal \
		${WRKSRC}/pypy/goal/${PYPY_EXECUTABLE} -B -I -m compileall --invalidation-mode=unchecked-hash -q -x '/tests?/' -o 0 -o 1 -o 2 -d "${PREFIX}/${PYPY_DIR}/lib" lib

.include "${MASTERDIR}/Makefile"