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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20