--- usr/portage/sci-physics/abinit/abinit-5.4.4.ebuild 2008-07-05 01:10:36.000000000 +0000 +++ usr/portage/local/my/sci-physics/abinit/abinit-5.6.4.ebuild 2009-01-22 12:50:34.000000000 +0000 @@ -1,6 +1,5 @@ -# Copyright 1999-2008 Gentoo Foundation +# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sci-physics/abinit/abinit-5.4.4.ebuild,v 1.1 2008/07/05 01:10:36 dberkholz Exp $ inherit fortran toolchain-funcs @@ -11,14 +10,16 @@ LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~ppc ~x86" -IUSE="mpi test" +IUSE="mpi netcdf test" RDEPEND="virtual/blas - virtual/lapack" + virtual/lapack + mpi? ( virtual/mpi ) + netcdf? ( sci-libs/netcdf )" DEPEND="${RDEPEND}" # F90 code, g77 won't work -FORTRAN="gfortran ifc" +FORTRAN="gfortran ifc mpif90" pkg_setup() { fortran_pkg_setup @@ -37,18 +38,6 @@ unpack ${A} cd "${S}" epatch "${FILESDIR}"/5.3.4-change-default-directories.patch - epatch "${FILESDIR}"/5.2.3-fix-64bit-detection.patch - - # bug #223111: Our eautoreconf directory detection breaks - sed -i -e "s:@abinit_srcdir@/::" Makefile.am - - # bug #223111: libtool 2.2 fix (taken from bug #230271) - if [ -f '/usr/share/aclocal/ltsugar.m4' ]; then - cat "/usr/share/aclocal/ltsugar.m4" >> config/m4/libtool.m4 - cat "/usr/share/aclocal/ltversion.m4" >> config/m4/libtool.m4 - cat "/usr/share/aclocal/lt~obsolete.m4" >> config/m4/libtool.m4 - cat "/usr/share/aclocal/ltoptions.m4" >> config/m4/libtool.m4 - fi # Yea for breaking compatibility with no ChangeLog entry in 2.60 if has_version '>=sys-devel/autoconf-2.60'; then @@ -59,18 +48,27 @@ } src_compile() { + if use mpi; then + MY_FC="mpif90" + MY_CC="mpicc" + else + MY_FC="${FORTRANC}" + MY_CC="$(tc-getCC)" + fi econf \ - --with-install-type=debian \ - --disable-config-file \ - --disable-library-search \ $(use_enable mpi) \ - --with-blas-prefix=/usr \ - --with-lapack-prefix=/usr \ - --with-c-optflags="${CFLAGS}" \ - --with-fortran-optflags="${FFLAGS}" \ - --with-fortran-ldflags='-lpthread' \ - FC="${FORTRANC}" \ - CC="$(tc-getCC)" \ + $(use_enable netcdf) \ + $(use_enable netcdf etsf-io) \ + --with-netcdf-includes="-I/usr/include" \ + --with-netcdf-libs="-L/usr/lib -lnetcdff" \ + --with-etsf-io-includes="-I/usr/include" \ + --with-etsf-io-libs="-L/usr/lib -letsf_io -letsf_io_low_level -letsf_io_utils" \ + --with-linalg-libs="-L/usr/lib -lblas -llapack" \ + --with-cc-optflags="${CFLAGS}" \ + --with-fc-optflags="${FFLAGS}" \ + --with-fc-ld-optlibs='-lpthread' \ + FC="${MY_FC}" \ + CC="${MY_CC}" \ LD="$(tc-getLD)" \ || die "configure failed"