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

# _strnlen
legacysupport.newest_darwin_requires_legacy 10

github.setup        theori-io nrsc5 3.1.0 v
revision            0
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
github.tarball_from archive

patchfiles          CMakeLists.txt.diff

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

# FIXME: The build forces bundled faad2 via git fetch:
# https://github.com/theori-io/nrsc5/issues/376
depends_build-append \
                    path:bin/git:git

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

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

configure.args-append \
                    -DUSE_FAAD2=ON

# https://github.com/macports/macports-ports/pull/30561
configure.args-append \
                    -DGIT_COMMIT_HASH=${version}

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