# $Id: Portfile 102943 2013-02-11 02:46:38Z jeremyhu@macports.org $

PortSystem 1.0

name            enblend
version         4.0
revision        7
categories      graphics
maintainers     gmail.com:hvdwolf
license         GPL-2+

description     a tool to composite images
long_description    Enblend is a tool to composite overlapping images \
                with invisible (or very difficult to see) seams. Enfuse is a \
                tool for automatic exposure and contrast blending.
homepage        http://enblend.sourceforge.net/
platforms       darwin
master_sites    sourceforge:project/enblend/enblend-enfuse/enblend-enfuse-${version}
distname        enblend-enfuse-${version}
worksrcdir      ${distname}-753b534c819d
checksums       md5     2e7c950061e0085fd75d94576130250f \
                sha1    34c3a5ce11c6ef0ef520d8a15a3cb6a94a567033 \
                rmd160  9e531b5bf6f7258ef8778c01b456979e0bc04338

depends_build   port:pkgconfig

depends_lib     port:boost \
                port:jpeg \
                port:lcms \
                port:libpng \
                port:libxmi \
                port:mesa \
                port:openexr \
                port:freefont-ttf

patchfiles      patch-libpng15.diff src__vigra_impex__Makefile.am.diff \
                patch-configure.in.diff patch-filenameparse.cc.diff
# need to regenerate a Makefile.in after patching Makefile.am above
use_autoreconf  yes
configure.args  --mandir=${prefix}/share/man \
                --enable-image-cache=yes \
                --enable-split-doc=no

# TODO: Project has buggy C++ code
# https://trac.macports.org/ticket/31762
compiler.blacklist clang

# The build uses vast amounts of memory per job.
use_parallel_build  no

post-destroot {
    xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath} AUTHORS ChangeLog COPYING \
        NEWS README VIGRA_LICENSE \
        ${destroot}${prefix}/share/doc/${name}
}

platform macosx {
    depends_lib-delete port:mesa
    depends_lib-append port:glew
    configure.args-append --with-apple-opengl-framework --with-glew
}

livecheck.regex   /enblend-enfuse-(\[0-9.\]+)${extract.suffix}
