media-video/motiontrack: Fix building with GCC 5
[gentoo.git] / media-video / motiontrack / motiontrack-0.1.3.ebuild
1 # Copyright 1999-2007 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 DESCRIPTION="A set of tools that detect motion between two images"
6 SRC_URI="http://gemia.de/motion/${P}.tar.gz"
7 HOMEPAGE="http://motiontrack.sourceforge.net"
8
9 SLOT="0"
10 LICENSE="GPL-2"
11 KEYWORDS="~x86 ~ppc ~ppc64 ~sparc ~mips ~alpha ~hppa ~amd64"
12
13 IUSE="gd imagemagick debug multiprocess"
14
15 DEPEND="debug? (
16                 gd? (
17                         imagemagick? ( >=media-gfx/imagemagick-5.5.7 )
18                         !imagemagick? ( media-libs/gd )
19                 )
20                 !gd? ( >=media-gfx/imagemagick-5.5.7 )
21         )
22         !debug? (
23                 imagemagick? (
24                         gd? ( media-libs/gd )
25                         !gd? ( >=media-gfx/imagemagick-5.5.7 )
26                 )
27                 !imagemagick? ( media-libs/gd )
28         )"
29
30 src_compile() {
31
32         local myconf
33
34         if use gd; then
35                 if use imagemagick; then
36                         elog "motiontrack can only use one of libgd or imagemagick, not both."
37                         elog "default is libgd when debug is unset, imagemagick otherwise."
38                         elog "please unset one of these use flags if you have other intentions."
39                 fi
40         fi
41         if use debug; then
42                 #default to imagemagick for providing better features
43                 #for debugging
44                 myconf="--enable-debug"
45                 if use gd; then
46                         if use imagemagick; then
47                                 myconf="${myconf} --enable-magick --disable-gd";
48                         else
49                                 myconf="${myconf} --disable-magick --enable-gd";
50                         fi
51                 else
52                         myconf="${myconf} --enable-magick --disable-gd";
53                 fi
54         else
55                 #default to libgd for being faster
56                 myconf="--disable-debug"
57                 if use imagemagick; then
58                         if use gd; then
59                                 myconf="${myconf} --disable-magick --enable-gd";
60                         else
61                                 myconf="${myconf} --enable-magick --disable-gd";
62                 fi
63                 else
64                         myconf="${myconf} --disable-magick --enable-gd";
65                 fi
66         fi
67
68         econf $myconf \
69         $(use_enable multiprocess cluster) \
70         || die "configure failed"
71         emake || die "make failed"
72
73 }
74
75 src_install() {
76         make DESTDIR="${D}" install || die "install failed"
77         dodoc README src/TheCode.txt
78 }