summaryrefslogtreecommitdiff
path: root/math/py-pynleq2/Makefile
blob: 9db81d45ac22e1d7cc6250a248da0e37a3dd7022 (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
# $FreeBSD$

PORTNAME=	pynleq2
DISTVERSION=	0.0.2
PORTREVISION=	4
CATEGORIES=	math python
MASTER_SITES=	CHEESESHOP
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
DISTFILES=	${DISTNAME}${EXTRACT_SUFX}

MAINTAINER=	yuri@FreeBSD.org
COMMENT=	Python binding for NLEQ2 algorithm's fortran implementation

LICENSE=	BSD2CLAUSE
LICENSE_FILE=	${WRKSRC}/LICENSE

BUILD_DEPENDS=	${PYNUMPY}

USES=		fortran:flang python
USE_PYTHON=	distutils autoplist
USE_GITHUB=	nodefault
GH_TUPLE=	PySCeS:pysces:0.9.6:fortran

BINARY_ALIAS=	gfortran6=flang # it keeps using gfortran6 regardless of the environment variables and arguments

FORTRAN_FILES=	linalg_nleq2.f nleq2.f wnorm.f zibconst.f zibmon.f zibsec.f

post-patch:
	@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' ${WRKSRC}/setup.py

pre-build: # compile fortran files into a static library because distutils fails while doing this
	@${MKDIR} ${WRKDIR}/.fbuild && \
		cd ${WRKDIR}/.fbuild && \
		flang -c ${CFLAGS} -fPIC ${FORTRAN_FILES:C,^,${WRKSRC_fortran}/pysces/nleq2/,} && \
		${AR} -qc libff.a ${FORTRAN_FILES:S/.f/.o/}

post-install:
	@${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/${PORTNAME}/nleq2.so

.include <bsd.port.mk>