# -*- 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                glxgears
set pkg_name        mesa-demos
version             9.0.0
revision            0

checksums           rmd160  baddc302aea6def9e02fae8d0e5a77a4eb52b184 \
                    sha256  3046a3d26a7b051af7ebdd257a5f23bfeb160cad6ed952329cdff1e9f1ed496b \
                    size    14839368

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
distname            ${pkg_name}-${version}
dist_subdir         ${pkg_name}

platforms           macosx darwin
use_xz              yes

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/${name}.c"
	system -W ${worksrcpath} "${configure.cc} ${configure.ldflags} [get_canonical_archflags ld] ${name}.o -lGL -lX11 -o ${name}"
}

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

use_parallel_build yes

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