From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-dev+bounces-27834-garchives=archives.gentoo.org@gentoo.org>)
	id 1IzM1E-0005Uh-QH
	for garchives@archives.gentoo.org; Tue, 04 Dec 2007 00:52:13 +0000
Received: from robin.gentoo.org (localhost [127.0.0.1])
	by robin.gentoo.org (8.14.2/8.14.0) with SMTP id lB40obwq012023;
	Tue, 4 Dec 2007 00:50:37 GMT
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	by robin.gentoo.org (8.14.2/8.14.0) with ESMTP id lB40mdiP009620
	for <gentoo-dev@lists.gentoo.org>; Tue, 4 Dec 2007 00:48:39 GMT
Received: from gentoo.org (c-67-171-150-177.hsd1.or.comcast.net [67.171.150.177])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTP id C275A658A5;
	Tue,  4 Dec 2007 00:48:38 +0000 (UTC)
Date: Mon, 3 Dec 2007 16:48:37 -0800
From: Donnie Berkholz <dberkholz@gentoo.org>
To: gentoo-dev@lists.gentoo.org, nerdboy@gentoo.org
Subject: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in sci-libs/hdf5:
	hdf5-1.6.2.ebuild ChangeLog hdf5-1.6.4.ebuild hdf5-1.6.5-r1.ebuild
	hdf5-1.6.5.ebuild hdf5-1.6.6.ebuild
Message-ID: <20071204004837.GC29076@supernova>
References: <E1Iz5cn-0003ZR-OS@stork.gentoo.org>
Precedence: bulk
List-Post: <mailto:gentoo-dev@lists.gentoo.org>
List-Help: <mailto:gentoo-dev+help@gentoo.org>
List-Unsubscribe: <mailto:gentoo-dev+unsubscribe@gentoo.org>
List-Subscribe: <mailto:gentoo-dev+subscribe@gentoo.org>
List-Id: Gentoo Linux mail <gentoo-dev.gentoo.org>
X-BeenThere: gentoo-dev@gentoo.org
Reply-to: gentoo-dev@lists.gentoo.org
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <E1Iz5cn-0003ZR-OS@stork.gentoo.org>
User-Agent: Mutt/1.5.16 (2007-06-09)
X-Archives-Salt: a54a7fe2-ea6b-48b8-b0a9-4d5ae51fa53d
X-Archives-Hash: 2ab5f175328aa45053cc5e6df17b2e6f

On 07:21 Mon 03 Dec     , Steve Arnold (nerdboy) wrote:
> 1.1                  sci-libs/hdf5/hdf5-1.6.6.ebuild
> 
> file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/hdf5/hdf5-1.6.6.ebuild?rev=1.1&view=markup
> plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/hdf5/hdf5-1.6.6.ebuild?rev=1.1&content-type=text/plain

> pkg_setup() {
> 	# The above gcc dep is a hack to insure at least one Fortran 90
> 	# compiler is installed if the user enables fortran support.  Feel
> 	# free to improve it...
> 	if use fortran ; then
> 	    if [ $(gcc-major-version) -ge 4 ] \
> 		&& built_with_use sys-devel/gcc fortran ; then
> 	    	    FORTRAN="gfortran"
> 		    fortran_pkg_setup
> 		    export F9X="gfortran"
> 		    einfo "Configuring for GNU gfortran..."
> 	    elif
> 		test -d /opt/intel/fortran90 ; then
> 		    FORTRAN="ifc"
> 		    fortran_pkg_setup
> 		    export F9X="ifc"
> 		    einfo "Configuring for Intel fortran..."
> 	    else
> 		einfo "No F90 compiler found; please install either gcc 4 with"
> 		einfo "fortran support or some other Fortran 90 compiler such"
> 		einfo "as ifc or pgf90 (or disable fortran support)."
> 		die "No usable Fortran 90 compiler found."
> 	    fi

You're pretty much reimplementing the fortran eclass here.

> src_unpack() {
> 	unpack "${A}"
> 	cd "${S}"
> 
> 	if use mpi; then
> 	    # this is required for mpich2, and should be safe otherwise
> 	    epatch "${FILESDIR}/${PN}-mpich2.patch" || die "mpich2 patch failed"
> 	fi
> 
> 	sed -i -e "s/tail +/tail -n +/" "${S}"/bin/release \
> 		"${S}"/tools/h5dump/testh5dump.sh.in

Using fixheadtails.eclass is an option here that would also 
automatically let you know when it's no longer needed.

> src_compile() {
> 	local myconf="--with-pic --enable-shared"
> 
> 	if use cxx && ! use mpi ; then
> 	    myconf="${myconf} --enable-cxx"
> 	elif use cxx && use mpi ; then
> 	    ewarn "C++ support is not compatible with the mpi interface."
> 	    die "Please disable either cxx or mpi."
> 	else
> 	    myconf="${myconf} --disable-cxx"
> 	fi
> 
> 	if use fortran && use mpi ; then
> 	    ewarn "Requires Fortran 90 support in your mpi library..."

Is there some way to check this?

> src_install() {
> 	make \
> 		prefix="${D}"usr \
> 		mandir="${D}"usr/share/man \
> 		docdir="${D}"usr/share/doc/"${PF}" \
> 		libdir="${D}"usr/$(get_libdir) \
> 		infodir="${D}usr"/share/info \
> 		install || die "make install failed"

This looks an awful lot like einstall.

Thanks,
Donnie
-- 
gentoo-dev@gentoo.org mailing list