# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: Open Computer Vision Library $ inherit eutils flag-o-matic autotools DESCRIPTION="Open Source Computer Vision Library" HOMEPAGE="http://www.intel.com/technology/computing/opencv/index.htm" SRC_URI="mirror://sourceforge/${PN}library/${P}.tar.gz" ##If video for linux is enabled, add GPL-2, since it will need to use GPL-2 ##stuff, same for v4l LICENSE="BSD/intel v4l? ( GPL-2 ) xine? ( GPL-2 )" KEYWORDS="~x86" SLOT="0" IUSE="gtk xine ffmpeg ieee1394 v4l python jpeg jpeg2k zlib png tiff openexr debug apps examples demos" RESTRICT="mirror" DEPEND="gtk? (>=x11-libs/gtk+-2.0.0) python? (dev-lang/python dev-lang/swig) zlib? (sys-libs/zlib) ffmpeg? (>=media-video/ffmpeg-0.4.9_p20080326) ieee1394? (media-libs/libdc1394 sys-libs/libraw1394) xine? (media-libs/xine-lib) jpeg? (media-libs/jpeg) jpeg2k? (media-libs/jasper) png? (media-libs/libpng) tiff? (media-libs/tiff) openexr? (media-libs/openexr)" ALLOWED_FLAGS="-Wall -fno-rtti -pipe -march=i686 -ffast-math -fomit-frame-pointer -O2" src_unpack() { unpack ${A} cd ${S} # remove the install-hook that runs ldconfig. sed -i '/install-hook:/,/^$/d' Makefile.am epatch "${FILESDIR}"/opencv-1.0.0.patch AT_M4DIR="autotools/aclocal" eautoreconf || die "eautoreconf failed" } src_compile() { strip-flags filter-flags -O* if use debug; then filter-ldflags -O2 -Wl filter-ldflags --enable-new-dtags -Wl filter-ldflags --sort-common -s filter-ldflags -Wl filter-ldflags -O2 fi local myconf if use python; then myconf="${myconf} --with-swig --with-python" fi local myconf econf \ ${myconf} \ $(use_enable examples samples) \ $(use_enable demos apps) \ $(use_with gtk) \ $(use_with xine) \ $(use_with ffmpeg) \ $(use_with ieee1394 1394libs) \ $(use_with v4l) \ $(use_with v4l v4l2) \ $(use_enable debug) \ $(use_enable zlib) \ $(use_enable jpeg) \ $(use_enable png) \ $(use_enable openexr) \ $(use_enable tiff) \ $(use_enable jpeg2k jasper) || die "econf failed" emake || die "emake failed" } src_install() { make install DESTDIR=${D} || die "make install failed" dodoc AUTHORS ChangeLog README NEWS TODO insinto /usr/share/doc/${P} doins -r docs/ }