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

name                xorg-libice
version             1.1.2
revision            0
categories          x11 devel
license             X11
maintainers         {jeremyhu @jeremyhu} openmaintainer
platforms           darwin macosx

description         X.org libice
long_description    X Inter-Client Exchange Protocol

homepage            https://www.x.org/
master_sites        xorg:individual/lib/
distname            libICE-${version}
use_xz              yes

checksums           rmd160 643d316df0c51a94364e9ffa3084405af74b6487 \
                    sha256 974e4ed414225eb3c716985df9709f4da8d22a67a2890066bc6dfc89ad298625 \
                    size   342900

depends_build       port:pkgconfig \
                    port:xorg-xtrans

depends_lib         port:xorg-xorgproto

configure.args \
    --without-xmlto \
    --without-fop \
    --disable-docs \
    --disable-specs

configure.checks.implicit_function_declaration.whitelist-append strchr

build.args V=1

# Depending on ghostscript for the PDF documentation creates a dependency
# loop, so you may want to install first without the docs variant
variant docs description "Install extra documentation" {
    depends_build-append \
        port:fop \
        port:xmlto

    depends_skip_archcheck-append \
        xmlto

    configure.args-delete \
        --without-xmlto \
        --without-fop \
        --disable-docs \
        --disable-specs

    configure.args-append \
        --with-xmlto \
        --with-fop \
        --enable-docs \
        --enable-specs

    configure.env-append \
        XMLTO=${prefix}/bin/xmlto \
        FOP=${prefix}/bin/fop
}

livecheck.type  regex
livecheck.url   https://xorg.freedesktop.org/archive/individual/lib/?C=M&O=D
livecheck.regex libICE-(\\d+(?:\\.\\d+)*)
