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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Tue Jun 19 02:21:17 2012 UTC (2 years ago) by patrick
Branch: MAIN
Bump

(Portage version: 2.2.0_alpha110/cvs/Linux x86_64)

1 # Copyright 1999-2012 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.0.ebuild,v 1.1 2011/12/30 05:15:50 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 insopts -m0755
99 doins -r bin
100
101 insinto ${INSDIR}/applications/bin
102 doins -r applications/bin/*
103
104 insinto ${INSDIR}/lib
105 doins -r lib/*
106
107 insinto ${INSDIR}/wmake
108 doins -r wmake/*
109
110 dodoc {doc/Guides-a4/*.pdf,README}
111
112 if use doc ; then
113 dohtml -r doc/Doxygen
114 fi
115 }

  ViewVC Help
Powered by ViewVC 1.1.20