# -*- 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        libusb hidapi 0.12.0 hidapi-
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
categories          comms
maintainers         nomaintainer
license             {GPL-3 BSD Permissive}

description         library for interacting with HID-class devices
long_description \
    HIDAPI is a multi-platform library which allows an application to \
    interface with USB and Bluetooth HID-Class devices.

checksums           rmd160  9c9eef4fd89fadf32a360c9ba416ae46f4940366 \
                    sha256  92ed306640298d44628308bdef4f2870cece77e69b08ad341bf27b642290c30c \
                    size    238778

use_autoreconf yes

variant testgui description {Install GUI to test HIDAPI} {
    depends_lib-append      port:fox
    configure.args-append   --enable-testgui
    patchfiles-append       patch-appbundle.diff

    post-destroot {
        set destapp ${destroot}${applications_dir}/HIDAPI-TestGUI.app
        copy ${worksrcpath}/testgui/TestGUI.app ${destapp}
        ln -s ${prefix}/bin/hidapi-testgui ${destapp}/Contents/MacOS/
    }
}
