/[gentoo-x86]/sci-libs/openfoam/openfoam-2.1.1-r1.ebuild
Gentoo

Contents of /sci-libs/openfoam/openfoam-2.1.1-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Fri Feb 1 08:10:20 2013 UTC (17 months, 3 weeks ago) by patrick
Branch: MAIN
Fix for #402895

(Portage version: 2.2.0_alpha161/cvs/Linux x86_64, unsigned Manifest commit)

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-libs/openfoam/openfoam-2.1.1.ebuild,v 1.1 2012/06/19 02:21:17 patrick Exp $
4
5 EAPI="2"
6
7 inherit eutils versionator multilib toolchain-funcs
8
9 MY_PN="OpenFOAM"
10 MY_PV=$(get_version_component_range 1-2)
11 MY_P="${MY_PN}-${PV}"
12
13 DESCRIPTION="Open Field Operation and Manipulation - CFD Simulation Toolbox"
14 HOMEPAGE="http://www.openfoam.org"
15 SRC_URI="http://downloads.sourceforge.net/project/foam/foam/${PV}/${MY_P}.tgz"
16
17 LICENSE="GPL-2"
18 SLOT="2.1"
19 KEYWORDS="~amd64 ~x86"
20 IUSE="doc examples"
21
22 DEPEND="!=sci-libs/openfoam-bin-${MY_PV}*
23 !=sci-libs/openfoam-kernel-${MY_PV}*
24 !=sci-libs/openfoam-meta-${MY_PV}*
25 !=sci-libs/openfoam-solvers-${MY_PV}*
26 !=sci-libs/openfoam-utilities-${MY_PV}*
27 !=sci-libs/openfoam-wmake-${MY_PV}*
28 sci-libs/parmetis
29 sci-libs/parmgridgen
30 sci-libs/scotch
31 || ( >sci-visualization/paraview-3.0 sci-visualization/opendx )
32 virtual/mpi"
33 RDEPEND="${DEPEND}"
34
35 S=${WORKDIR}/${MY_P}
36 INSDIR="/usr/$(get_libdir)/${MY_PN}/${MY_P}"
37
38 pkg_setup() {
39 # just to be sure the right profile is selected (gcc-config)
40 if ! version_is_at_least 4.3 $(gcc-version) ; then
41 die "${PN} requires >=sys-devel/gcc-4.3 to compile."
42 fi
43
44 elog
45 elog "In order to use ${MY_PN} you should add the following line to ~/.bashrc :"
46 elog
47 elog "alias startOF$(delete_all_version_separators ${MY_PV})='source ${INSDIR}/etc/bashrc'"
48 elog
49 elog "And everytime you want to use OpenFOAM you have to execute startOF$(delete_all_version_separators ${MY_PV})"
50 ewarn
51 ewarn "FoamX is deprecated since ${MY_PN}-1.5! "
52 ewarn
53 }
54
55 src_configure() {
56 if has_version sys-cluster/mpich2 ; then
57 export WM_MPLIB=MPICH
58 elif has_version sys-cluster/openmpi ; then
59 export WM_MPLIB=OPENMPI
60 else
61 die "You need one of the following mpi implementations: openmpi or mpich2"
62 fi
63
64 sed -i -e "s|WM_MPLIB:=OPENMPI|WM_MPLIB:="${WM_MPLIB}"|" etc/bashrc
65 sed -i -e "s|setenv WM_MPLIB OPENMPI|setenv WM_MPLIB "${WM_MPLIB}"|" etc/cshrc
66 }
67
68 src_compile() {
69
70 WM_NCOMPPROCS=`echo $MAKEOPTS | sed 's/-j\([0-9][0-9]*\)/\1/'`
71 if [ -n "$WM_NCOMPPROCS" ] ; then
72 export WM_NCOMPPROCS
73 else
74 export WM_NCOMPPROCS=1
75 fi
76 elog "Building on $WM_NCOMPPROCS cores"
77
78 export FOAM_INST_DIR=${WORKDIR}
79 source etc/bashrc
80
81 find wmake -name dirToString | xargs rm -rf
82 find wmake -name wmkdep | xargs rm -rf
83
84 ./Allwmake || die "could not build"
85 }
86
87 src_test() {
88 cd bin
89 ./foamInstallationTest
90 }
91
92 src_install() {
93 insinto ${INSDIR}
94 doins -r etc
95
96 use examples && doins -r tutorials
97
98 # not sure if this is useful
99 #doins -r src
100
101 insinto ${INSDIR}/lib
102 doins -r lib/*
103
104 insopts -m0755
105 doins -r bin applications platforms wmake
106
107 dodoc README.html doc/Guides-a4/*.pdf
108
109 if use doc ; then
110 dohtml -r doc/Doxygen
111 fi
112 }

  ViewVC Help
Powered by ViewVC 1.1.20