# -*- 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 114324 2013-12-05 08:44:51Z ryandesign@macports.org $

PortSystem              1.0
PortGroup               python 1.0

name                    py-pyaudio
version                 0.2.7
categories-append       audio
platforms               darwin
maintainers             NLnetLabs.nl:jaap
license                 MIT

description             PyAudio provides Python bindings for PortAudio
long_description        PyAudio provides Python bindings for PortAudio, \
                        the cross-platform audio I/O library. With PyAudio, \
                        you can easily use Python to play and record audio \
                        on a variety of platforms.

homepage                http://people.csail.mit.edu/hubert/pyaudio/

master_sites            ${homepage}packages/
distname                pyaudio-${version}
checksums               md5     41eaa5a027e2a68ac29237018985dfbb \
                        rmd160  d4536504f99a0dcd90e6b6d1c7ce694e946febe5 \
                        sha256  7807cf937df3652f64b014b9f579c308cf87057d32ed4250a6b28844e2b56287

worksrcdir              PyAudio-${version}

python.versions         26 27 32

if {${name} ne ${subport}} {
    depends_lib-append  port:portaudio

    patchfiles          patch-setup.py.diff
    post-patch {
        reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/setup.py
    }

    python.link_binaries no

    livecheck.type      none
} else {
    livecheck.type      regex
    livecheck.url       [lindex ${master_sites} 0]
    livecheck.regex     pyaudio-(\[0-9.\]+)${extract.suffix}
}
