summaryrefslogtreecommitdiff
blob: e53cf1ee5ad56e9565cd82c83a0eec04c9cb2f1a (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit eutils

DESCRIPTION="Gandalf - The Fast Computer Vision and Numerical Library"
HOMEPAGE="http://gandalf-library.sourceforge.net"
SRC_URI="mirror://sourceforge/gandalf-library/gandalf.1.6.tar.gz"

LICENSE="LGPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="doc lapack jpeg png tiff opengl glut"

RDEPEND="
	lapack? ( virtual/lapack )
	jpeg? ( media-libs/jpeg )
	png? ( media-libs/libpng )
	tiff? ( media-libs/tiff )
	opengl? ( glut? ( media-libs/freeglut ) )
"
DEPEND="${RDEPEND}
	sys-devel/libtool
	doc? ( app-doc/doxygen )
"

S="${WORKDIR}/${PN}"

src_unpack() {
	unpack ${A}
	cd "${S}"
	epatch "${FILESDIR}/${P}-destdir.patch"
}

src_compile() {
	econf \
		$(use_with lapack) \
		$(use_with jpeg) \
		$(use_with png) \
		$(use_with tiff) \
		$(use_with opengl) \
		$(use_with glut) \
		|| die "econf failed"
	emake || die "emake failed"
}

src_install() {
	emake DESTDIR="${D}" install || die "emake install failed"
	dodoc CHANGELOG README
	if use doc; then
		cd "${S}"
		emake docsource || die "doc generation failed"
		doxygen doxyfile
		./postprocess
		dohtml -r doc/reference/*
	fi
}