# -*- 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 57731 2009-09-15 19:37:18Z devans@macports.org $

PortSystem 1.0

name            gimp
version         2.6.7
set branch      [join [lrange [split ${version} .] 0 1] .]
categories      graphics
maintainers     devans
homepage        http://www.gimp.org/
platforms       darwin

description     The Gimp - Batteries Included
long_description \
    "This is a META port for the gimp2 which includes help and documentation, \
        support for icns, jp2000 and RAW formats, content-aware rescaling \
        Gutenprint and scanner frontends and even a nice theme (Nodoka). \
    Mac OS X users also get a Gimp.app bundle, a \"Show in Finder\" menu \
        and clipboard integration."

depends_lib     port:icns-gimp \
                port:gimp-jp2 \
                port:gimp-lqr-plugin \
                port:gtk-nodoka-engine \
                port:gutenprint \
                port:ufraw \
                port:xsane

platform macosx {
    depends_lib-append  port:gimp-app
    #
    # these use the deprecated QuickDraw API that is no longer
    # supported on snow leopard #21391
    #
    if { "darwin" == ${os.platform} && 10 > ${os.major} } {
        depends_lib-append  port:macclipboard-gimp \
                            port:macfile-gimp
    }
}

distfiles
master_sites
use_bzip2       yes
use_configure   no
build           {}

destroot {
    xinstall -d ${destroot}${prefix}/share/gimp/2.0/themes/Nodoka
    system "cd ${destroot}${prefix}/share/gimp/2.0/themes/Nodoka &&
        ln -s ${prefix}/share/themes/Nodoka/gtk-2.0/gtkrc"
}

variant animation description "Include the Gimp Animation Package (gimp-gap)." {
    depends_lib-append  path:lib/gimp/2.0/plug-ins/gap_plugins:gimp-gap
}

variant manual description {Include the help files.} {
    depends_lib-append  port:gimp-user-manual
}

livecheck.type  regex
livecheck.url   ftp://ftp.gimp.org/pub/gimp/v${branch}/
livecheck.regex "gimp-(${branch}(?:\\.\\d+)*)${extract.suffix}"
