]> Pileus Git - ~andy/sunrise/blob - sci-libs/cantera/cantera-1.7.0.ebuild
sci-libs/openfoam-src: Fixed typos
[~andy/sunrise] / sci-libs / cantera / cantera-1.7.0.ebuild
1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header:  $
4
5 inherit toolchain-funcs multilib flag-o-matic
6
7 DESCRIPTION="An Object-Oriented Software for Reacting Flows."
8 HOMEPAGE="http://www.cantera.org/"
9 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
10
11 LICENSE="BSD"
12 SLOT="0"
13 KEYWORDS="~amd64 ~x86"
14 IUSE="blas fortran python"
15
16 DEPEND="blas? ( virtual/blas virtual/cblas virtual/lapack )
17         fortran? ( dev-lang/f2c )
18         python? ( dev-python/numeric )"
19
20 RDEPEND="${DEPEND}"
21 PREFIX="${D}"usr
22
23 src_compile() {
24         if use blas ; then
25                 sed -i -e "s|#BLAS_LAPACK_LIBS'-llapack -lf77blas -lcblas -latlas'|BLAS_LAPACK_LIBS='-llapack -lblas -lcblas -latlas'|" \
26                 -e "s|#BLAS_LAPACK_DIR='/usr/lib'|BLAS_LAPACK_DIR='/usr/$(get_libdir)'|" "${S}"/preconfig || die
27         fi
28
29         if use fortran ; then
30                 sed -i -e 's|BUILD_F90_INTERFACE=${BUILD_F90_INTERFACE:="default"}|BUILD_F90_INTERFACE=${BUILD_F90_INTERFACE:="y"}|' "${S}"/preconfig || die
31         else
32                 sed -i -e 's|BUILD_F90_INTERFACE=${BUILD_F90_INTERFACE:="default"}|BUILD_F90_INTERFACE=${BUILD_F90_INTERFACE:="n"}|' "${S}"/preconfig || die
33         fi
34
35         if use python ; then
36                 sed -i -e 's|PYTHON_PACKAGE=${PYTHON_PACKAGE:="default"}|PYTHON_PACKAGE=${PYTHON_PACKAGE:="full"}|' \
37                 -e 's|USE_NUMERIC=${USE_NUMERIC:="default"}|USE_NUMERIC=${USE_NUMERIC:="y"}|' "${S}"/preconfig || die
38         else
39                 sed -i -e 's|PYTHON_PACKAGE=${PYTHON_PACKAGE:="default"}|PYTHON_PACKAGE=${PYTHON_PACKAGE:="none"}|' \
40                 -e 's|USE_NUMERIC=${USE_NUMERIC:="default"}|USE_NUMERIC=${USE_NUMERIC:="n"}|' "${S}"/preconfig || die
41         fi
42
43         sed -i -e "s|\"ar ruv\"|\"$(tc-getAR) ruv\"|" \
44         -e "s|\"ranlib\"|\"$(tc-getRANLIB)\"|" \
45         "${S}"/preconfig || die
46
47         sed -i -e "s|ct_libdir=\\\${prefix}/lib|ct_libdir=\\\${prefix}/$(get_libdir)|" \
48         -e "s|ct_datadir=\\\${prefix}/data|ct_datadir=\\\${prefix}/share/${PN}/data|" \
49         -e "s|ct_demodir=\\\${prefix}/demos|ct_demodir=\\\${prefix}/share/${PN}/demos|" \
50         -e "s|ct_templdir=\\\${prefix}/templates|ct_templdir=\\\${prefix}/share/${PN}/templates|" \
51         -e "s|ct_tutdir=\\\${prefix}/tutorials|ct_tutdir=\\\${prefix}/share/${PN}/tutorials|" \
52         -e "s|ct_docdir=\\\${prefix}/doc|ct_docdir=\\\${prefix}/share/${PN}/doc|" \
53         -e "s|ct_mandir=\\\${prefix}|ct_mandir=\\\${prefix}/share/man|" \
54         "${S}"/configure || die
55
56         sed -i -e "s|cp -f \\\"@homedir@/setup_cantera\\\" \\\"@ct_bindir@\\\"||" \
57         -e "s|rm -fR @ct_libdir@/\*||" "${S}"/Makefile.in
58
59         append-flags -fPIC
60         ./preconfig --prefix=${PREFIX} || die "could not configure"
61
62         sed -i -e "s|${PREFIX}/templates|${PREFIX}/share/${PN}/templates|" "${S}"/tools/Makefile || die
63         sed -i -e "s|/lib/|/$(get_libdir)/|" "${S}"/tools/src/finish_install.py || die
64
65         emake -j1 all || die "emake failed"
66 }
67
68 src_install() {
69         emake DESTDIR="${D}" install || die "could not install"
70 }