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

PORTNAME=	pypy3
PORTVERSION=	3
PORTEPOCH=	1
CATEGORIES=	lang python
MASTER_SITES=
DISTFILES=

MAINTAINER=	fzglas.hg@dom66.de
COMMENT=	Meta-port for the PyPy Python implementation (PyPy3)
WWW=		https://www.pypy.org

LICENSE=	MIT

RUN_DEPENDS=	${LOCALBASE}/bin/pypy${PYPY_PYTHON_IMPL_VERSION}:lang/${PYPY_PORT}

NO_ARCH=	yes
NO_BUILD=	yes
NO_TEST=	yes

PLIST_FILES=	bin/pypy${PYPY_PYTHON_IMPL_VER_MAJOR} \
		${PYPY_DIR}/bin/pypy${PYPY_PYTHON_IMPL_VER_MAJOR} \
		${PYPY_DIR}/bin/python${PYPY_PYTHON_IMPL_VER_MAJOR}

# The default PyPy version that this meta-port is dependent on
PYPY_VERSION=	7.3.14
PYPY_PYTHON_IMPL_VERSION=	3.10
PYPY_PYTHON_IMPL_VER_MAJOR=	${PYPY_PYTHON_IMPL_VERSION:C|([0-9]+)\.[0-9]+|\1|}
PYPY_PORT=	pypy310
PYPY_DIR=	pypy${PYPY_PYTHON_IMPL_VER_MAJOR}-${PYPY_VERSION:C|([0-9]+)\.([0-9]+).*|\1.\2|}

do-install:
	${MKDIR} ${STAGEDIR}${PREFIX}/${PYPY_DIR}/bin
	${LN} -sf ../${PYPY_DIR}/bin/pypy${PYPY_PYTHON_IMPL_VERSION} ${STAGEDIR}${PREFIX}/bin/pypy${PYPY_PYTHON_IMPL_VER_MAJOR}
	${LN} -sf pypy${PYPY_PYTHON_IMPL_VERSION} ${STAGEDIR}${PREFIX}/${PYPY_DIR}/bin/pypy${PYPY_PYTHON_IMPL_VER_MAJOR}
	${LN} -sf pypy${PYPY_PYTHON_IMPL_VERSION} ${STAGEDIR}${PREFIX}/${PYPY_DIR}/bin/python${PYPY_PYTHON_IMPL_VER_MAJOR}

.include <bsd.port.mk>
