# $Id: Portfile 66756 2010-04-22 04:18:46Z ryandesign@macports.org $

PortSystem                      1.0

name                            opencv
version                         2.0.0
revision                        1
categories                      graphics science
platforms                       darwin
maintainers                     gmail.com:stante

description                     Intel(R) Open Source Computer Vision Library

long_description                opencv is a library that is mainly aimed at real time \
                                computer vision. Some example areas would be \
                                Human-Computer Interaction (HCI), Object Identification, \
                                Segmentation and Recognition, Face Recognition, Gesture \
                                Recognition, Motion Tracking, Ego Motion, Motion \
                                Understanding, Structure From Motion (SFM), and Mobile \
                                Robotics.

homepage                        http://opencv.willowgarage.com/wiki/
master_sites                    sourceforge:opencvlibrary
use_bzip2                       yes
distname                        OpenCV-${version}

checksums                       md5     ed27520514baacc5edad7b06ad24130e \
                                sha1    2090c2aaff77c3b0cc669c2ee81bea389db0a366 \
                                rmd160  f46b993ded3d579dc52175131e5485476ac1f569

depends_build-append            port:pkgconfig

depends_lib-append              port:gtk2 port:zlib port:jpeg \
                                port:libpng port:tiff path:lib/libavcodec.dylib:ffmpeg

# ffmpeg is not universal.
# If universal support is to be added to opencv, careful consideration has
# to be given to the 64-bit issues with QuickTime and Carbon.
universal_variant               no

configure.args                  --without-python

switch ${build_arch} {
    ppc64 -
    x86_64 {
        configure.args-append   --without-quicktime \
                                --without-carbon
    }
    ppc {
        patchfiles-append       patch-G4.diff
    }
}

# For some reason the highgui module forgets to link against libavutil
configure.ldflags-append        -lavutil

post-destroot {
    xinstall -m 644 ${worksrcpath}/cvconfig.h ${destroot}${prefix}/include/${name}
}

livecheck.type                  regex
livecheck.url                   http://sourceforge.net/projects/opencvlibrary/files/
livecheck.regex                 {OpenCV-([0-9.]+)\.tar}
