From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id D71BC198005 for ; Sat, 2 Mar 2013 23:19:48 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 72544E07A0; Sat, 2 Mar 2013 23:19:43 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 814C7E0796 for ; Sat, 2 Mar 2013 23:19:42 +0000 (UTC) Received: from mail-ie0-x22a.google.com (mail-ie0-x22a.google.com [IPv6:2607:f8b0:4001:c03::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: ottxor) by smtp.gentoo.org (Postfix) with ESMTPSA id A659A33DB0B for ; Sat, 2 Mar 2013 23:19:41 +0000 (UTC) Received: by mail-ie0-f170.google.com with SMTP id c11so4943841ieb.15 for ; Sat, 02 Mar 2013 15:19:39 -0800 (PST) X-Received: by 10.42.159.194 with SMTP id m2mr17485496icx.13.1362266379912; Sat, 02 Mar 2013 15:19:39 -0800 (PST) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Received: by 10.43.103.133 with HTTP; Sat, 2 Mar 2013 15:19:19 -0800 (PST) In-Reply-To: <1362001405-25636-8-git-send-email-mgorny@gentoo.org> References: <20130227224152.6d1293c9@pomiocik.lan> <1362001405-25636-8-git-send-email-mgorny@gentoo.org> From: Christoph Junghans Date: Sat, 2 Mar 2013 16:19:19 -0700 Message-ID: Subject: Re: [gentoo-dev] [PATCH 8/8] fftw: example use of multibuild in ebuild. To: gentoo-dev@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 83a3f0cc-0117-44bc-a0d6-eb12a42a97db X-Archives-Hash: 4fa0c59d11b79d7f6855064aa7ca0ade +1, feel free to commit, when multibuild.eclass was added. 2013/2/27 Micha=C5=82 G=C3=B3rny : > Just a quick, dirty example. Not even tested thoroughly ;). > --- > gx86/sci-libs/fftw/fftw-3.3.3-r1.ebuild | 38 +++++++++++++--------------= ------ > 1 file changed, 15 insertions(+), 23 deletions(-) > > diff --git a/gx86/sci-libs/fftw/fftw-3.3.3-r1.ebuild b/gx86/sci-libs/fftw= /fftw-3.3.3-r1.ebuild > index 18554f0..ddca8e4 100644 > --- a/gx86/sci-libs/fftw/fftw-3.3.3-r1.ebuild > +++ b/gx86/sci-libs/fftw/fftw-3.3.3-r1.ebuild > @@ -7,7 +7,7 @@ EAPI=3D5 > #AUTOTOOLS_AUTORECONF=3D1 > FORTRAN_NEEDED=3Dfortran > > -inherit autotools-multilib eutils flag-o-matic fortran-2 toolchain-funcs= versionator > +inherit autotools-multilib eutils flag-o-matic fortran-2 multibuild tool= chain-funcs versionator > > DESCRIPTION=3D"Fast C library for the Discrete Fourier Transform" > HOMEPAGE=3D"http://www.fftw.org/" > @@ -24,6 +24,8 @@ DEPEND=3D"${RDEPEND} > test? ( dev-lang/perl )" > > pkg_setup() { > + # XXX: this looks like it should be used with BUILD_TYPE!=3Dbinar= y > + > if use openmp; then > if [[ $(tc-getCC) =3D=3D *gcc ]] && ! tc-has-openmp; then > ewarn "OpenMP is not available in your current se= lected gcc" > @@ -32,13 +34,13 @@ pkg_setup() { > FORTRAN_NEED_OPENMP=3D1 > fi > fortran-2_pkg_setup > - FFTW_DIRS=3D"single double longdouble" > + MULTIBUILD_VARIANTS=3D( single double longdouble ) > if use quad; then > if [[ $(tc-getCC) =3D=3D *gcc ]] && ! version_is_at_least= 4.6 $(gcc-version); then > ewarn "quad precision only available for gcc >=3D= 4.6" > die "need quad precision capable gcc" > fi > - FFTW_DIRS+=3D" quad" > + MULTIBUILD_VARIANTS+=3D( quad ) > fi > } > > @@ -57,7 +59,9 @@ src_configure() { > # filter -Os according to docs > replace-flags -Os -O2 > > - for x in ${FFTW_DIRS}; do > + my_configure() { > + local x=3D${MULTIBUILD_VARIANT} > + > myeconfargs=3D( > $(use_enable fma) > $(use_enable fortran) > @@ -93,42 +97,30 @@ src_configure() { > die "${x} precision not implemented in this ebuil= d" > fi > > - einfo "Configuring for ${x} precision" > - BUILD_DIR=3D"${S}-${x}" \ > - autotools-multilib_src_configure > - done > + autotools-multilib_src_configure > + } > + > + multibuild_foreach my_configure > } > > src_compile() { > - for x in ${FFTW_DIRS}; do > - einfo "Compiling for ${x} precision" > - BUILD_DIR=3D"${S}-${x}" \ > - autotools-multilib_src_compile > - done > + multibuild_foreach autotools-multilib_src_compile > } > > src_test () { > - do_smalltest() { cd "${BUILD_DIR}" && emake -C tests smallcheck; = } > # We want this to be a reasonably quick test, but that is still h= ard... > ewarn "This test series will take 30 minutes on a modern 2.5Ghz m= achine" > # Do not increase the number of threads, it will not help your pe= rformance > #local testbase=3D"perl check.pl --nthreads=3D1 --estimate" > # ${testbase} -${p}d || die "Failure: $n" > - for x in ${FFTW_DIRS}; do > - einfo "Testing ${x} precision" > - BUILD_DIR=3D"${S}-${x}" \ > - multilib_foreach_abi do_smalltest > - done > + multibuild_foreach autotools-multilib_src_compile -C tests smallc= heck > } > > src_install () { > local u x > DOCS=3D( AUTHORS ChangeLog NEWS README TODO COPYRIGHT CONVENTIONS= ) > HTML_DOCS=3D( doc/html/ ) > - for x in ${FFTW_DIRS}; do > - BUILD_DIR=3D"${S}-${x}" \ > - autotools-multilib_src_install > - done > + multibuild_foreach autotools-multilib_src_install > > if use doc; then > dodoc doc/*.pdf > -- > 1.8.1.4 > > -- Christoph Junghans http://dev.gentoo.org/~ottxor/