diff options
author | Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2012-07-20 03:03:56 +0000 |
---|---|---|
committer | Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2012-07-20 03:03:56 +0000 |
commit | a28a1142b4467171d6609f3ac9176c4d58c097a2 (patch) | |
tree | c7a3e61c5c5da998dd753fb51ff00dff21e0dd68 /audio/alsa-plugins | |
parent | 9061f8bc2504dc2563d8ed298ed35a5bbf52d8d6 (diff) | |
download | ports-a28a1142b4467171d6609f3ac9176c4d58c097a2.tar.gz ports-a28a1142b4467171d6609f3ac9176c4d58c097a2.zip |
Notes
Diffstat (limited to 'audio/alsa-plugins')
-rw-r--r-- | audio/alsa-plugins/Makefile | 55 | ||||
-rw-r--r-- | audio/alsa-plugins/distinfo | 4 | ||||
-rw-r--r-- | audio/alsa-plugins/files/alsa-plugins.patch | 30 | ||||
-rw-r--r-- | audio/alsa-plugins/files/patch-arcam-av-arcam_av.c | 19 | ||||
-rw-r--r-- | audio/alsa-plugins/files/patch-configure | 59 | ||||
-rw-r--r-- | audio/alsa-plugins/files/patch-jack-pcm_jack.c | 12 | ||||
-rw-r--r-- | audio/alsa-plugins/files/patch-oss-ctl_oss.c | 14 | ||||
-rw-r--r-- | audio/alsa-plugins/files/patch-oss-pcm_oss.c | 29 | ||||
-rw-r--r-- | audio/alsa-plugins/files/patch-usb_stream-pcm_usb_stream.c | 96 | ||||
-rw-r--r-- | audio/alsa-plugins/pkg-plist | 6 |
10 files changed, 217 insertions, 107 deletions
diff --git a/audio/alsa-plugins/Makefile b/audio/alsa-plugins/Makefile index ca0194fc8c55..858c316b0aef 100644 --- a/audio/alsa-plugins/Makefile +++ b/audio/alsa-plugins/Makefile @@ -6,92 +6,83 @@ # PORTNAME= alsa-plugins -PORTVERSION= 1.0.23 -PORTREVISION= 3 +PORTVERSION= 1.0.25 CATEGORIES= audio MASTER_SITES= ftp://ftp.silug.org/pub/alsa/plugins/ \ ftp://gd.tuwien.ac.at/opsys/linux/alsa/plugins/ \ http://dl.ambiweb.de/mirrors/ftp.alsa-project.org/plugins/ \ ftp://ftp.alsa-project.org/pub/plugins/ + MAINTAINER= aragon@phat.za.net COMMENT= ALSA compatibility library plugins -LIB_DEPENDS= asound.2:${PORTSDIR}/audio/alsa-lib +LIB_DEPENDS= asound:${PORTSDIR}/audio/alsa-lib + USE_BZIP2= yes GNU_CONFIGURE= yes USE_GNOME= pkgconfig LDFLAGS+= -L${LOCALBASE}/lib +USE_LDCONFIG= ${PREFIX}/lib/alsa-lib -OPTIONS= JACK "JACK audio support (requires SAMPLERATE)" Off \ - LAVC "libavcodec support" Off \ - SAMPLERATE "libsamplerate support" Off \ - PULSE "PulseAudio support" Off \ - SPEEX "Speex support" Off +OPTIONS_DEFINE= ARIFF_OSS JACK FFMPEG PULSEAUDIO SAMPLERATE SPEEX +OPTIONS_DEFAULT=ARIFF_OSS +ARIFF_OSS_DESC= FreeBSD-specific OSS plugin .include <bsd.port.options.mk> -.if defined(WITH_JACK) -.if defined(WITHOUT_SAMPLERATE) +.if ${PORT_OPTIONS:MARIFF_OSS} +EXTRA_PATCHES+= ${FILESDIR}/alsa-plugins.patch +.endif + +.if ${PORT_OPTIONS:MJACK} +.if empty(PORT_OPTIONS:MSAMPLERATE) IGNORE= JACK audio support requires SAMPLERATE .endif -LIB_DEPENDS+= jack.0:${PORTSDIR}/audio/jack +LIB_DEPENDS+= jack:${PORTSDIR}/audio/jack PLIST_SUB+= JACK="" .else PLIST_SUB+= JACK="@comment " CONFIGURE_ARGS+= --disable-jack .endif -.if defined(WITH_LAVC) +.if ${PORT_OPTIONS:MFFMPEG} CONFIGURE_ARGS+= --enable-avcodec CFLAGS+= -I${LOCALBASE}/include -LIB_DEPENDS+= avcodec.1:${PORTSDIR}/multimedia/ffmpeg +LIB_DEPENDS+= avcodec:${PORTSDIR}/multimedia/ffmpeg PLIST_SUB+= LAVC="" .else CONFIGURE_ARGS+= --disable-avcodec PLIST_SUB+= LAVC="@comment " .endif -.if defined(WITH_PULSE) -LIB_DEPENDS+= pulse.0:${PORTSDIR}/audio/pulseaudio +.if ${PORT_OPTIONS:MPULSEAUDIO} +LIB_DEPENDS+= pulse:${PORTSDIR}/audio/pulseaudio PLIST_SUB+= PULSE="" .else PLIST_SUB+= PULSE="@comment " CONFIGURE_ARGS+= --disable-pulseaudio .endif -.if defined(WITH_SAMPLERATE) -LIB_DEPENDS+= samplerate.1:${PORTSDIR}/audio/libsamplerate +.if ${PORT_OPTIONS:MSAMPLERATE} +LIB_DEPENDS+= samplerate:${PORTSDIR}/audio/libsamplerate PLIST_SUB+= SAMPLERATE="" .else PLIST_SUB+= SAMPLERATE="@comment " CONFIGURE_ARGS+= --disable-samplerate .endif -.if defined(WITH_SPEEX) +.if ${PORT_OPTIONS:MSPEEX} CONFIGURE_ARGS+= --with-speex=lib -LIB_DEPENDS+= speex.1:${PORTSDIR}/audio/speex +LIB_DEPENDS+= speex:${PORTSDIR}/audio/speex PLIST_SUB+= SPEEX="" .else CONFIGURE_ARGS+= --without-speex PLIST_SUB+= SPEEX="@comment " .endif -.if ${OSVERSION} > 900036 \ - || ${OSVERSION} > 802503 && ${OSVERSION} < 900000 \ - || ${OSVERSION} > 704000 && ${OSVERSION} < 800000 -EXTRA_PATCHES+= ${FILESDIR}/alsa-plugins-getiptrfix.patch -.else # ${OSVERSION} <= 704000 -EXTRA_PATCHES+= ${FILESDIR}/alsa-plugins.patch -.endif - post-patch: .SILENT ${REINPLACE_CMD} -e '/LIBS/s/-ldl//g' \ -e '/lt_cv_dlopen/s/-ldl//g' \ - -Ee '/ac_config_files/s:(usb_stream|arcam-av)/Makefile::g' \ - -e '/CONFIG_FILES/ { /usb_stream/d; /arcam-av/d; }' \ ${WRKSRC}/configure - ${REINPLACE_CMD} \ - '/SUBDIRS/ { s/usb_stream//g; s/arcam-av//g; }' \ - ${WRKSRC}/Makefile.in .include <bsd.port.mk> diff --git a/audio/alsa-plugins/distinfo b/audio/alsa-plugins/distinfo index e3f87e15069b..4ae658b98f76 100644 --- a/audio/alsa-plugins/distinfo +++ b/audio/alsa-plugins/distinfo @@ -1,2 +1,2 @@ -SHA256 (alsa-plugins-1.0.23.tar.bz2) = 5c1b2791ad33ef01f0f4f040004c931310da05e45aaa8d4146024c586f2b3183 -SIZE (alsa-plugins-1.0.23.tar.bz2) = 326504 +SHA256 (alsa-plugins-1.0.25.tar.bz2) = a0e374fd6d5ee9683473a5b6e73dadde61d54851065ed670d6627d344b565aab +SIZE (alsa-plugins-1.0.25.tar.bz2) = 331568 diff --git a/audio/alsa-plugins/files/alsa-plugins.patch b/audio/alsa-plugins/files/alsa-plugins.patch index b285aa3accf4..c7ebabd0f3ad 100644 --- a/audio/alsa-plugins/files/alsa-plugins.patch +++ b/audio/alsa-plugins/files/alsa-plugins.patch @@ -1,29 +1,5 @@ ---- jack/pcm_jack.c.orig 2009-09-16 04:33:36.000000000 +0800 -+++ jack/pcm_jack.c 2009-09-16 04:33:55.000000000 +0800 -@@ -20,7 +20,9 @@ - * - */ - -+#ifndef __FreeBSD__ - #include <byteswap.h> -+#endif - #include <sys/shm.h> - #include <sys/types.h> - #include <sys/socket.h> --- oss/ctl_oss.c.orig 2009-08-31 21:09:41.000000000 +0800 +++ oss/ctl_oss.c 2009-09-15 01:07:51.000000000 +0800 -@@ -26,7 +26,11 @@ - #include <sys/ioctl.h> - #include <alsa/asoundlib.h> - #include <alsa/control_external.h> -+#ifdef __FreeBSD__ -+#include <sys/soundcard.h> -+#else - #include <linux/soundcard.h> -+#endif - - typedef struct snd_ctl_oss { - snd_ctl_ext_t ext; @@ -362,7 +366,9 @@ { snd_config_iterator_t it, next; @@ -66,15 +42,13 @@ oss->ext.private_data = oss; --- oss/pcm_oss.c.orig 2009-08-31 21:09:41.000000000 +0800 +++ oss/pcm_oss.c 2009-09-28 14:54:12.000000000 +0800 -@@ -22,17 +22,57 @@ +@@ -22,17 +22,55 @@ #include <sys/ioctl.h> #include <alsa/asoundlib.h> #include <alsa/pcm_external.h> + #include <linux/soundcard.h> +#ifdef __FreeBSD__ +#include <sys/param.h> -+#include <sys/soundcard.h> -+#else - #include <linux/soundcard.h> +#endif + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x))) diff --git a/audio/alsa-plugins/files/patch-arcam-av-arcam_av.c b/audio/alsa-plugins/files/patch-arcam-av-arcam_av.c new file mode 100644 index 000000000000..2826201f10a5 --- /dev/null +++ b/audio/alsa-plugins/files/patch-arcam-av-arcam_av.c @@ -0,0 +1,19 @@ +--- arcam-av/arcam_av.c.orig ++++ arcam-av/arcam_av.c +@@ -27,6 +27,7 @@ + #include <signal.h> + #include <stddef.h> + #include <stdio.h> ++#include <string.h> + #include <termios.h> + #include <unistd.h> + +@@ -37,6 +38,8 @@ + #include <sys/socket.h> + #include <sys/un.h> + ++#define AF_FILE AF_UNIX ++ + #define MIN(a, b) ((a) < (b) ? (a) : (b)) + #define MAX(a, b) ((a) > (b) ? (a) : (b)) + diff --git a/audio/alsa-plugins/files/patch-configure b/audio/alsa-plugins/files/patch-configure index 3580160d1b36..a0da753a0c6d 100644 --- a/audio/alsa-plugins/files/patch-configure +++ b/audio/alsa-plugins/files/patch-configure @@ -1,31 +1,10 @@ --- configure.orig 2010-04-16 13:18:56.000000000 +0200 +++ configure 2010-05-11 00:08:29.000000000 +0200 -@@ -21249,6 +21249,20 @@ - - - -+ -+ -+ -+# Check whether --with-speex was given. -+if test "${with_speex+set}" = set; then -+ withval=$with_speex; PPH=$withval -+else -+ PPH="lib" -+fi -+ -+ -+USE_LIBSPEEX="" -+HAVE_SPEEXDSP="" -+if test "$PPH" = "lib"; then - pkg_failed=no - { echo "$as_me:$LINENO: checking for speexdsp" >&5 - echo $ECHO_N "checking for speexdsp... $ECHO_C" >&6; } -@@ -21319,26 +21333,6 @@ +@@ -19608,14 +19608,6 @@ else + $as_echo "yes" >&6; } + HAVE_SPEEXDSP="yes" fi - - --if test "$HAVE_SPEEXDSP" = "yes"; then +- if test "$HAVE_SPEEXDSP" = "yes"; then - HAVE_SPEEXDSP_TRUE= - HAVE_SPEEXDSP_FALSE='#' -else @@ -33,32 +12,22 @@ - HAVE_SPEEXDSP_FALSE= -fi - -- -- --# Check whether --with-speex was given. --if test "${with_speex+set}" = set; then -- withval=$with_speex; PPH=$withval --else -- PPH="lib" --fi -- -- --USE_LIBSPEEX="" --if test "$PPH" = "lib"; then - if test "$HAVE_SPEEXDSP" = "yes"; then - { echo "$as_me:$LINENO: checking for speex_resampler_init in -lspeexdsp" >&5 - echo $ECHO_N "checking for speex_resampler_init in -lspeexdsp... $ECHO_C" >&6; } -@@ -21437,6 +21431,13 @@ + + + # Check whether --with-speex was given. +@@ -19626,6 +19618,15 @@ else fi -+if test "$HAVE_SPEEXDSP" = "yes"; then ++ if test "$HAVE_SPEEXDSP" = "yes" -a "$PPH" != "no"; then + HAVE_SPEEXDSP_TRUE= + HAVE_SPEEXDSP_FALSE='#' +else + HAVE_SPEEXDSP_TRUE='#' + HAVE_SPEEXDSP_FALSE= +fi - - if test "$PPH" = "builtin" -o "$PPH" = "lib"; then - HAVE_PPH_TRUE= ++ ++ + USE_LIBSPEEX="" + if test "$PPH" = "lib"; then + if test "$HAVE_SPEEXDSP" = "yes"; then diff --git a/audio/alsa-plugins/files/patch-jack-pcm_jack.c b/audio/alsa-plugins/files/patch-jack-pcm_jack.c new file mode 100644 index 000000000000..643954784152 --- /dev/null +++ b/audio/alsa-plugins/files/patch-jack-pcm_jack.c @@ -0,0 +1,12 @@ +--- jack/pcm_jack.c.orig 2009-09-16 04:33:36.000000000 +0800 ++++ jack/pcm_jack.c 2009-09-16 04:33:55.000000000 +0800 +@@ -20,7 +20,9 @@ + * + */ + ++#ifndef __FreeBSD__ + #include <byteswap.h> ++#endif + #include <sys/shm.h> + #include <sys/types.h> + #include <sys/socket.h> diff --git a/audio/alsa-plugins/files/patch-oss-ctl_oss.c b/audio/alsa-plugins/files/patch-oss-ctl_oss.c new file mode 100644 index 000000000000..09b9b308f038 --- /dev/null +++ b/audio/alsa-plugins/files/patch-oss-ctl_oss.c @@ -0,0 +1,14 @@ +--- oss/ctl_oss.c.orig 2008-10-29 08:42:13.000000000 -0400 ++++ oss/ctl_oss.c +@@ -26,7 +26,11 @@ + #include <sys/ioctl.h> + #include <alsa/asoundlib.h> + #include <alsa/control_external.h> ++#ifdef __linux__ + #include <linux/soundcard.h> ++#else ++#include <sys/soundcard.h> ++#endif + + typedef struct snd_ctl_oss { + snd_ctl_ext_t ext; diff --git a/audio/alsa-plugins/files/patch-oss-pcm_oss.c b/audio/alsa-plugins/files/patch-oss-pcm_oss.c new file mode 100644 index 000000000000..98de34bb8d74 --- /dev/null +++ b/audio/alsa-plugins/files/patch-oss-pcm_oss.c @@ -0,0 +1,29 @@ +--- oss/pcm_oss.c.orig 2008-10-29 08:42:13.000000000 -0400 ++++ oss/pcm_oss.c +@@ -22,4 +22,8 @@ + #include <sys/ioctl.h> + #include <alsa/asoundlib.h> + #include <alsa/pcm_external.h> ++#ifdef __linux__ + #include <linux/soundcard.h> ++#else ++#include <sys/soundcard.h> ++#endif +@@ -116,7 +120,7 @@ static int oss_drain(snd_pcm_ioplug_t *i + snd_pcm_oss_t *oss = io->private_data; + + if (io->stream == SND_PCM_STREAM_PLAYBACK) +- ioctl(oss->fd, SNDCTL_DSP_SYNC); ++ ioctl(oss->fd, SNDCTL_DSP_SYNC, NULL); + return 0; + } + +@@ -125,7 +129,7 @@ static int oss_prepare(snd_pcm_ioplug_t + snd_pcm_oss_t *oss = io->private_data; + int tmp; + +- ioctl(oss->fd, SNDCTL_DSP_RESET); ++ ioctl(oss->fd, SNDCTL_DSP_RESET, NULL); + + tmp = io->channels; + if (ioctl(oss->fd, SNDCTL_DSP_CHANNELS, &tmp) < 0) { diff --git a/audio/alsa-plugins/files/patch-usb_stream-pcm_usb_stream.c b/audio/alsa-plugins/files/patch-usb_stream-pcm_usb_stream.c new file mode 100644 index 000000000000..ebb3d7dc0cc2 --- /dev/null +++ b/audio/alsa-plugins/files/patch-usb_stream-pcm_usb_stream.c @@ -0,0 +1,96 @@ +based on https://github.com/dankamongmen/libdank/blob/master/libdank/compat-FreeBSD.c + +--- usb_stream/pcm_usb_stream.c.orig ++++ usb_stream/pcm_usb_stream.c +@@ -18,7 +18,9 @@ + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + ++#ifndef __FreeBSD__ + #include <byteswap.h> ++#endif + #define _GNU_SOURCE + #include <sys/mman.h> + #include <sys/shm.h> +@@ -79,6 +81,69 @@ typedef struct { + static struct user_usb_stream *uus; + static pthread_mutex_t uus_mutex = PTHREAD_MUTEX_INITIALIZER; + ++#ifdef __FreeBSD__ ++/* ++ * Copyright (c) 2000-2011, Nick Black et al ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions are met: ++ * * Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * * Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * * Neither the name of Nick Black nor the names of other contributors may ++ * be used to endorse or promote products derived from this software ++ * without specific prior written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, ++ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND ++ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <copyright ++ * holder> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, ++ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ++ * POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++// This is suitable really only for use with libdank's mremap_and_ftruncate(), ++// due to assumptions it makes about the flags to pass to mmap(2). The only ++// mremap(2) use case addressed is that of MREMAP_MAYMOVE. oldaddr must be a ++// valid previous return from mmap(); NULL is not acceptable (ala Linux's ++// mremap(2)), resulting in undefined behavior, despite realloc(3) semantics. ++// Similarly, oldlen and newlen must be non-zero (and page-aligned). ++void *mremap_compat(int fd,void *oldaddr,size_t oldlen, ++ size_t newlen,int prot,int flags){ ++ void *ret; ++ ++ // From mmap(2) on freebsd 6.3: A successful FIXED mmap deletes any ++ // previous mapping in the allocated address range. This means: ++ // remapping over a current map will blow it away (unless FIXED isn't ++ // provided, in which case it can't overlap an old mapping. See bug ++ // 733 for extensive discussion of this issue for Linux and FreeBSD). ++ if((ret = mmap((char *)oldaddr + oldlen,newlen - oldlen,prot,flags,fd,oldlen)) == MAP_FAILED){ ++ // We couldn't get the memory whatsoever (or we were a fresh ++ // allocation that succeeded). Return the immediate result... ++ return ret; ++ } // ret != MAP_FAILED. Did we squash? ++ if(ret != (char *)oldaddr + oldlen){ ++ // We got the memory, but not where we wanted it. Copy over the ++ // old map, and then free it up... ++ munmap(ret,newlen - oldlen); ++ if((ret = mmap(NULL,newlen,prot,flags,fd,0)) == MAP_FAILED){ ++ return ret; ++ } ++ memcpy(ret,oldaddr,oldlen); ++ munmap(oldaddr,oldlen); // Free the old mapping ++ return ret; ++ } // We successfully squashed. Return a pointer to the first buf. ++ return oldaddr; ++} ++#endif ++ + static struct user_usb_stream *get_uus(const char *card) + { + pthread_mutex_lock(&uus_mutex); +@@ -219,7 +284,11 @@ static int snd_pcm_us_prepare(snd_pcm_io + } + + ++#ifndef __FreeBSD__ + uus->s = mremap(uus->s, sizeof(struct usb_stream), uus->s->read_size, MREMAP_MAYMOVE); ++#else ++ uus->s = mremap_compat(us->pfd.fd, uus->s, sizeof(struct usb_stream), uus->s->read_size, PROT_READ, MAP_SHARED); ++#endif + if (MAP_FAILED == uus->s) { + perror("ALSA/USX2Y: mmap"); + return -EPERM; diff --git a/audio/alsa-plugins/pkg-plist b/audio/alsa-plugins/pkg-plist index 280dbda7618e..0512573dc6e5 100644 --- a/audio/alsa-plugins/pkg-plist +++ b/audio/alsa-plugins/pkg-plist @@ -1,5 +1,7 @@ %%PULSE%%lib/alsa-lib/libasound_module_conf_pulse.la %%PULSE%%lib/alsa-lib/libasound_module_conf_pulse.so +lib/alsa-lib/libasound_module_ctl_arcam_av.la +lib/alsa-lib/libasound_module_ctl_arcam_av.so lib/alsa-lib/libasound_module_ctl_oss.la lib/alsa-lib/libasound_module_ctl_oss.so %%PULSE%%lib/alsa-lib/libasound_module_ctl_pulse.la @@ -16,6 +18,8 @@ lib/alsa-lib/libasound_module_pcm_oss.so %%SPEEX%%lib/alsa-lib/libasound_module_pcm_speex.so lib/alsa-lib/libasound_module_pcm_upmix.la lib/alsa-lib/libasound_module_pcm_upmix.so +lib/alsa-lib/libasound_module_pcm_usb_stream.la +lib/alsa-lib/libasound_module_pcm_usb_stream.so lib/alsa-lib/libasound_module_pcm_vdownmix.la lib/alsa-lib/libasound_module_pcm_vdownmix.so %%LAVC%%lib/alsa-lib/libasound_module_rate_lavcrate.la @@ -34,3 +38,5 @@ lib/alsa-lib/libasound_module_pcm_vdownmix.so %%SPEEX%%lib/alsa-lib/libasound_module_rate_speexrate.so %%SPEEX%%lib/alsa-lib/libasound_module_rate_speexrate_best.so %%SPEEX%%lib/alsa-lib/libasound_module_rate_speexrate_medium.so +%%PULSE%%share/alsa/alsa.conf.d/50-pulseaudio.conf +%%PULSE%%share/alsa/alsa.conf.d/99-pulseaudio-default.conf.example |