1 # Created by: NAKATA Maho <maho@FreeBSD.org>
8 MASTER_SITES= ftp://ftp.abinit.org/pub/abinitio/ABINIT_v${PORTVERSION}/
10 MAINTAINER= ports@FreeBSD.org
11 COMMENT= Abinit calculates electronic structure of systems
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
18 USES= fortran gmake perl5
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
31 OPTIONS_DEFINE= DOCS EXAMPLES
34 .include <bsd.port.options.mk>
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
43 .if ${ARCH} == "ia64" || ${ARCH} == "powerpc" || ${ARCH} == "sparc64"
44 MANUAL_PACKAGE_BUILD= takes a tremendous amount of time to build on pointyhat nodes
47 .if exists(${LOCALBASE}/lib/libatlas.so) && !defined(WITH_BLAS)
50 .if defined(WITH_ATLAS)
51 LIB_DEPENDS+= libatlas.so:${PORTSDIR}/math/atlas
53 LAPACK= -lalapack -lcblas
55 LIB_DEPENDS+= libblas.so:${PORTSDIR}/math/blas
56 LIB_DEPENDS+= liblapack.so:${PORTSDIR}/math/lapack
62 .if ! ${PORT_OPTIONS:MDOCS}
63 ${REINPLACE_CMD} -e '/^abinit_top_subdirs =/s| doc||' ${WRKSRC}/config/specs/other.cf
65 .if ! ${PORT_OPTIONS:MEXAMPLES}
66 ${REINPLACE_CMD} -e '/^abinit_top_subdirs =/s| tests||' ${WRKSRC}/config/specs/other.cf
68 (cd ${WRKSRC} && ./config/scripts/makemake)
69 ${CHMOD} a+x ${WRKSRC}/bindings/parser/*.py
72 @(cd ${BUILD_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} \
73 ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} libabinit)
76 ${MKDIR} ${PREFIX}/include ${PREFIX}/lib
77 .for lf in libabinip.a libabinis.a
78 ${INSTALL_DATA} ${WRKSRC}/${lf} ${PREFIX}/lib
80 .for lf in ab_dtset_c.h dtset_c.h dtset_c.static.h dtset_f90.inc dtset_py.h \
82 ${INSTALL_DATA} ${WRKSRC}/bindings/parser/${lf} ${PREFIX}/include
86 cd ${WRKSRC}/tests ; ${MAKE_CMD} tests_min
88 .include <bsd.port.mk>