| 1 |
# Copyright 1999-2006 Gentoo Foundation |
| 2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/octave-forge/octave-forge-2004.11.16-r1.ebuild,v 1.6 2007/07/13 05:28:09 mr_bones_ Exp $ |
| 4 |
|
| 5 |
inherit eutils |
| 6 |
|
| 7 |
DESCRIPTION="A collection of custom scripts, functions and extensions for GNU Octave" |
| 8 |
HOMEPAGE="http://octave.sourceforge.net/" |
| 9 |
SRC_URI="mirror://sourceforge/octave/${P}.tar.gz" |
| 10 |
|
| 11 |
LICENSE="as-is" |
| 12 |
KEYWORDS="~x86 ~ppc ~sparc ~amd64" |
| 13 |
SLOT="0" |
| 14 |
IUSE="ginac qhull" |
| 15 |
|
| 16 |
DEPEND=">=sci-mathematics/octave-2.1.62 |
| 17 |
>=sys-apps/sed-4 |
| 18 |
sys-libs/libtermcap-compat |
| 19 |
!amd64? ( ginac? ( sci-mathematics/ginac ) ) |
| 20 |
qhull? ( >=media-libs/qhull-3.1-r1 )" |
| 21 |
|
| 22 |
src_unpack() { |
| 23 |
unpack ${A} |
| 24 |
cd ${S} |
| 25 |
epatch ${FILESDIR}/${PN}-mex.patch |
| 26 |
|
| 27 |
# make it compile when X isn't installed. The source file there really |
| 28 |
# doesn't need X at all. |
| 29 |
# 02 Feb 2005, Robin H. Johnson <robbat2@gentoo.org> |
| 30 |
sed -e '/#include <X11/d' -i ${S}/main/audio/aurecord.cc |
| 31 |
} |
| 32 |
|
| 33 |
src_compile() { |
| 34 |
econf || die "econf failed" |
| 35 |
|
| 36 |
# this must be done before the *PATH variables are changed |
| 37 |
cd extra/graceplot && make grace_octave_path.m |
| 38 |
cd ${S} |
| 39 |
|
| 40 |
# The *PATH variables need to be changed, or they will |
| 41 |
# cause Portage access violations. They cannot be easily set just using |
| 42 |
# arguments passed to ./configure (at least, they can not easily be set |
| 43 |
# correctly) |
| 44 |
echo -en "Modifying paths..." |
| 45 |
for path in M O X ALTM ALTO; do |
| 46 |
sed -i "s|^\(${path}PATH = \)|\1${D}|" Makeconf || \ |
| 47 |
die "failed to modify ${path}PATH" |
| 48 |
done |
| 49 |
echo -e "done.\n" |
| 50 |
|
| 51 |
emake || die "emake failed" |
| 52 |
} |
| 53 |
|
| 54 |
src_install() { |
| 55 |
make DESTDIR="${D}" install || die "install failed" |
| 56 |
|
| 57 |
# strip the fudged install paths |
| 58 |
sed -i "s|${D}||g" ${D}/usr/bin/mex || die "sed failed" |
| 59 |
|
| 60 |
dodoc AUTHORS COPYING* ChangeLog INDEX RELEASE-NOTES TODO |
| 61 |
} |
| 62 |
|
| 63 |
pkg_postinst() { |
| 64 |
einfo "If you do not have GiNaC and Qhull installed, octave-forge did not" |
| 65 |
einfo "compile itself with support for the geometry and symbolic math" |
| 66 |
einfo "extensions. If you would like these features, please emerge ginac" |
| 67 |
einfo "and/or qhull and then re-emerge octave-forge. Alternately, you can" |
| 68 |
einfo "specify USE='ginac qhull' and re-emerge octave-forge; in that case" |
| 69 |
einfo "the ebuild will automatically install the additional packages." |
| 70 |
} |