1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit eutils versionator multilib toolchain-funcs
10 MY_PV=$(get_version_component_range 1-2)
11 MY_P="${MY_PN}-${MY_PV}"
13 DESCRIPTION="OpenFOAM - solvers"
14 HOMEPAGE="http://www.opencfd.co.uk/openfoam/"
15 SRC_URI="mirror://sourceforge/foam/${MY_P}.General.gtgz -> ${MY_P}.General.tgz
16 http://omploader.org/vMWRlMQ/${MY_PN}-git-${PVR}.patch
17 http://omploader.org/vMWRlMA/${MY_P}-svn.patch"
21 KEYWORDS="~amd64 ~x86"
24 RDEPEND="!=sci-libs/openfoam-${MY_PV}*
25 !=sci-libs/openfoam-bin-${MY_PV}*
26 =sci-libs/openfoam-kernel-${MY_PV}*"
31 INSDIR="/usr/$(get_libdir)/${MY_PN}/${MY_P}"
34 # just to be sure the right profile is selected (gcc-config)
35 if ! version_is_at_least 4.1 $(gcc-version) ; then
36 die "${PN} requires >=sys-devel/gcc-4.1 to compile."
41 epatch "${FILESDIR}"/${MY_P}-compile.patch
42 epatch "${DISTDIR}"/${MY_P}-svn.patch
43 epatch "${DISTDIR}"/${MY_PN}-git-${PVR}.patch
44 epatch "${FILESDIR}"/${MY_P}-ggi.patch
48 cp -a ${INSDIR}/etc/{bashrc,settings.sh} etc/. || "cannot copy bashrc"
50 # This is a hack, due to the meta ebuild:
51 sed -i -e "s|FOAM_LIB=\$WM_PROJECT_DIR/lib|FOAM_LIB=${INSDIR}/lib|" \
52 -e "s|FOAM_LIBBIN=\$FOAM_LIB|FOAM_LIBBIN=\$WM_PROJECT_DIR/lib|" \
53 -e "s|_foamAddLib \$FOAM_USER_LIBBIN|_foamAddLib \$FOAM_LIB|" \
54 etc/settings.sh || die "could not replace paths"
56 sed -i -e "s|-L\$(LIB_WM_OPTIONS_DIR)|-L\$(LIB_WM_OPTIONS_DIR) -L${INSDIR}/lib|" \
57 wmake/Makefile || die "could not replace search paths"
59 export FOAM_INST_DIR="${WORKDIR}"
62 cd applications/solvers
63 wmake all || die "could not build OpenFOAM utilities"
68 insinto ${INSDIR}/applications/bin
69 doins -r applications/bin/* || die "doins failed"
72 doins -r lib/* || die "doins failed"