# -*- 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
PortGroup           gnuradio 1.0

name                gr-rds
maintainers         {michaelld @michaelld} openmaintainer
description         Provides the Radio Data System (RDS) block for GNU Radio.
long_description    {*}${description}
license             GPL-2+

if {${subport} eq ${name}} {

    github.setup    bastibl gr-rds feaba5b1619c5b483fe66e7a91f4565fcf165eff
    # Change github.tarball_from to 'releases' or 'archive' next update
    github.tarball_from tarball
    git.branch      maint-3.8
    version         20201015-[string range ${github.version} 0 7]
    checksums       rmd160  4aeb0969bc2e620308e3f1378b0aaaa5744d2152 \
                    sha256  c3524f4eddd311c6ae98b97ba3ea33a5ba2c93a27bea6bc2d339840d7094ccad \
                    size    210653
    revision        3

    conflicts       gr37-rds

    depends_lib-append \
        port:gr-osmosdr

    post-destroot {
        # copy the provided app into examples
        xinstall -m 755 -d ${destroot}${prefix}/share/gnuradio/examples/rds
        xinstall -m 644 {*}[glob -directory ${worksrcpath}/examples *.grc] \
            ${destroot}${prefix}/share/gnuradio/examples/rds
    }

}

subport gr37-rds {

    name            gr37-rds

    github.setup    bastibl gr-rds a02dcd9e7282a2638bd8a3637315acbf16fb40e2
    # Change github.tarball_from to 'releases' or 'archive' next update
    github.tarball_from tarball
    git.branch      maint-3.7
    version         20200222-[string range ${github.version} 0 7]
    checksums       rmd160  fe39ffee1601202acab26651df776cf52a90468b \
                    sha256  773025cc5edda9b8b0ea4ef6ccba2ad1971d796e1ca183b8099ca2dbd75a0a91 \
                    size    601192
    revision        1

    conflicts       gr-rds

    depends_lib-append \
        port:gr37-osmosdr

    post-destroot {
        # copy the provided app into examples
        xinstall -m 755 -d ${destroot}${prefix}/share/gnuradio/examples/rds
        xinstall -m 644 -W ${worksrcpath} apps/rds_rx.grc \
            ${destroot}${prefix}/share/gnuradio/examples/rds
    }

}

depends_lib-append \
    port:libxml2

# use the git branch for livecheck
github.livecheck.branch ${git.branch}
