summaryrefslogtreecommitdiff
path: root/science/py-qiskit-nature/Makefile
blob: baf158986b1792971c281eafd64a57589ae86c91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
PORTNAME=	qiskit-nature
DISTVERSION=	0.4.4
CATEGORIES=	science python # quantum-computing, quantum-chemistry
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}

MAINTAINER=	yuri@FreeBSD.org
COMMENT=	Natural science submodule for Quiskit framework for quantum computing

LICENSE=	APACHE20
LICENSE_FILE=	${WRKSRC}/LICENSE.txt

PY_DEPENDS=	${PYTHON_PKGNAMEPREFIX}h5py>0:science/py-h5py@${PY_FLAVOR} \
		${PYNUMPY} \
		${PYTHON_PKGNAMEPREFIX}psutil>=5:sysutils/py-psutil@${PY_FLAVOR} \
		${PYTHON_PKGNAMEPREFIX}qiskit-terra>=0.21.0:science/py-qiskit-terra@${PY_FLAVOR} \
		${PYTHON_PKGNAMEPREFIX}rustworkx>=0.10.1:math/py-rustworkx@${PY_FLAVOR} \
		${PYTHON_PKGNAMEPREFIX}scikit-learn>=0.20.0:science/py-scikit-learn@${PY_FLAVOR} \
		${PYTHON_PKGNAMEPREFIX}scipy>=1.4:science/py-scipy@${PY_FLAVOR} \
		${PYTHON_PKGNAMEPREFIX}typing-extensions>0:devel/py-typing-extensions@${PY_FLAVOR}
QC_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pyscf>0:science/py-pyscf@${PY_FLAVOR} # quantum-chemistry drivers, other supported drivers are PyQuante, PSI4
BUILD_DEPENDS=	${PY_DEPENDS}
RUN_DEPENDS=	${PY_DEPENDS} \
		${QC_DEPENDS}
TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}joblib>0:devel/py-joblib@${PY_FLAVOR}

USES=		python:3.7+
USE_PYTHON=	distutils autoplist pytest # several tests fail with "No module named 'threadpoolctl'", see https://reviews.freebsd.org/D35513

USE_GITHUB=	yes
GH_ACCOUNT=	Qiskit

NO_ARCH=	yes

POST_PLIST=	fix-plist

post-patch: # project was renamed, see https://github.com/Qiskit/rustworkx/issues/656
	@${FIND} ${WRKSRC} -name "*.py" | ${XARGS} ${REINPLACE_CMD} -i '' -e 's|retworkx|rustworkx|'

post-install: # installs many binaries accessing commercial Gaussian software not available on FreeBSD, see https://github.com/Qiskit/qiskit-nature/issues/778
	@${FIND} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} -name "qcmatrixio.cpython-*.so" -delete

fix-plist: # see post-install
	@${REINPLACE_CMD} -e "s|.*/qcmatrixio\.cpython-.*\.so$$||" ${TMPPLIST}

.include <bsd.port.mk>