--- mpqc-2.3.1-r1.ebuild.orig 2010-02-14 11:16:31.298950862 +0100 +++ mpqc-2.3.1-r1.ebuild 2010-02-14 11:07:12.574296286 +0100 @@ -1,8 +1,10 @@ -# Copyright 1999-2006 Gentoo Foundation +# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/sci-chemistry/mpqc/mpqc-2.3.1-r1.ebuild,v 1.7 2007/07/13 05:48:10 mr_bones_ Exp $ -inherit fortran +EAPI=2 + +inherit autotools eutils fortran DESCRIPTION="The Massively Parallel Quantum Chemistry Program" HOMEPAGE="http://www.mpqc.org/" @@ -12,10 +14,11 @@ SLOT="0" # Should work on x86, amd64 and ppc, at least KEYWORDS="amd64 ppc ppc64 x86" -IUSE="doc threads tk" +IUSE="doc mpi threads tk" RDEPEND="virtual/blas virtual/lapack + mpi? ( virtual/mpi[cxx] ) tk? ( dev-lang/tk )" DEPEND="${RDEPEND} sys-devel/flex @@ -24,10 +27,11 @@ doc? ( app-doc/doxygen media-gfx/graphviz )" -src_unpack() { - unpack ${A} - cd "${S}" - +src_prepare() { + epatch "${FILESDIR}/${P}-as-needed.patch" + epatch "${FILESDIR}/${P}-respect-ldflags.patch" + # it's a nasty workaround rather than patch + epatch "${FILESDIR}/${P}-test-failure-hack.patch" # do not install tkmolrender if not requested if ! use tk; then sed -e "s:.*/bin/molrender/tkmolrender.*::" \ @@ -36,21 +40,26 @@ -i "./src/bin/molrender/Makefile" \ || die "failed to disable tkmolrender" fi + eautoreconf } -src_compile() { +src_configure() { + if use mpi; then + export CC=mpicc + export CXX=mpicxx + fi # Only shared will work on ppc64 - bug #62124 # But we always want shared libraries econf \ $(use_enable threads) \ + $(use_enable mpi parallel) \ --enable-shared \ - ${myconf} || die "configure failed" + ${myconf} sed -i -e "s:^CFLAGS =.*$:CFLAGS=${CFLAGS}:" \ -e "s:^FFLAGS =.*$:FFLAGS=${FFLAGS:- -O2}:" \ -e "s:^CXXFLAGS =.*$:CXXFLAGS=${CXXFLAGS}:" \ lib/LocalMakefile - emake || die "emake failed" } src_test() {