Update science/abinit to version 5.7.3_16
[dports.git] / science / abinit / Makefile
1 # Created by: NAKATA Maho <maho@FreeBSD.org>
2 # $FreeBSD$
3
4 PORTNAME=       abinit
5 PORTVERSION=    5.7.3
6 PORTREVISION=   16
7 CATEGORIES=     science
8 MASTER_SITES=   ftp://ftp.abinit.org/pub/abinitio/ABINIT_v${PORTVERSION}/
9
10 MAINTAINER=     ports@FreeBSD.org
11 COMMENT=        Abinit calculates electronic structure of systems
12
13 BUILD_DEPENDS=  python:${PORTSDIR}/lang/python \
14                 ${PYTHON_SITELIBDIR}/numarray/__init__.py:${PORTSDIR}/math/py-numarray
15 LIB_DEPENDS=    libnetcdff.so:${PORTSDIR}/science/netcdf-fortran \
16                 libgsl.so:${PORTSDIR}/math/gsl
17
18 USES=           fortran gmake perl5
19 USE_PYTHON=     yes
20 USE_PERL5=      build
21 USE_AUTOTOOLS=  autoconf automake
22 CONFIGURE_ENV=  WGET=${TRUE}
23 CONFIGURE_ARGS= --disable-wannier90 --disable-bigdft --disable-etsf-io  \
24                 --with-plugins-tardir=/dev/null                         \
25                 --with-netcdf-includes="-I${LOCALBASE}/include"         \
26                 --enable-bindings --enable-gsl                          \
27                 --with-netcdf-libs="-L${LOCALBASE}/lib -lnetcdff -lnetcdf"
28 CPPFLAGS+=      -I${LOCALBASE}/include
29 LDFLAGS+=       -L${LOCALBASE}/lib
30
31 OPTIONS_DEFINE= DOCS EXAMPLES
32
33 NO_STAGE=       yes
34 .include <bsd.port.options.mk>
35
36 .if ${PORT_OPTIONS:MDOCS}
37 USE_TEX=        latex:build dvipsk:build
38 BUILD_DEPENDS+= gm4:${PORTSDIR}/devel/m4                \
39                 markdown:${PORTSDIR}/textproc/markdown
40 USE_GHOSTSCRIPT_BUILD=  yes
41 .endif
42
43 .if ${ARCH} == "ia64" || ${ARCH} == "powerpc" || ${ARCH} == "sparc64"
44 MANUAL_PACKAGE_BUILD=   takes a tremendous amount of time to build on pointyhat nodes
45 .endif
46
47 .if exists(${LOCALBASE}/lib/libatlas.so) && !defined(WITH_BLAS)
48 WITH_ATLAS=     yes
49 .endif
50 .if defined(WITH_ATLAS)
51 LIB_DEPENDS+=   libatlas.so:${PORTSDIR}/math/atlas
52 BLAS=           -lf77blas
53 LAPACK=         -lalapack -lcblas
54 .else
55 LIB_DEPENDS+=   libblas.so:${PORTSDIR}/math/blas
56 LIB_DEPENDS+=   liblapack.so:${PORTSDIR}/math/lapack
57 BLAS=           -lblas
58 LAPACK=         -llapack
59 .endif
60
61 pre-configure:
62 .if ! ${PORT_OPTIONS:MDOCS}
63         ${REINPLACE_CMD} -e '/^abinit_top_subdirs =/s| doc||' ${WRKSRC}/config/specs/other.cf
64 .endif
65 .if ! ${PORT_OPTIONS:MEXAMPLES}
66         ${REINPLACE_CMD} -e '/^abinit_top_subdirs =/s| tests||' ${WRKSRC}/config/specs/other.cf
67 .endif
68         (cd ${WRKSRC} && ./config/scripts/makemake)
69         ${CHMOD} a+x ${WRKSRC}/bindings/parser/*.py
70
71 post-build:
72         @(cd ${BUILD_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} \
73                 ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} libabinit)
74
75 post-install:
76         ${MKDIR} ${PREFIX}/include ${PREFIX}/lib
77 .for lf in libabinip.a libabinis.a
78         ${INSTALL_DATA} ${WRKSRC}/${lf} ${PREFIX}/lib
79 .endfor
80 .for lf in ab_dtset_c.h dtset_c.h dtset_c.static.h dtset_f90.inc dtset_py.h     \
81         ab_dtset_f90_get.f90
82         ${INSTALL_DATA} ${WRKSRC}/bindings/parser/${lf} ${PREFIX}/include
83 .endfor
84
85 regression-test:
86         cd ${WRKSRC}/tests ; ${MAKE_CMD} tests_min
87
88 .include <bsd.port.mk>