# -*- 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-xorgproto
version             2024.1
epoch               1
revision            0

checksums           rmd160  a1607253665108103a374e824ed8f7a5ab01725d \
                    sha256  372225fd40815b8423547f5d890c5debc72e88b91088fbfb13158c20495ccb59 \
                    size    760500

categories          x11 devel
license             X11
maintainers         {jeremyhu @jeremyhu} {jonesc @cjones051073} openmaintainer

homepage            https://www.x.org
platforms           {darwin any}
supported_archs     noarch

description         X.org xorgproto
long_description    X.Org combined prototype headers

master_sites        xorg:individual/proto/

distname            xorgproto-${version}

use_xz              yes

configure.args      --enable-legacy \
                    --without-xmlto \
                    --without-fop \
                    --disable-specs

post-destroot {
    # This is provided by xorg-libX11 as of 1.6.9 - it's legacy in
    # xorgproto now but we enable legacy for other reasons.
    delete ${destroot}${prefix}/include/X11/extensions/XKBgeom.h
}

# 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 \
        port:xorg-sgml-doctools

    configure.args-replace \
        --without-xmlto --with-xmlto \
        --without-fop --with-fop \
        --disable-specs --enable-specs

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

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