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

github.setup        Pulse-Eight libcec 6.0.2 libcec-
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
checksums           rmd160  cc0ddc71fb0fda221096e99752b96414018dd6dd \
                    sha256  c7edf2cae761fe4f8e19067afff3260b87b80f67ad116e435fa8509f296c191c \
                    size    355834

categories          multimedia
license             {GPL-2+ OpenSSLException}
maintainers         nomaintainer
description         USB CEC Adapter communication Library
long_description    libCEC, in combination with the right hardware, permits control of \
                    other devices with the TV remote control via existing HDMI cabling
homepage            https://libcec.pulse-eight.com

compiler.cxx_standard  2011

depends_build-append \
                    path:bin/pkg-config:pkgconfig \
                    port:swig-python

depends_lib         port:ncurses \
                    port:p8-platform \
                    port:python38 \
                    port:xorg-libX11 \
                    port:xorg-libXrandr

if {[string match *gcc* ${configure.compiler}]} {
    # USB.h: error: too many '#pragma options align=reset'
    # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50909
    PortGroup       legacysupport 1.1

}

set docdir          ${prefix}/share/doc/${name}

post-destroot {
    xinstall -m 0755 -d ${destroot}${docdir}
    
    xinstall -m 0644 -W ${worksrcpath} \
        AUTHORS \
        debian/changelog.in \
        COPYING \
        README.md \
        ${destroot}${docdir}
}
