# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           github 1.0
PortGroup           gnuradio 1.0

name                gr-limesdr
license             GPL-3+
maintainers         {ra1nb0w @ra1nb0w} {michaelld @michaelld} openmaintainer
description         GNU Radio block for LimeSDR-USB/LimeSDR-Mini boards
long_description    ${description}
homepage            https://wiki.myriadrf.org/Gr-limesdr_Plugin_for_GNURadio

if {${subport} eq ${name}} {
    github.setup    myriadrf gr-limesdr 3.0.1 v
    checksums       rmd160  aea48429e6d95da8309368074c61c55af7d70a88 \
                    sha256  de7ffc85b8f4d39bd4c6be6b3f2860546e2e36a18a2f04b9f89c0c130b9dbedf \
                    size    2992951
    revision        4

    conflicts gr37-limesdr

    github.livecheck.regex  {([0-9.]+)}
}

subport gr37-limesdr {

    name            gr37-limesdr

    github.setup    myriadrf gr-limesdr 2.0.0 v
    checksums       rmd160  c8b2b7a745a316bcc7c6b7b0a1121da2bddea05a \
                    sha256  6f2fcf42dd45ca3893c914752f803dd811e046c21c567286fd1ad35a8d362f05 \
                    size    3083984
    revision        2

    conflicts       gr-limesdr

    github.livecheck.regex  {(2.[0-9.]+)}
}

subport gr-limesdr-devel {
    replaced_by     gr-limesdr
    version         3.0.1
    PortGroup       obsolete 1.0
}

depends_lib-append \
    path:lib/libLimeSuite.dylib:limesuite

post-destroot {
    # copy GNU Radio examples
    xinstall -m 755 -d ${destroot}${prefix}/share/gnuradio/examples/limesdr
    file copy {*}[glob ${worksrcpath}/examples/*] \
        ${destroot}${prefix}/share/gnuradio/examples/limesdr
}
