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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (show annotations) (download)
Tue May 4 23:40:04 2010 UTC (4 years, 2 months ago) by bicatali
Branch: MAIN
CVS Tags: HEAD
Changes since 1.14: +1 -1 lines
FILE REMOVED
Fixed some fltk automagic
(Portage version: 2.2_rc67/cvs/Linux x86_64)

1 # Copyright 1999-2009 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.72.ebuild,v 1.14 2009/09/23 20:11:50 patrick 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
29 # NOTE: octave supports blas/lapack from intel but this is not open
30 # source nor is it free (as in beer OR speech) Check out...
31 # http://developer.intel.com/software/products/mkl/mkl52/index.htm for
32 # more information
33
34 src_unpack() {
35 unpack ${A}
36 cd "${S}"
37
38 epatch "${FILESDIR}"/octave-2.1.72-gcc4.1-gentoo.patch
39 }
40
41 src_compile() {
42 filter-flags -ffast-math
43
44 local myconf="--localstatedir=/var/state/octave --enable-rpath"
45 myconf="${myconf} --enable-lite-kernel"
46 use static || myconf="${myconf} --disable-static --enable-shared --enable-dl"
47 # Only add -lz to LDFLAGS if we have zlib in USE !
48 # BUG #52604
49 # Danny van Dyk 2004/08/26
50 use zlib && append-ldflags -lz
51
52 # MPI requires the use of gcc/g++ wrappers
53 # mpicc/mpic++
54 # octave links agains -lmpi by default
55 # mpich needs -lmpich instead
56 if use mpi; then
57 CC="mpicc" && CXX="mpiCC"
58 if has_version 'sys-cluster/mpich'; then
59 myconf="${myconf} --with-mpi=mpich"
60 else
61 myconf="${myconf} --with-mpi=mpi"
62 fi
63 else
64 CC="$(tc-getCC)"
65 CXX="$(tc-getCXX)"
66 myconf="${myconf} --without-mpi"
67 fi
68
69 CC="${CC}" CXX="${CXX}" \
70 econf \
71 $(use_with hdf5) \
72 $(use_enable readline) \
73 ${myconf} \
74 || die "econf failed"
75
76 emake || die "emake failed"
77 }
78
79 src_install() {
80 make install DESTDIR="${D}" || die "make install failed"
81 if use doc; then
82 octave-install-doc || die "Octave doc install failed"
83 fi
84 if use emacs; then
85 cd emacs
86 exeinto /usr/bin
87 doexe otags || die
88 doman otags.1 || die
89 for emacsdir in /usr/share/emacs/site-lisp /usr/lib/xemacs/site-lisp; do
90 insinto ${emacsdir}
91 doins *.el || die
92 done
93 cd ..
94 fi
95 dodir /etc/env.d || die
96 echo "LDPATH=/usr/lib/octave-${PV}" > "${D}"/etc/env.d/99octave || die
97
98 # Fixes ls-R files to remove /var/tmp/portage references.
99 sed -i -e "s:${D}::g" "${D}"/usr/libexec/${PN}/ls-R || die
100 sed -i -e "s:${D}::g" "${D}"/usr/share/${PN}/ls-R || die
101 }
102
103 pkg_postinst() {
104 echo
105 einfo "Some users have reported failures at running simple tests if"
106 einfo "octave was built with agressive optimisations. You can check if"
107 einfo "your setup is affected by this bug by running the following test"
108 einfo "(inside the octave interpreter):"
109 einfo
110 einfo "octave:1> y = [1 3 4 2 1 5 3 5 6 7 4 5 7 10 11 3];"
111 einfo "octave:2> g = [1 1 1 1 1 1 1 1 2 2 2 2 2 3 3 3];"
112 einfo "octave:3> anova(y, g)"
113 einfo
114 einfo "If these commands complete successfully with no error message,"
115 einfo "your installation should be ok. Otherwise, try recompiling"
116 einfo "octave using less agressive \"CFLAGS\" (combining \"-O3\" and"
117 einfo "\"-march=pentium4\" is known to cause problems)."
118 echo
119 }
120
121 octave-install-doc() {
122 echo "Installing documentation..."
123 insinto /usr/share/doc/${PF}
124 doins doc/faq/Octave-FAQ.dvi || die
125 doins doc/interpreter/octave.dvi || die
126 doins doc/liboctave/liboctave.dvi || die
127 doins doc/refcard/refcard-a4.dvi || die
128 doins doc/refcard/refcard-legal.dvi || die
129 doins doc/refcard/refcard-letter.dvi || die
130 }

  ViewVC Help
Powered by ViewVC 1.1.20