# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           github 1.0

github.setup        jgaeddert liquid-dsp c3e0de7e89cdcc0ec5da9ccaeb5738496263d4c0
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
version             20221120-[string range ${github.version} 0 7]
checksums           rmd160  9b6fccacfa720badbf9af90de2bf43dbd42fba6d \
                    sha256  96923d01f9ade2046a958db788c473fca95f14ed1e5c5f60a9756cb310b5a99f \
                    size    1228631
revision            0

maintainers         {michaelld @michaelld} {ra1nb0w @ra1nb0w} openmaintainer

description         liquid-dsp is an open-source signal processing library for software-defined \
                    radios written in C.
long_description    {*}${description} Its purpose is to provide a set of extensible DSP modules \
                    that do no rely on external dependencies or cumbersome frameworks.

categories          science comms
homepage            http://www.liquidsdr.org/
license             MIT
platforms           darwin macosx

depends_build-append \
                    port:autoconf \
                    port:automake \
                    port:grep \
                    port:gsed

depends_lib-append  \
                    port:fftw-3-single \
                    port:libfec

# fix the install_name of the library

patchfiles-append   patch-makefile.in.diff

# use the built-in bootstrap shell to create the configure script

pre-configure {
    system "cd ${worksrcpath} && /bin/bash bootstrap.sh"
}

# make sure MP programs are used
configure.env-append \
    SED=${prefix}/bin/gsed \
    GREP=${prefix}/bin/ggrep \
    "EGREP=${prefix}/bin/ggrep -E"

# remove top-level include path, such that internal headers are used
# instead of any already-installed ones.

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

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

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

# build verbosely

build.post_args-append AM_DEFAULT_VERBOSITY=1
