math/py-mnnpy: Make march compiler argument depend on CPUTYPE

Reported by:	fallout
This commit is contained in:
Yuri Victorovich
2023-08-15 17:25:16 -07:00
parent c960759946
commit bfaa9b92af

View File

@@ -1,5 +1,6 @@
PORTNAME= mnnpy
DISTVERSION= 0.1.9.5
PORTREVISION= 1
CATEGORIES= math python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@@ -22,6 +23,13 @@ RUN_DEPENDS= ${PY_DEPENDS}
USES= python
USE_PYTHON= distutils cython autoplist
post-patch:
.if defined(CPUTYPE)
@${REINPLACE_CMD} -e "s|'-march=native'|'-march=${CPUTYPE}'|" ${WRKSRC}/setup.py
.else
@${REINPLACE_CMD} -e "s|'-march=native', ||" ${WRKSRC}/setup.py
.endif
post-install:
@${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/mnnpy/_utils.cpython-39.so