# -*- 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                glxinfo
set pkg_name        mesa-demos
version             8.5.0
categories          x11 graphics
license             MIT
maintainers         {jeremyhu @jeremyhu} openmaintainer
description         Show information about GLX capabilities
long_description    {*}${description}

homepage            https://www.mesa3d.org
master_sites        https://archive.mesa3d.org/demos/${version}
distname            ${pkg_name}-${version}
dist_subdir         ${pkg_name}

platforms           macosx darwin
use_bzip2           yes

checksums           rmd160  2e792b49b23a4ceb76d98a0b571d394ec97e1149 \
                    sha256  cea2df0a80f09a30f635c4eb1a672bf90c5ddee0b8e77f4d70041668ef71aac1 \
                    size    10367517

depends_lib         port:mesa

use_configure       no

variant universal   {}

build {
	system -W ${worksrcpath} "${configure.cc} ${configure.cppflags} ${configure.cflags} [get_canonical_archflags cc] -c ${worksrcpath}/src/xdemos/glinfo_common.c"
	system -W ${worksrcpath} "${configure.cc} ${configure.cppflags} ${configure.cflags} [get_canonical_archflags cc] -c ${worksrcpath}/src/xdemos/${name}.c"
	system -W ${worksrcpath} "${configure.cc} ${configure.ldflags} [get_canonical_archflags ld] ${name}.o glinfo_common.o -lGL -lX11 -o ${name}"
}

destroot {
	xinstall -m 755 "${worksrcpath}/${name}" "${destroot}${prefix}/bin"
}

livecheck.type      regex
livecheck.url       https://cgit.freedesktop.org/mesa/demos
livecheck.regex     ">${pkg_name}-(\[\\d.\]+)<"

