view bsd.pypy.mk @ 28:6cddc8f64f05

Cross-check the port's build options with the installed pypy3 ones. This is because the CFFI port must be compatible to the installed pypy3 build. This is to ensure the same Python compatibility level (3.7, 3.8 or e.9).
author Franz Glasner <fzglas.hg@dom66.de>
date Thu, 06 Oct 2022 09:35:15 +0200
parents bb33295dc62d
children 3fcb2f73b3e2
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}

.if ${PYTHON_IMPL} == pypy

DISTVERSION=	7.3.9
PY_VERSION_SHORT=	2.7
PYPY_CFFI_VER=	${PYTHON_IMPL}-73

.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
.endif
.if ${PORT_OPTIONS:MFORPYIMPL38}
PY_VERSION_SHORT=	3.8
.endif
.if ${PORT_OPTIONS:MFORPYIMPL39}
PY_VERSION_SHORT=	3.9
.endif