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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20