--- netcdf-4.0.1.ebuild.orig 2010-01-28 19:12:24.000000000 +0100 +++ netcdf-4.0.1.ebuild 2010-01-28 19:03:37.000000000 +0100 @@ -1,6 +1,6 @@ -# Copyright 1999-2009 Gentoo Foundation +# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sci-libs/netcdf/netcdf-4.0.1.ebuild,v 1.1 2009/12/07 08:59:30 bicatali Exp $ +# $Header$ EAPI=2 @@ -12,17 +12,19 @@ LICENSE="UCAR-Unidata" SLOT="0" -IUSE="doc fortran hdf5 mpi szip" +IUSE="doc fortran hdf5 mpi szip cxx" KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86" -RDEPEND="hdf5? ( >=sci-libs/hdf5-1.8[zlib,szip?,mpi?] )" +RDEPEND="hdf5? ( >=sci-libs/hdf5-1.8[zlib,szip?,mpi=] )" DEPEND="${RDEPEND} >=sys-devel/libtool-2.2 doc? ( virtual/latex-base ) - fortran? ( dev-lang/cfortran )" + fortran? ( dev-lang/cfortran ) + mpi? ( virtual/mpi[cxx?,fortran?] )" src_prepare() { epatch "${FILESDIR}"/${P}-as-needed.patch + epatch "${FILESDIR}"/${P}-fortran-tests.patch rm -f fortran/cfortran.h || die eautoreconf } @@ -33,12 +35,23 @@ myconf="--with-hdf5=/usr --with-zlib=/usr" use szip && myconf="${myconf} --with-szlib=/usr" fi + if use mpi; then + export CC=mpicc + if use cxx; then + export CXX=mpicxx + fi + if use fortran; then + export FC=mpif90 + export F77=mpif77 + fi + fi econf \ --docdir=/usr/share/doc/${PF} \ --enable-shared \ $(use_enable fortran f77) \ $(use_enable fortran f90) \ + $(use_enable cxx) \ $(use_enable fortran separate-fortran) \ $(use_enable hdf5 netcdf-4) \ $(use_enable hdf5 ncgen4) \