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

github.setup        INRIA libpointing 1.0.7 v
categories          devel
platforms           darwin
maintainers         {@casiez univ-lille1.fr:gery.casiez} \
                    {@Izzatbek gmail.com:izzatbek} \
                    openmaintainer
license             GPL-2+

description         An open-source cross-platform library to get raw events \
                    from pointing devices and master transfer functions.

long_description    Libpointing is an open-source cross-platform library \
                    that provides direct access to HID pointing devices \
                    and supports the design of pointing transfer functions.

homepage            http://libpointing.org
github.tarball_from releases
distname            ${name}-mac-${version}
worksrcdir          ${name}-${version}

checksums           rmd160  7319611b11625f0730090fbd512b3ca372f49ce7 \
                    sha256  29f12da75727d1b03ff952a2754ce79b88aec39b5e03a52d3b0ff7440f08f147

patchfiles          patch-Makefile.diff

compiler.cxx_standard 2011

use_configure       no

variant universal {}
build.env           CXX=${configure.cxx} \
                    "CXXFLAGS=${configure.cxxflags} [get_canonical_archflags cxx]" \
                    "LDFLAGS=${configure.ldflags} [get_canonical_archflags ld]" \
                    PREFIX=${prefix}
destroot.env        PREFIX=${prefix}

if {${os.platform} eq "darwin" && ${os.major} < 13} {
    known_fail yes
    pre-fetch {
        ui_error "${name} requires macOS 10.9 or above."
        return -code error "incompatible Mac OS X version"
    }
}

test.run            yes
test.env            CXX=${configure.cxx} \
                    "CXXFLAGS=${configure.cxxflags} [get_canonical_archflags cxx]" \
                    "LDFLAGS=${configure.ldflags} [get_canonical_archflags ld]"
test.target         test
