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

# _strnlen
legacysupport.newest_darwin_requires_legacy 10

github.setup        theori-io nrsc5 3.1.0 v
github.tarball_from archive

categories          audio
maintainers         {@trodemaster icloud.com:manuals-unread2u} openmaintainer

license             GPL-3+

description         This program receives NRSC-5 digital radio stations using an RTL-SDR dongle
long_description    {*}${description}. It offers a command-line interface \
                    as well as an API upon which other applications can be built.

checksums           rmd160  ef40c59245ff62c8c1d8c5d545b415ad7e030fbe \
                    sha256  66a1d199e92fd7b9464d55ece633757cb9d1daf37d4d80e0f4f8f63da089295e \
                    size    23184491
                                        
patchfiles          CMakeLists.txt.diff

configure.args-append -DGIT_COMMIT_HASH=${version}

# cc1: error: unrecognized command line option "-std=gnu11"
compiler.c_standard 2011

configure.args-append \
                    -DUSE_FAAD2=ON

if {${configure.build_arch} ni [list ppc ppc64]} {
    configure.args-append \
                    -DUSE_NEON=ON \
                    -DUSE_SSE=ON
}

depends_build-append \
                    port:libtool \
                    port:autoconf \
                    port:automake

depends_lib-append  port:rtl-sdr \
                    port:libao \
                    port:fftw-3-single
