summaryrefslogtreecommitdiff
blob: fe519312704e51325156ec9a025be25d2b740b83 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="1"
inherit eutils flag-o-matic autotools

DESCRIPTION="A collection of algorithms and sample code for various computer vision problems."
HOMEPAGE="http://www.intel.com/technology/computing/opencv/index.htm"
SRC_URI="mirror://sourceforge/${PN}library/${PN}-1.1pre1.tar.gz"

##If video for linux is enabled, add GPL-2, since it will need to use GPL-2
##stuff, same for v4l
LICENSE="v4l? ( GPL-2 ) xine? ( GPL-2 ) Intel"
SLOT="0"
KEYWORDS="amd64 ppc x86"
IUSE="debug demos ffmpeg gtk ieee1394 jpeg jpeg2k openexr png python tiff xine v4l zlib"

COMMON_DEPEND="ffmpeg? ( >=media-video/ffmpeg-0.4.9_p20080326 )
	gtk? ( x11-libs/gtk+:2 )
	ieee1394? ( >=sys-libs/libraw1394-1.2.0 media-libs/libdc1394:1 )
	jpeg? ( media-libs/jpeg )
	jpeg2k? ( media-libs/jasper )
	openexr? ( media-libs/openexr )
	png? ( media-libs/libpng:1.2 )
	python? ( >=dev-lang/python-2.3 >=dev-lang/swig-1.3.30 )
	tiff? ( media-libs/tiff )
	xine? ( media-libs/xine-lib )
	zlib? ( sys-libs/zlib )"

DEPEND="${COMMON_DEPEND}
	gtk? ( dev-util/pkgconfig )"
RDEPEND="${COMMON_DEPEND}"

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

src_unpack() {
	unpack ${A}
	cd "${S}"

	# remove the install-hook that runs ldconfig.
	sed -i '/install-hook:/,/^$/d' Makefile.am

	epatch "${FILESDIR}"/${P}-libtool.patch
	epatch "${FILESDIR}"/${P}-link.patch
	epatch "${FILESDIR}"/${P}-stereorectify.patch

	eautoreconf || die "eautoreconf failed"
}

src_compile() {
	use debug && filter-ldflags -O1 -Wl --enable-new-dtags -s
	filter-ldflags -L

	local myconf="--without-quicktime"
	use python && myconf="${myconf} --with-swig --with-python" \
	           || myconf="${myconf} --without-swig --without-python"

	econf \
		${myconf} \
		$(use_with gtk) \
		$(use_with xine) \
		$(use_with ffmpeg) \
		$(use_with ieee1394 1394libs) \
		$(use_with v4l) \
		$(use_enable debug) \
		$(use_enable demos apps)
	emake || die "Emake failed"
}

src_test() {
	emake check || die "Tests failed"
}

src_install() {
	emake DESTDIR="${D}" install || die "Install failed"
	dodoc AUTHORS ChangeLog README NEWS TODO
	insinto /usr/share/doc/${P}
	doins -r docs/
}