# -*- 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
# $Id: Portfile 65928 2010-04-03 04:21:15Z jmr@macports.org $

PortSystem              1.0

name                    aubio
version                 0.3.2
revision                1
categories              audio
maintainers             devans openmaintainer
platforms               darwin
use_parallel_build      yes
homepage                http://aubio.piem.org/

description             audio labeling library
long_description \
    ${name} is a library for audio labeling. \
    Its features include segmenting a sound file before each of its attacks, \
    performing pitch detection, \
    tapping the beat and producing MIDI streams from live audio.

master_sites            ${homepage}pub/
checksums               md5 ffc3e5e4880fec67064f043252263a44
depends_lib             port:fftw-3 \
                        port:libsamplerate

post-patch { reinplace "s| -Wno-long-double||g" ${worksrcpath}/configure }

configure.args          --disable-alsa \
                        --disable-jack \
                        --disable-lash \
                        ac_cv_path_PYTHON=no \
                        ac_cv_path_SWIG=no

post-build {
    # aubio's includedir is ${prefix}/include/aubio but aubio's file fft.h
    # includes fftw-3's fftw3.h but fftw3.h is in ${prefix}/include.
    reinplace {s%-I${includedir}%-I${includedir} -I${prefix}/include%} ${worksrcpath}/${name}.pc
}

variant python description "Enable gnuplot and python interface" {
    configure.python        ${prefix}/bin/python2.5
    configure.args-delete    ac_cv_path_PYTHON=no \
                             ac_cv_path_SWIG=no
    depends_lib-append      port:py25-numarray \
                            port:swig-python
    depends_run-append      port:py25-gnuplot
}

livecheck.type  regex
livecheck.url   ${master_sites}
livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
