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

platforms           darwin macosx
categories          science
license             LGPL-3
maintainers         {ra1nb0w @ra1nb0w} openmaintainer

name                perseus-sdr
description         Perseus Software Defined Radio Control Library
long_description    ${description}
homepage            http://microtelecom.it/perseus/

github.setup        Microtelecom libperseus-sdr 0.8.2 v
distname            libperseus_sdr-${version}
checksums           rmd160  8f5500d0db4dfa523cb58d3a0f1b3cf4a496953e \
                    sha256  7e7360be8e6760b3a332c6db5f09c30df6bfd7d32355163d90ae198a90b82f21 \
                    size    551236
revision            0

use_autoconf        yes
autoconf.cmd        ./bootstrap.sh

# need for autoconf
depends_build-append \
    port:autoconf    \
    port:automake    \
    port:libtool

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

post-extract {
    # remove ssse3 on ppc
    if {$build_arch eq "ppc" || $build_arch eq "ppc64"} {
        patchfiles-append \
            patch-makefile.am.diff
    }
}

post-destroot {
    # install only the dynamic version
    delete ${destroot}${prefix}/bin/perseustest
    move ${destroot}${prefix}/bin/perseustest_dyn ${destroot}${prefix}/bin/perseustest
}

test.run            yes
test.cmd            ./examples/perseustest