# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 EAPI="2" inherit eutils multilib fortran DESCRIPTION="Calculates maximally localized Wannier functions (MLWFs)" HOMEPAGE="http://www.wannier.org/" SRC_URI="http://quasiamore.mit.edu/wannier/code/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="doc examples perl test" RDEPEND="virtual/blas virtual/lapack perl? ( dev-lang/perl )" DEPEND="${RDEPEND} doc? ( virtual/latex-base || ( dev-texlive/texlive-latexextra app-text/tetex app-tex/ptex ) )" FORTRAN="gfortran ifc mpif90" src_prepare() { # Patch taken from sci-physics/abinit-5.7.3 bundled version epatch "${FILESDIR}"/${PN}-1.1-0001.patch epatch "${FILESDIR}"/${PN}-1.1-0002.patch # epatch "${FILESDIR}"/${PN}-1.1-doc_fancyhdr.patch } src_configure() { cat <<- EOF >> "${S}"/make.sys F90 = ${FORTRANC} FCOPTS = ${FCFLAGS:- ${FFLAGS:- -O2}} LDOPTS = ${LDFLAGS} LIBS = -llapack -lblas EOF } src_compile() { emake -j1 wannier || die "make wannier failed" emake -j1 lib || die "make lib failed" if use doc; then emake -j1 doc || die "make doc failed" fi } src_test() { einfo "Compare the 'Standard' and 'Current' outputs of this test." pushd tests emake test || die cat wantest.log } src_install() { dobin wannier90.x || die "Wannier executable cannot be installed" if use perl; then ( cd utility; dobin kmesh.pl ) fi dolib.a libwannier.a || die "libwannier.a cannot be installed" insinto /usr/$(get_libdir)/finclude doins src/*.mod || die if use examples; then mkdir -p ${D}/usr/share/${PN} cp -r examples ${D}/usr/share/${PN}/; fi if use doc; then (cd doc; dodoc *.pdf ) fi dodoc README README.install LICENCE CHANGE.log }