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 - utilities"
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-solvers-${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
46 chmod +x applications/utilities/postProcessing/graphics/ensightFoamReader/Allwmake
50 cp -a ${INSDIR}/etc/{bashrc,settings.sh} "${S}"/etc/. || die "cannot copy bashrc"
52 # This is a hack, due to the meta ebuild:
53 sed -i -e "s|FOAM_LIB=\$WM_PROJECT_DIR/lib|FOAM_LIB=${INSDIR}/lib|" \
54 -e "s|FOAM_LIBBIN=\$FOAM_LIB|FOAM_LIBBIN=\$WM_PROJECT_DIR/lib|" \
55 -e "s|_foamAddLib \$FOAM_USER_LIBBIN|_foamAddLib \$FOAM_LIB|" \
56 etc/settings.sh || die "could not replace paths"
58 sed -i -e "s|-L\$(LIB_WM_OPTIONS_DIR)|-L\$(LIB_WM_OPTIONS_DIR) -L${INSDIR}/lib|" \
59 wmake/Makefile || die "could not replace search paths"
61 sed -i -e "s|(FOAM_LIBBIN)|(FOAM_LIB)|" applications/utilities/postProcessing/velocityField/{flowType,Pe,uprime,vorticity,enstrophy,Q,Co,Lambda2,Mach}/Make/options || die "cannot change LIB dir"
62 sed -i -e "s|(FOAM_LIBBIN)|(FOAM_LIB)|" applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/Make/options || die "cannot change LIB dir"
64 export FOAM_INST_DIR="${WORKDIR}"
67 cd applications/utilities
68 wmake all || die "could not build OpenFOAM utilities"
73 insinto ${INSDIR}/applications/bin
74 doins -r applications/bin/*