# -*- 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

PortSystem      1.0
PortGroup       stub 1.0

name            gimp
version         2.10.38
revision        0

categories      graphics
maintainers     {mascguy @mascguy}

description     GIMP - Batteries Included
long_description \
                This is a META port for the GNU Image Manipulation Program, GIMP,  \
                which includes support for JP2000 and RAW formats, \
                content-aware rescaling, Gutenprint and scanner frontends and, \
                optionally, an animation tool, the GIMP Animation Package, \
                and an image processing and scientific visualization tool, \
                GREYCs Magic Image Converter.
homepage        https://gimp.org/

set branch      [join [lrange [split ${version} .] 0 1] .]
use_bzip2       yes

# Leaf port, not intended to be used as a lib dep
supported_archs noarch
platforms       any

depends_lib-append \
                port:gimp-lqr-plugin \
                port:gutenprint

platform macosx {
    depends_lib-append \
                port:gimp2-launcher
}

# gmic requires X11

variant gmic conflicts quartz description "Include GREYC's Magic Image Converter (G'MIC)." {
    depends_lib-append  port:gmic-gimp
}

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

variant quartz conflicts gmic {}

# xsane requires X11

if {![variant_isset quartz]} {
    depends_lib-append  port:xsane
}

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