view bsd.pypy.mk @ 45:5e046980990d

Call the package.py script with WRKSRC as the CWD. This removes the need for patching sysconfig.py and package.py (PyPy3) because files that are created by the scripts in the CWD now are created in WRKSRC. This is also consistent with other build stept, where an explicit change of the CWD to WRKSRC is done.
author Franz Glasner <fzglas.hg@dom66.de>
date Sun, 09 Oct 2022 19:11:04 +0200
parents af3a2629a882
children fbd13af3b578
line wrap: on
line source

# Common include for lang/pypy and lang/pypy3
# Also includes bsd.port.pre.mk

.if !defined(LICENSE)
LICENSE=	MIT PSFL
LICENSE_COMB=	multi
.endif

USES+=		compiler:c11

PYTHON_IMPL?=	${PORTNAME}
PYPY_DIR=	${PYTHON_IMPL}-${DISTVERSION:C|([0-9])\.([0-9]+).*|\1.\2|}
PLIST_SUB+=	PYPY_DIR=${PYPY_DIR} \
		PYPY_CFFI_VER=${PYPY_CFFI_VER} \
		PYPY_LDLIBRARY=${PYPY_LDLIBRARY}

.if ${PYTHON_IMPL} == pypy

DISTVERSION=	7.3.9
PY_VERSION_SHORT=	2.7
PYPY_CFFI_VER=	${PYTHON_IMPL}-73
PYPY_LDLIBRARY=	libpypy-c.so
PYPY_EXECUTABLE=	pypy-c

.else # ${PYTHON_IMPL} == pypy3

DISTVERSION=	7.3.9
PYPY_CFFI_VER=	${PYTHON_IMPL_NODOT}-pp${DISTVERSION:S|.||:C|\..*||}-${OPSYS:tl}${OSREL:C|\..*||}
PLIST_SUB+=	PYTHON_IMPL_MINOR=${PYTHON_IMPL_MINOR} \
		PY_VERSION_SHORT=${PY_VERSION_SHORT}

OPTIONS_SINGLE+=	FORPYIMPL

OPTIONS_SINGLE_FORPYIMPL=	FORPYIMPL37 FORPYIMPL38 FORPYIMPL39

FORPYIMPL_DESC=		Required Python compatibility
FORPYIMPL37_DESC=	Build for compat to Python 3.7
FORPYIMPL38_DESC=	Build for compat to Python 3.8
FORPYIMPL39_DESC=	Build for compat to Python 3.9

OPTIONS_SUB=		yes
OPTIONS_DEFAULT+=	FORPYIMPL38

.endif

PY_VERSION_NODOT=       ${PY_VERSION_SHORT:S/.//}
PYTHON_IMPL_MINOR=	pypy${PY_VERSION_SHORT}
PYTHON_IMPL_NODOT=	pypy${PY_VERSION_NODOT}

DISTINFO_FILE=		${.CURDIR}/distinfo.py${PY_VERSION_NODOT}

.include <bsd.port.pre.mk>

.if ${PORT_OPTIONS:MFORPYIMPL37}
PY_VERSION_SHORT=	3.7
PYPY_LDLIBRARY=		libpypy3-c.so
PYPY_EXECUTABLE=	pypy3-c
.endif
.if ${PORT_OPTIONS:MFORPYIMPL38}
PY_VERSION_SHORT=	3.8
PYPY_LDLIBRARY=		libpypy3-c.so
PYPY_EXECUTABLE=	pypy3-c
.endif
.if ${PORT_OPTIONS:MFORPYIMPL39}
PY_VERSION_SHORT=	3.9
PYPY_LDLIBRARY=		libpypy3.9-c.so
PYPY_EXECUTABLE=	pypy3.9-c
.endif