/[gentoo-x86]/sci-mathematics/octave/octave-2.1.73.ebuild
Gentoo

Contents of /sci-mathematics/octave/octave-2.1.73.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.14 - (show annotations) (download)
Thu Jun 24 17:12:17 2010 UTC (4 years, 3 months ago) by bicatali
Branch: MAIN
CVS Tags: HEAD
Changes since 1.13: +1 -1 lines
FILE REMOVED
Cleaning old versions
(Portage version: 2.2_rc67/cvs/Linux x86_64)

1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-mathematics/octave/octave-2.1.73.ebuild,v 1.13 2010/06/23 09:32:45 jlec Exp $
4
5 inherit flag-o-matic fortran
6
7 DESCRIPTION="GNU Octave is a high-level language (MatLab compatible) intended for numerical computations"
8 LICENSE="GPL-2"
9 HOMEPAGE="http://www.octave.org/"
10 SRC_URI="ftp://ftp.octave.org/pub/octave/bleeding-edge/${P}.tar.bz2
11 ftp://ftp.math.uni-hamburg.de/pub/soft/math/octave/${P}.tar.bz2"
12
13 SLOT="0"
14 IUSE="emacs static readline zlib doc hdf5 mpi blas"
15 KEYWORDS="alpha amd64 ppc ppc64 ~sparc x86"
16
17 DEPEND=">=sys-libs/ncurses-5.2-r3
18 >=sci-visualization/gnuplot-3.7.1-r3
19 >=sci-libs/fftw-2.1.3
20 >=dev-util/gperf-2.7.2
21 zlib? ( sys-libs/zlib )
22 hdf5? ( sci-libs/hdf5 )
23 doc? ( virtual/latex-base )
24 blas? ( virtual/blas )
25 mpi? ( virtual/mpi )
26 !=app-text/texi2html-1.70"
27 RDEPEND="${DEPEND}"
28 # NOTE: octave supports blas/lapack from intel but this is not open
29 # source nor is it free (as in beer OR speech) Check out...
30 # http://developer.intel.com/software/products/mkl/mkl52/index.htm for
31 # more information
32
33 src_unpack() {
34 unpack ${A}
35 cd "${S}"
36
37 epatch "${FILESDIR}"/${P}-gcc4.1-gentoo.patch
38 }
39
40 src_compile() {
41 filter-flags -ffast-math
42
43 local myconf="--localstatedir=/var/state/octave --enable-rpath"
44 myconf="${myconf} --enable-lite-kernel"
45 use static || myconf="${myconf} --disable-static --enable-shared --enable-dl"
46 # Only add -lz to LDFLAGS if we have zlib in USE !
47 # BUG #52604
48 # Danny van Dyk 2004/08/26
49 use zlib && append-ldflags -lz
50
51 # MPI requires the use of gcc/g++ wrappers
52 # mpicc/mpic++
53 # octave links agains -lmpi by default
54 # mpich needs -lmpich instead
55 if use mpi ; then
56 CC="mpicc"
57 if has_version 'sys-cluster/mpich' ; then
58 CXX="mpiCC"
59 myconf="${myconf} --with-mpi=mpich"
60 elif has_version 'sys-cluster/mpich2' ; then
61 if built_with_use sys-cluster/mpich2 cxx ; then
62 elog "mpich2 must be built without C++ support!"
63 die "please rebuild mpich2 with USE=-cxx..."
64 fi
65 F77="mpif77"
66 myconf="${myconf} --with-mpi=mpich"
67 else
68 myconf="${myconf} --with-mpi=mpi"
69 fi
70 else
71 CC="$(tc-getCC)"
72 CXX="$(tc-getCXX)"
73 myconf="${myconf} --without-mpi"
74 fi
75
76 CC="${CC}" CXX="${CXX}" F77="${F77}" \
77 econf \
78 $(use_with hdf5) \
79 $(use_enable readline) \
80 ${myconf} \
81 || die "econf failed"
82
83 emake || die "emake failed"
84 }
85
86 src_install() {
87 # needed to avoid possible sandbox violations by latex
88 export VARTEXFONTS="${T}/fonts"
89
90 make install DESTDIR="${D}" || die "make install failed"
91 if use doc; then
92 octave-install-doc || die "Octave doc install failed"
93 fi
94 if use emacs; then
95 cd emacs
96 exeinto /usr/bin
97 doexe otags || die
98 doman otags.1 || die
99 for emacsdir in /usr/share/emacs/site-lisp /usr/lib/xemacs/site-lisp; do
100 insinto ${emacsdir}
101 doins *.el || die
102 done
103 cd ..
104 fi
105 dodir /etc/env.d || die
106 echo "LDPATH=/usr/lib/octave-${PV}" > "${D}"/etc/env.d/99octave || die
107
108 # Fixes ls-R files to remove /var/tmp/portage references.
109 sed -i -e "s:${D}::g" "${D}"/usr/libexec/${PN}/ls-R || die
110 sed -i -e "s:${D}::g" "${D}"/usr/share/${PN}/ls-R || die
111 }
112
113 pkg_postinst() {
114 echo
115 einfo "Some users have reported failures at running simple tests if"
116 einfo "octave was built with agressive optimisations. You can check if"
117 einfo "your setup is affected by this bug by running the following test"
118 einfo "(inside the octave interpreter):"
119 einfo
120 einfo "octave:1> y = [1 3 4 2 1 5 3 5 6 7 4 5 7 10 11 3];"
121 einfo "octave:2> g = [1 1 1 1 1 1 1 1 2 2 2 2 2 3 3 3];"
122 einfo "octave:3> anova(y, g)"
123 einfo
124 einfo "If these commands complete successfully with no error message,"
125 einfo "your installation should be ok. Otherwise, try recompiling"
126 einfo "octave using less agressive \"CFLAGS\" (combining \"-O3\" and"
127 einfo "\"-march=pentium4\" is known to cause problems)."
128 echo
129 }
130
131 octave-install-doc() {
132 echo "Installing documentation..."
133 insinto /usr/share/doc/${PF}
134 doins doc/faq/Octave-FAQ.dvi || die
135 doins doc/interpreter/octave.dvi || die
136 doins doc/liboctave/liboctave.dvi || die
137 doins doc/refcard/refcard-a4.dvi || die
138 doins doc/refcard/refcard-legal.dvi || die
139 doins doc/refcard/refcard-letter.dvi || die
140 }

  ViewVC Help
Powered by ViewVC 1.1.20