view bsd.pypy.mk @ 24:d2d396c79e9f

Allow to overwrite DISTINFO_FILE and PLIST from slave ports. This is needed for some PyPy implementation flavors to work properly.
author Franz Glasner <f.glasner@feldmann-mg.com>
date Wed, 05 Oct 2022 15:29:19 +0200
parents d16a4f379bbc
children bb33295dc62d
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