diff bsd.pypy.cffi.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 ee6885d5bdcb
children b0ce0cf90f22
line wrap: on
line diff
--- a/bsd.pypy.cffi.mk	Thu Oct 06 09:19:59 2022 +0200
+++ b/bsd.pypy.cffi.mk	Thu Oct 06 09:35:15 2022 +0200
@@ -18,6 +18,23 @@
 
 .include "${.CURDIR}/../../lang/pypy/bsd.pypy.mk"
 
+#
+# Check that this port's build selected option FORPYIMPL37, FORPYIMPL38 or FORPYIMPL39
+# is compatible to the corresponding build option of the installed pypy3.
+#
+.if ${FLAVOR} == pypy3 && exists(${LOCALBASE}/bin/pypy3)
+_PYPY_SC_PLATSTDLIB=	${:!${LOCALBASE}/bin/pypy3 -c 'import sysconfig; print(sysconfig.get_path("platstdlib"))'!}
+.  if ${PORT_OPTIONS:MFORPYIMPL37}
+.    if ${_PYPY_SC_PLATSTDLIB:T} != lib_pypy
+IGNORE=		Port option mismatch: must match FORPYIMPLxx of the installed lang/pypy3
+.    endif
+.  else
+.    if ${_PYPY_SC_PLATSTDLIB:T} != ${PYTHON_IMPL_MINOR}
+IGNORE=		Port option mismatch: must match FORPYIMPLxx of the installed lang/pypy3
+.    endif
+.  endif
+.endif
+
 .if ${FLAVOR} == pypy || ${PORT_OPTIONS:MFORPYIMPL37}
 PLIST_FILES=	${PYPY_DIR}/lib_pypy/${CFFI_MODULE}_cffi.${PYPY_CFFI_VER}.so
 .else  # pypy3