# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 87563 2011-11-25 19:56:00Z devans@macports.org $

PortSystem      1.0

name            gegl
version         0.1.8
revision        1
license         {GPL-3+ LGPL-3+}
set branch      [join [lrange [split ${version} .] 0 1] .]
categories      graphics
maintainers     devans
platforms       darwin
homepage        http://gegl.org/
master_sites    gimp:${name}/${branch}/

use_bzip2       yes

description \
    GEGL is a graph based image processing framework.

long_description \
    GEGL is a graph based image processing framework offering image processing and \
    compositing on large images. GEGL is suitable for projects ranging from small \
    one-off projects to interactive applications.

universal_variant  no

checksums       sha1    3d4d902580f5c5122b01b5188b6b5da03089ecac \
                rmd160  5ebd7663285a57205661868452e650ba41b9df7f

depends_build \
    port:pkgconfig \
    port:w3m

depends_lib \
    port:babl \
    port:gtk2 \
    port:lua \
    port:openexr \
    port:libopenraw \
    port:librsvg \
    path:lib/pkgconfig/sdl.pc:libsdl \
    path:lib/libavcodec.dylib:ffmpeg \
    port:libspiro \
    port:lensfun

patchfiles     patch-configure.diff

configure.args  --disable-docs \
                --enable-introspection=no \
                --without-graphviz \
                --without-vala \
                --without-umfpack

# disable parallel build, see #31498

use_parallel_build no

platform darwin {
    if {$build_arch == "x86_64"} {
        configure.args-append --build=${build_arch}-apple-${os.platform}${os.version}
    }
}

variant html_doc description {Build html docs with enscript and asciidoc} {
    depends_build-append port:asciidoc
    configure.args-delete --disable-docs
    configure.args-append --enable-docs
}

variant workshop description {Enable build of workshop operations} {
    configure.args-append --enable-workshop
}

variant graphviz description {Build with graphviz support} {
    depends_lib-append    path:bin/dot:graphviz
    configure.args-delete --without-graphviz
}

variant vala description {Enable Vala bindings} {
    depends_lib-append    port:vala
    configure.args-delete --without-vala
}

variant python25 conflicts python26 python27 description {Build using Python 2.5} {
    configure.python          ${prefix}/bin/python2.5
    depends_build-append      port:python25
}

variant python26 conflicts python25 python27 description {Build using Python 2.6} {
    configure.python          ${prefix}/bin/python2.6
    depends_build-append      port:python26
}

variant python27 conflicts python25 python26 description {Build using Python 2.7} {
    configure.python          ${prefix}/bin/python2.7
    depends_build-append      port:python27
}

if {![variant_isset python25] && ![variant_isset python26]} {
    default_variants +python27
}

livecheck.type  regex
livecheck.url   http://ftp.iut-bm.univ-fcomte.fr/gimp/${name}/${branch}/
livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
