diff options
author | Cheng-Lung Sung <clsung@FreeBSD.org> | 2007-04-04 10:10:53 +0000 |
---|---|---|
committer | Cheng-Lung Sung <clsung@FreeBSD.org> | 2007-04-04 10:10:53 +0000 |
commit | a1d7ee15fcd1fcbe67088073ff5d55e778a28b9c (patch) | |
tree | d10b2e39529f9fb1ffae6ca908a80af33ec67c46 /audio/py-fastaudio | |
parent | 4845b70aad0c573492c4efa277b6b7f5cbdcfa12 (diff) | |
download | ports-a1d7ee15fcd1fcbe67088073ff5d55e778a28b9c.tar.gz ports-a1d7ee15fcd1fcbe67088073ff5d55e778a28b9c.zip |
Notes
Diffstat (limited to 'audio/py-fastaudio')
-rw-r--r-- | audio/py-fastaudio/Makefile | 62 | ||||
-rw-r--r-- | audio/py-fastaudio/distinfo | 6 | ||||
-rw-r--r-- | audio/py-fastaudio/files/patch-fastaudio.pyx | 63 | ||||
-rw-r--r-- | audio/py-fastaudio/files/patch-mysndfile.h | 9 | ||||
-rw-r--r-- | audio/py-fastaudio/files/patch-setup.py | 34 | ||||
-rw-r--r-- | audio/py-fastaudio/pkg-descr | 4 |
6 files changed, 178 insertions, 0 deletions
diff --git a/audio/py-fastaudio/Makefile b/audio/py-fastaudio/Makefile new file mode 100644 index 000000000000..f706c183ec3d --- /dev/null +++ b/audio/py-fastaudio/Makefile @@ -0,0 +1,62 @@ +# New ports collection makefile for: py-fastaudio +# Date created: 3 March 2007 +# Whom: Pontus Stenetorp <ninjin@kth.se> +# Carl Johan Gustavsson <cjg@bsdmail.org> +# +# $FreeBSD$ +# + +PORTNAME= fastaudio +PORTVERSION= 0.1 +CATEGORIES= audio python +MASTER_SITES= http://www.freenet.org.nz/python/pyPortAudio/:site1 \ + http://www.portaudio.com/archives/:site2 +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} +DISTNAME= fastaudio +DISTFILES= fastaudio.tar.gz:site1 portaudio_v18_1.zip:site2 +DIST_SUBDIR= python + +MAINTAINER= ninjin@kth.se +COMMENT= Python bindings for the PortAudio multi-platform audio library + +BUILD_DEPENDS= pyrexc:${PORTSDIR}/devel/pyrex +LIB_DEPENDS= portaudio:${PORTSDIR}/audio/portaudio \ + sndfile:${PORTSDIR}/audio/libsndfile + +PLIST_FILES= lib/%%PYTHON_VERSION%%/site-packages/fastaudio.so +PLIST_DIRS= +EXAMPLESDIR= ${LOCALBASE}/share/examples/py-${PORTNAME} + +USE_ZIP= yes +USE_PYTHON= yes +USE_PYDISTUTILS=yes + +FASTA_SRCFILE= fastaudio.tar.gz +PORTA_SRCFILE= portaudio_v18_1.zip +PORTASRC_DIR= ${WRKDIR}/portaudio_v18_1/ + +.if !defined(WITHOUT_EXAMPLES) +PLIST_DIRS+= share/examples/py-${PORTNAME} +PLIST_FILES+= share/examples/py-${PORTNAME}/demo.py +.endif + +do-extract: + @${MKDIR} ${WRKDIR} + @${TAR} zxf ${DISTDIR}/${DIST_SUBDIR}/${FASTA_SRCFILE} -C ${WRKDIR} + @${UNZIP_CMD} -q -d ${WRKDIR}/ \ + ${DISTDIR}/${DIST_SUBDIR}/${PORTA_SRCFILE} + +post-patch: + @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ + ${WRKSRC}/setup.py ${WRKSRC}/mysndfile.h +# Borrowed from the portaudio port, fixes obsolete path + @${REINPLACE_CMD} -e 's|machine\/soundcard.h|sys\/soundcard.h|' \ + ${PORTASRC_DIR}/pa_unix_oss/pa_unix_oss.c + +post-install: +.if !defined(WITHOUT_EXAMPLES) + ( ${MKDIR} ${EXAMPLESDIR} && \ + ${INSTALL_DATA} ${WRKSRC}/demo.py ${EXAMPLESDIR}/ ) +.endif + +.include <bsd.port.mk> diff --git a/audio/py-fastaudio/distinfo b/audio/py-fastaudio/distinfo new file mode 100644 index 000000000000..f24b90d1b12e --- /dev/null +++ b/audio/py-fastaudio/distinfo @@ -0,0 +1,6 @@ +MD5 (python/fastaudio.tar.gz) = afe72c073e0a10d4379285a78d511bd6 +SHA256 (python/fastaudio.tar.gz) = 5cd72f0b83a3eed448299f431be38efca8f3c349357997ed6e0e58aecf7be748 +SIZE (python/fastaudio.tar.gz) = 229039 +MD5 (python/portaudio_v18_1.zip) = ce66a732d263fde2b5ad2262ef37a691 +SHA256 (python/portaudio_v18_1.zip) = 9da7f1ba0b8029f934d5a8300199e29095127e6abfa03dbb3c1ce40e10751f0a +SIZE (python/portaudio_v18_1.zip) = 550130 diff --git a/audio/py-fastaudio/files/patch-fastaudio.pyx b/audio/py-fastaudio/files/patch-fastaudio.pyx new file mode 100644 index 000000000000..61a27468816a --- /dev/null +++ b/audio/py-fastaudio/files/patch-fastaudio.pyx @@ -0,0 +1,63 @@ +--- fastaudio.pyx.orig Sat Mar 3 10:53:45 2007 ++++ fastaudio.pyx Sat Mar 3 11:03:03 2007 +@@ -92,7 +92,7 @@ + #@+node:portaudio.h + # portaudio-specifics + +-cdef extern from "../pa_common/portaudio.h": ++cdef extern from "/usr/local/include/portaudio.h": + ctypedef int PaError + + cdef enum PA_ERRORS: +@@ -586,8 +586,8 @@ + cdata.framesPerBuf = framesPerBuf + cdata.bytesPerFrame = channels * _sampleFormatSizes[format] + cdata.bytesPerBuf = framesPerBuf * cdata.bytesPerFrame +- cdata.txFifo = fifoNew(cdata.bytesPerBuf, maxbufs, 't') +- cdata.rxFifo = fifoNew(cdata.bytesPerBuf, maxbufs, 'r') ++ cdata.txFifo = fifoNew(cdata.bytesPerBuf, maxbufs, <int> 't') ++ cdata.rxFifo = fifoNew(cdata.bytesPerBuf, maxbufs, <int> 'r') + printf("__new__: txFifo=%lx rxFifo=%lx\n", cdata.txFifo, cdata.rxFifo) + cdata.hits = 0 + cdata.running = 1 +@@ -1113,28 +1113,28 @@ + # write to output buffer, converting to output format + if cChansOut == 1: + if outFormat == paInt8: +- outPtr_8[idxOut] = (frameLeft + frameRight) / (2 * 0x1000000) ++ outPtr_8[idxOut] = <char> (frameLeft + frameRight) / (2 * 0x1000000) + elif outFormat == paUInt8: +- outPtr_u8[idxOut] = (frameLeft + frameRight) / (2 * 0x1000000) ++ outPtr_u8[idxOut] = <unsigned char> (frameLeft + frameRight) / (2 * 0x1000000) + elif outFormat == paInt16: +- outPtr_16[idxOut] = (frameLeft + frameRight) / (2 * 0x10000) ++ outPtr_16[idxOut] = <short> (frameLeft + frameRight) / (2 * 0x10000) + elif outFormat == paInt32: +- outPtr_32[idxOut] = (frameLeft + frameRight) / 2 ++ outPtr_32[idxOut] = <long> (frameLeft + frameRight) / 2 + elif outFormat == paFloat32: + outPtr_f32[idxOut] = (frameLeft + frameRight) / 2 + else: + if outFormat == paInt8: +- outPtr_8[idxOut * 2] = frameLeft / 0x1000000 +- outPtr_8[idxOut * 2 + 1] = frameRight / 0x1000000 ++ outPtr_8[idxOut * 2] = <char> frameLeft / 0x1000000 ++ outPtr_8[idxOut * 2 + 1] = <char> frameRight / 0x1000000 + elif outFormat == paUInt8: +- outPtr_u8[idxOut * 2] = frameLeft / 0x1000000 +- outPtr_u8[idxOut * 2 + 1] = frameRight / 0x1000000 ++ outPtr_u8[idxOut * 2] = <unsigned char> frameLeft / 0x1000000 ++ outPtr_u8[idxOut * 2 + 1] = <unsigned char> frameRight / 0x1000000 + elif outFormat == paInt16: +- outPtr_16[idxOut * 2] = frameLeft / 0x10000 +- outPtr_16[idxOut * 2 + 1] = frameRight / 0x10000 ++ outPtr_16[idxOut * 2] = <short> frameLeft / 0x10000 ++ outPtr_16[idxOut * 2 + 1] = <short> frameRight / 0x10000 + elif outFormat == paInt32: +- outPtr_32[idxOut * 2] = frameLeft +- outPtr_32[idxOut * 2 + 1] = frameRight ++ outPtr_32[idxOut * 2] = <long> frameLeft ++ outPtr_32[idxOut * 2 + 1] = <long> frameRight + elif outFormat == paFloat32: + outPtr_f32[idxOut * 2] = frameLeft + outPtr_f32[idxOut * 2 + 1] = frameRight diff --git a/audio/py-fastaudio/files/patch-mysndfile.h b/audio/py-fastaudio/files/patch-mysndfile.h new file mode 100644 index 000000000000..c29917b9e512 --- /dev/null +++ b/audio/py-fastaudio/files/patch-mysndfile.h @@ -0,0 +1,9 @@ +--- mysndfile.h.orig Tue Jun 15 13:37:39 2004 ++++ mysndfile.h Sat Mar 3 11:53:57 2007 +@@ -1,5 +1,5 @@ + #ifdef WIN32 + #include "sndfile-win32.h" + #else +-#include "sndfile.h" ++#include "/usr/local/include/sndfile.h" + #endif diff --git a/audio/py-fastaudio/files/patch-setup.py b/audio/py-fastaudio/files/patch-setup.py new file mode 100644 index 000000000000..c856b2477501 --- /dev/null +++ b/audio/py-fastaudio/files/patch-setup.py @@ -0,0 +1,34 @@ +--- setup.py.orig Sat Mar 3 10:39:05 2007 ++++ setup.py Fri Mar 9 22:28:00 2007 +@@ -4,6 +4,7 @@ + + import sys + ++libDir=[] + if sys.platform == 'win32': + faSources=['fastaudio.pyx', '../pa_common/pa_lib.c', '../pa_win_wmme/pa_win_wmme.c'] + defines = [('WIN32', 1)] +@@ -15,12 +16,22 @@ + libs = ['sndfile'] + extra_link_args = ['/usr/lib/libsndfile.a'] + #faSources=['fastaudio.pyx'] ++elif sys.platform.find('freebsd') != -1: ++ faSources=['fastaudio.pyx', '../portaudio_v18_1/pa_common/pa_lib.c', '../portaudio_v18_1/pa_unix_oss/pa_unix_oss.c'] ++ defines = [] ++ libs = ['sndfile'] ++ libDir = ['%%LOCALBASE%%/lib'] ++ extra_link_args = ['-lportaudio'] ++ #extra_link_args = ['-lsndfile'] ++ include_dirs=['%%LOCALBASE%%/include', '../portaudio_v18_1/pa_common'] + + ext_fastaudio = [Extension('fastaudio', + faSources, +- include_dirs=['../pa_common'], ++ #include_dirs=, ++ include_dirs, + define_macros=defines, + libraries=libs, ++ library_dirs=libDir, + extra_link_args=extra_link_args + )] + diff --git a/audio/py-fastaudio/pkg-descr b/audio/py-fastaudio/pkg-descr new file mode 100644 index 000000000000..8012eecd995e --- /dev/null +++ b/audio/py-fastaudio/pkg-descr @@ -0,0 +1,4 @@ +py-fastaudio is a Python module that provides bindings for the PortAudio +multiplatform audio I/O library. + +WWW: http://www.freenet.org.nz/python/pyPortAudio/ |