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

name                gutenprint
version             5.3.5
revision            0

categories          print
license             GPL-2+
maintainers         {mascguy @mascguy} openmaintainer
description         Gutenprint print plugin for GIMP
long_description    ${description}
homepage            https://gimp-print.sourceforge.io

universal_variant   no
set branch          [join [lrange [split ${version} .] 0 1] .]

master_sites        sourceforge:gimp-print \
                    https://ftp.osuosl.org/pub/blfs/conglomeration/gutenprint/

use_xz              yes

checksums           rmd160  ea6cb5b2dd7acea9e26532c04e6066682d0a8086 \
                    sha256  f5a9f47de28530b1ae2069cfbc647a9a641baeeabe809bb0ef2b3ec5b9668d70 \
                    size    5667532

depends_build-append \
                    path:bin/pkg-config:pkgconfig

depends_lib-append \
                    path:lib/pkgconfig/gimp-2.0.pc:gimp2 \
                    path:lib/pkgconfig/gtk+-2.0.pc:gtk2

# blacklist old compilers that do not support gcc diagnostic pragmas in functions
# addresses 10.6 and possibly earlier
compiler.blacklist-append \
                    *gcc-3.* *gcc-4.* {clang < 300}

configure.env-append \
                    PKG_CONFIG=${prefix}/bin/pkg-config
configure.perl      /usr/bin/perl

configure.args-append \
                    --disable-escputil \
                    --disable-samples \
                    --disable-silent-rules \
                    --disable-test \
                    --without-cups \
                    --without-readline \
                    --with-gimp2-as-gutenprint

variant quartz {}

if {[variant_isset quartz]} {
    require_active_variants gimp2 quartz
} else {
    require_active_variants gimp2 "" quartz
}

notes "
    * This port only installs the Gutenprint plugin for GIMP.
    * You can get the complete Gutenprint drivers and utilities - except the gimp plugin - from:
      ${homepage}
"

livecheck.type      regex
livecheck.url       ${homepage}
livecheck.regex     >Gutenprint (\[0-9.\]+) is \.*!<
