science/py-ncrystal: Enable executables; Add test target

This commit is contained in:
Yuri Victorovich 2025-02-28 03:29:15 -08:00
parent 2111a7cf27
commit 72e1c8229e

View file

@ -1,6 +1,7 @@
PORTNAME= ncrystal
DISTVERSIONPREFIX= v
DISTVERSION= 4.1.2
PORTREVISION= 1
CATEGORIES= science # physics
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@ -18,20 +19,22 @@ BUILD_DEPENDS= ${PY_SETUPTOOLS} \
RUN_DEPENDS= ${PYNUMPY}
USES= python
USE_PYTHON= pep517 autoplist
USE_PYTHON= pep517 concurrent autoplist
USE_GITHUB= yes
GH_ACCOUNT= mctools
POST_PLIST= fix-plist
TEST_ENV= ${MAKE_ENV} \
PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} \
PATH=${STAGEDIR}${PREFIX}/bin:${PATH}
#TEST_WRKSRC= ${WRKSRC}/ncrystal_python
post-install:
# delete scripts (they are installed by science/ncrystal)
@${RM} ${STAGEDIR}${PREFIX}/bin/*
# strip binary
#@${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/NCrystal/ncrystal_pyinst_data/lib/libNCrystal.so
fix-plist: # see post-install
@${REINPLACE_CMD} -e "s|^bin/.*$$||" ${TMPPLIST}
do-test: # the third test fails for an unknown reason
@cd ${TEST_WRKSRC} && \
${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m NCrystal.test all
.include <bsd.port.mk>