# -*- 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-fcdproplus
maintainers         {michaelld @michaelld} openmaintainer
description         Implements a funcube dongle pro+ source in GNU Radio.
long_description    {*}${description}
license             GPL-3

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

    github.setup    dl1ksv gr-fcdproplus 575fcafbb8f36dc11d95a305f331660612a44596
    # Change github.tarball_from to 'releases' or 'archive' next update
    github.tarball_from tarball
    version         20200811-[string range ${github.version} 0 7]
    checksums       rmd160  81616bfcd52a2c0fc0aabb0ab413a4cb540b0b9d \
                    sha256  2d360d367794290df802dadce984ddd28e150a9042b9d1301a661475634fbb21 \
                    size    49717
    revision        0

    # force c++11 standard (strange)
    # and enable system hidapi
    patchfiles-append \
        cmakelists.txt.patch

    configure.cxxflags-append \
        -std=c++11

    conflicts gr37-fcdproplus

    depends_lib-append \
        port:hidapi
}

subport gr37-fcdproplus {

    name            gr37-fcdproplus

    github.setup    dl1ksv gr-fcdproplus 0006c36320cd7a3bc786dd6f186c94809bf445cc
    # Change github.tarball_from to 'releases' or 'archive' next update
    github.tarball_from tarball
    version         20180828
    checksums       rmd160 f71fa01127e21a79b662dbc2a22bc6e1b4030e69 \
                    sha256 187744ef7154008a2c6f0c636e2963674ded75d77b580b77626b7c47c285fb5f \
                    size   132229
    revision        1

    conflicts       gr-fcdproplus

    depends_lib-append \
        path:lib/pkgconfig/libusb-1.0.pc:libusb

    pre-patch {
        reinplace "/HINTS/s@/lib/@/share/@" \
            ${worksrcpath}/cmake/Modules/FindGnuradioModules.cmake
    }

}

# disable because it fails to find Doxyfile.swig_doc.in
default_variants-append -docs
