summaryrefslogtreecommitdiff
blob: 7c5638148643e3d808b713dce386e0e16c71ce39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sci-libs/nlopt/nlopt-1.2.ebuild,v 1.2 2009/11/24 13:52:00 markusle Exp $

EAPI=2
inherit eutils

DESCRIPTION="Non-linear optimization library"
SRC_URI="http://ab-initio.mit.edu/nlopt/${P}.tar.gz"
HOMEPAGE="http://ab-initio.mit.edu/nlopt/"

LICENSE="LGPL-2.1 MIT"
KEYWORDS="~amd64 ~x86"

SLOT="0"
IUSE="octave cxx"

DEPEND="octave? ( sci-mathematics/octave )"
RDEPEND="${DEPEND}"

src_configure() {
	if use octave; then
		export OCT_INSTALL_DIR=/usr/libexec/octave/site/oct/${CHOST}
		export M_INSTALL_DIR=/usr/share/octave/site/m
	else
		export MKOCTFILE=None
	fi
	econf \
		--enable-shared \
		$(use_with cxx) \
		$(use_with octave)
}

src_install() {
	emake DESTDIR="${D}" install || die "emake install failed"
	dodoc AUTHORS ChangeLog NEWS README
	for r in */README; do newdoc ${r} README.$(dirname ${r}); done
}