# -*- 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

name                rtl-sdr

github.setup        osmocom rtl-sdr 2.0.2 v
github.tarball_from archive
revision            0
epoch               1
checksums           rmd160  7aac7ef6cb24229d6774367a6e6c45e52a0bbbe9 \
                    sha256  d69943eb32df742bc38a00ce6615e41250fd57851174e5ff916ec31e9e9e68e9 \
                    size    136512
revision            0
categories          science comms
license             GPL-2+
maintainers         {michaelld @michaelld} openmaintainer
description         ${name} allows using devices with a RTL2832U chipset as software defined radio (SDR)
long_description    ${description}
homepage            http://sdr.osmocom.org/trac/wiki/rtl-sdr

depends_build-append port:pkgconfig path:bin/doxygen:doxygen
depends_lib-append   path:lib/pkgconfig/libusb-1.0.pc:libusb

# remove top-level library and includes paths, such that internal
# libraries and headers are used instead of any already-installed ones.

configure.ldflags-delete -L${prefix}/lib
configure.cppflags-delete -I${prefix}/include

# rtl-sdr cmake doesn't understand build type "MacPorts";
# use release unless +debug is set

if {[variant_isset debug]} {
    cmake.build_type Debug
} else {
    cmake.build_type Release
}
