| 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.69.ebuild,v 1.15 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 |
HOMEPAGE="http://www.octave.org/"
|
| 9 |
SRC_URI="ftp://ftp.octave.org/pub/octave/bleeding-edge/${P}.tar.bz2
|
| 10 |
ftp://ftp.math.uni-hamburg.de/pub/soft/math/octave/${P}.tar.bz2"
|
| 11 |
|
| 12 |
LICENSE="GPL-2"
|
| 13 |
SLOT="0"
|
| 14 |
KEYWORDS="alpha amd64 ppc ~sparc x86"
|
| 15 |
IUSE="emacs static readline zlib latex hdf5 mpi blas"
|
| 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 |
latex? ( virtual/latex-base )
|
| 24 |
blas? ( virtual/blas )
|
| 25 |
mpi? ( sys-cluster/lam-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 |
FORTRAN="gfortran g77 ifc"
|
| 34 |
|
| 35 |
src_compile() {
|
| 36 |
filter-flags -ffast-math
|
| 37 |
|
| 38 |
local myconf="--localstatedir=/var/state/octave --enable-rpath"
|
| 39 |
myconf="${myconf} --enable-lite-kernel"
|
| 40 |
use static || myconf="${myconf} --disable-static --enable-shared --enable-dl"
|
| 41 |
# Only add -lz to LDFLAGS if we have zlib in USE !
|
| 42 |
# BUG #52604
|
| 43 |
# Danny van Dyk 2004/08/26
|
| 44 |
use zlib && LDFLAGS="${LDFLAGS} -lz"
|
| 45 |
|
| 46 |
if use mpi; then
|
| 47 |
myconf="${myconf} --with-mpi=lammpi++"
|
| 48 |
else
|
| 49 |
myconf="${myconf} --without-mpi"
|
| 50 |
fi
|
| 51 |
|
| 52 |
econf \
|
| 53 |
$(use_with hdf5) \
|
| 54 |
$(use_enable readline) \
|
| 55 |
${myconf} \
|
| 56 |
LDFLAGS="${LDFLAGS}" || die "econf failed"
|
| 57 |
|
| 58 |
emake || die "emake failed"
|
| 59 |
}
|
| 60 |
|
| 61 |
src_install() {
|
| 62 |
make install DESTDIR="${D}" || die "make install failed"
|
| 63 |
use latex && octave-install-doc
|
| 64 |
if use emacs; then
|
| 65 |
cd emacs
|
| 66 |
exeinto /usr/bin
|
| 67 |
doexe otags
|
| 68 |
doman otags.1
|
| 69 |
for emacsdir in /usr/share/emacs/site-lisp /usr/lib/xemacs/site-lisp; do
|
| 70 |
insinto ${emacsdir}
|
| 71 |
doins *.el
|
| 72 |
done
|
| 73 |
cd ..
|
| 74 |
fi
|
| 75 |
dodir /etc/env.d
|
| 76 |
echo "LDPATH=/usr/lib/octave-${PV}" > "${D}"/etc/env.d/99octave
|
| 77 |
|
| 78 |
# Fixes ls-R files to remove /var/tmp/portage references.
|
| 79 |
sed -i -e "s:${D}::g" "${D}"/usr/libexec/${PN}/ls-R || die
|
| 80 |
sed -i -e "s:${D}::g" "${D}"/usr/share/${PN}/ls-R || die
|
| 81 |
}
|
| 82 |
|
| 83 |
pkg_postinst() {
|
| 84 |
echo
|
| 85 |
einfo "Some users have reported failures at running simple tests if"
|
| 86 |
einfo "octave was built with agressive optimisations. You can check if"
|
| 87 |
einfo "your setup is affected by this bug by running the following test"
|
| 88 |
einfo "(inside the octave interpreter):"
|
| 89 |
einfo
|
| 90 |
einfo "octave:1> y = [1 3 4 2 1 5 3 5 6 7 4 5 7 10 11 3];"
|
| 91 |
einfo "octave:2> g = [1 1 1 1 1 1 1 1 2 2 2 2 2 3 3 3];"
|
| 92 |
einfo "octave:3> anova(y, g)"
|
| 93 |
einfo
|
| 94 |
einfo "If these commands complete successfully with no error message,"
|
| 95 |
einfo "your installation should be ok. Otherwise, try recompiling"
|
| 96 |
einfo "octave using less agressive \"CFLAGS\" (combining \"-O3\" and"
|
| 97 |
einfo "\"-march=pentium4\" is known to cause problems)."
|
| 98 |
echo
|
| 99 |
}
|
| 100 |
|
| 101 |
octave-install-doc() {
|
| 102 |
echo "Installing documentation..."
|
| 103 |
insinto /usr/share/doc/${PF}
|
| 104 |
doins doc/faq/Octave-FAQ.dvi
|
| 105 |
doins doc/interpreter/octave.dvi
|
| 106 |
doins doc/liboctave/liboctave.dvi
|
| 107 |
doins doc/refcard/refcard-a4.dvi
|
| 108 |
doins doc/refcard/refcard-legal.dvi
|
| 109 |
doins doc/refcard/refcard-letter.dvi
|
| 110 |
}
|