/[gentoo-x86]/sci-physics/mpb/mpb-1.4.2-r2.ebuild
Gentoo

Contents of /sci-physics/mpb/mpb-1.4.2-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Tue Feb 19 19:44:18 2013 UTC (3 months ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +4 -4 lines
sci-physics/mpb: Use tc-getPKG_CONFIG from toolchain-funcs.eclass instead of plain pkg-config

(Portage version: 2.2.0_alpha163/cvs/Linux x86_64, signed Manifest commit with key 8009D6F070EB7916)

1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-physics/mpb/mpb-1.4.2-r2.ebuild,v 1.6 2012/08/08 04:08:59 bicatali Exp $
4
5 EAPI=4
6
7 inherit eutils autotools flag-o-matic toolchain-funcs
8
9 DESCRIPTION="Photonic band structure program"
10 SRC_URI="http://ab-initio.mit.edu/mpb/${P}.tar.gz"
11 HOMEPAGE="http://ab-initio.mit.edu/mpb/"
12
13 LICENSE="GPL-2"
14 KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
15 IUSE="doc examples hdf5 mpi"
16
17 SLOT="0"
18
19 RDEPEND="virtual/lapack
20 dev-scheme/guile
21 sci-libs/libctl
22 sci-libs/fftw:2.1[mpi?]
23 sys-libs/readline
24 hdf5? ( sci-libs/hdf5 )
25 mpi? ( virtual/mpi )"
26
27 DEPEND="${RDEPEND}
28 virtual/pkgconfig"
29
30 src_prepare() {
31 epatch \
32 "${FILESDIR}"/${P}-autotools.patch \
33 "${FILESDIR}"/${P}-guile18.patch \
34 "${FILESDIR}"/${P}-headers.patch
35 cd "${S}"
36 eautoreconf
37 # version with inversion symmetry (mpbi).
38 cp -r "${S}" "${S}_inv" || die
39 # version with hermitian eps (mpbh).
40 cp -r "${S}" "${S}_herm" || die
41 # mpi versions (mpb-mpi).
42 if use mpi; then
43 cp -r "${S}" "${S}_mpi" || die
44 cp -r "${S}" "${S}_inv_mpi" || die
45 cp -r "${S}" "${S}_herm_mpi" || die
46 fi
47 tc-export CC
48 }
49
50 src_configure() {
51 # enable legacy API for hdf-1.8
52 use hdf5 && append-cflags -DH5_USE_16_API
53 #
54 local myconf=(
55 --with-libctl="${EPREFIX}/usr/share/libctl"
56 --with-blas="$($(tc-getPKG_CONFIG) --libs blas)"
57 --with-lapack="$($(tc-getPKG_CONFIG) --libs lapack)"
58 $(use_with hdf5)
59 )
60
61 econf "${myconf[@]}"
62
63 cd "${S}_inv"
64 econf "${myconf[@]}" \
65 --with-inv-symmetry
66
67 cd "${S}_herm"
68 econf "${myconf[@]}" \
69 --with-hermitian-eps
70
71 if use mpi; then
72 cd "${S}_mpi"
73 econf "${myconf[@]}" \
74 --with-mpi
75 cd "${S}_inv_mpi"
76 econf "${myconf[@]}" \
77 --with-inv-symmetry \
78 --with-mpi
79 cd "${S}_herm_mpi"
80 econf "${myconf[@]}" \
81 --with-hermitian-eps \
82 --with-mpi \
83 CC=mpicc
84 fi
85 }
86
87 src_compile() {
88 local d
89 for d in . _inv _herm; do
90 cd "${S}${d}"
91 emake -C mpb-ctl ctl-io.c
92 emake
93 done
94 if use mpi; then
95 for d in . _inv _herm; do
96 cd "${S}${d}_mpi"
97 emake -C mpb-ctl ctl-io.c CC=mpicc
98 emake CC=mpicc LD=mpicc
99 done
100 fi
101 }
102
103 src_install() {
104 einstall
105 dodoc README NEWS AUTHORS COPYRIGHT ChangeLog TODO
106 use doc && dohtml doc/*
107 if use examples; then
108 insinto /usr/share/doc/${PF}
109 doins -r mpb-ctl/examples
110 fi
111
112 newbin "${S}_inv"/mpb-ctl/.mpb mpbi
113 newbin "${S}_herm"/mpb-ctl/.mpb mpbh
114
115 einfo "Several versions of mpb have been installed:"
116 einfo "mpb : regular version"
117 einfo "mpbi: configured for inversion symmetry"
118 einfo "mpbh: configured for hermitian epsilon"
119 if use mpi; then
120 newbin "${S}_mpi"/mpb-ctl/.mpb mpb-mpi
121 newbin "${S}_inv_mpi"/mpb-ctl/.mpb mpbh-mpi
122 newbin "${S}_herm_mpi"/mpb-ctl/.mpb mpbi-mpi
123 einfo "mpb-mpi : regular version with mpi"
124 einfo "mpbi-mpi: configured for inversion symmetry with mpi"
125 einfo "mpbh-mpi: configured for hermitian epsilon with mpi"
126 fi
127 }

  ViewVC Help
Powered by ViewVC 1.1.13