summaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authorjperkin <jperkin@pkgsrc.org>2013-10-24 17:48:53 +0000
committerjperkin <jperkin@pkgsrc.org>2013-10-24 17:48:53 +0000
commitb920dd16f491e894ab8c9f163d4d0e76b09d91e7 (patch)
tree3b3023b2d4e8ea72eb9507109d127d53b042c5bb /audio
parent8ff4c720e01636b00242b11c8417a1d1be3ad0b3 (diff)
downloadpkgsrc-b920dd16f491e894ab8c9f163d4d0e76b09d91e7.tar.gz
Fix build on OSX 10.6, and possibly later.
Diffstat (limited to 'audio')
-rw-r--r--audio/pulseaudio/Makefile9
-rw-r--r--audio/pulseaudio/distinfo5
-rw-r--r--audio/pulseaudio/patches/patch-src_pulsecore_semaphore-osx.c101
-rw-r--r--audio/pulseaudio/patches/patch-src_pulsecore_svolume__mmx.c24
-rw-r--r--audio/pulseaudio/patches/patch-src_pulsecore_svolume__sse.c24
5 files changed, 160 insertions, 3 deletions
diff --git a/audio/pulseaudio/Makefile b/audio/pulseaudio/Makefile
index 8d099896eb8..79310b4a25a 100644
--- a/audio/pulseaudio/Makefile
+++ b/audio/pulseaudio/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.77 2013/10/10 14:42:00 ryoon Exp $
+# $NetBSD: Makefile,v 1.78 2013/10/24 17:48:53 jperkin Exp $
#
DISTNAME= pulseaudio-2.1
@@ -46,6 +46,11 @@ CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFBASEDIR:Q}
PLIST.evdev= yes
.endif
+# Find the appropriate SDK
+.if !empty(MACHINE_PLATFORM:MDarwin-10.*)
+CONFIGURE_ARGS+= --with-mac-sysroot=/Developer/SDKs/MacOSX10.6.sdk
+.endif
+
.include "options.mk"
PKGCONFIG_OVERRIDE+= libpulse-mainloop-glib.pc.in
@@ -80,7 +85,7 @@ PLIST.sun= yes
PLIST.hal= yes
PLIST.oss= yes
. endif
-.else
+.elif ${OPSYS} != "Darwin"
PLIST.hal= yes
PLIST.oss= yes
.endif
diff --git a/audio/pulseaudio/distinfo b/audio/pulseaudio/distinfo
index 0fb4bff9777..f0e02a5d952 100644
--- a/audio/pulseaudio/distinfo
+++ b/audio/pulseaudio/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.36 2013/05/06 20:44:18 markd Exp $
+$NetBSD: distinfo,v 1.37 2013/10/24 17:48:53 jperkin Exp $
SHA1 (pulseaudio-2.1.tar.xz) = 56b4ad9207ea3aec0ad1b8be4b55793b426a4f01
RMD160 (pulseaudio-2.1.tar.xz) = 87f6051bbbe59c26e505a9765f388d3ee4d3a485
@@ -7,3 +7,6 @@ SHA1 (patch-aa) = 59dbd4e6670bc401d2254226b6ba1f4549f35ff7
SHA1 (patch-configure) = 79f938c79a2c3a714d9c81b22030084a421da360
SHA1 (patch-dc) = 48baff12528f09940d63c6bdaf4369cab7e56de3
SHA1 (patch-src_Makefile.in) = 21daf6069ae067dd235de6d43a013e4e70bbca78
+SHA1 (patch-src_pulsecore_semaphore-osx.c) = f9b1962a700932434e05471b2d4df4a5ff5c1b00
+SHA1 (patch-src_pulsecore_svolume__mmx.c) = a3af18563fd11e3813d7a474ff8807ee9bf62390
+SHA1 (patch-src_pulsecore_svolume__sse.c) = 6d2406ad0889219bae96f52f9b525da9b19b9af9
diff --git a/audio/pulseaudio/patches/patch-src_pulsecore_semaphore-osx.c b/audio/pulseaudio/patches/patch-src_pulsecore_semaphore-osx.c
new file mode 100644
index 00000000000..9278cdca43f
--- /dev/null
+++ b/audio/pulseaudio/patches/patch-src_pulsecore_semaphore-osx.c
@@ -0,0 +1,101 @@
+$NetBSD: patch-src_pulsecore_semaphore-osx.c,v 1.1 2013/10/24 17:48:53 jperkin Exp $
+
+Add patch to fix OSX build, from:
+
+ https://bugs.freedesktop.org/attachment.cgi?id=77310
+
+--- src/pulsecore/semaphore-osx.c
++++ src/pulsecore/semaphore-osx.c
+@@ -1,7 +1,8 @@
+ /***
+ This file is part of PulseAudio.
+
+- Copyright 2009 Kim Lester <kim@dfusion.com.au>
++ Copyright 2006 Lennart Poettering
++ Copyright 2013 Albert Zeyer
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published
+@@ -23,40 +24,72 @@
+ #include <config.h>
+ #endif
+
+-#include <Multiprocessing.h>
++#include <stdio.h>
++#include <errno.h>
++#include <pthread.h>
++#include <semaphore.h>
++#include <sys/types.h>
++#include <unistd.h>
+
+ #include <pulse/xmalloc.h>
+ #include <pulsecore/macro.h>
++#include <pulsecore/atomic.h>
++#include <pulsecore/core-util.h>
+
+ #include "semaphore.h"
+
++/*
++OSX doesn't support unnamed semaphores (via sem_init).
++Thus, we use a counter to give them enumerated names.
++*/
++
++static pa_atomic_t id_counter = PA_ATOMIC_INIT(0);
++
+ struct pa_semaphore {
+- MPSemaphoreID sema;
++ sem_t* sem;
++ int id;
+ };
+
+-pa_semaphore* pa_semaphore_new(unsigned int value) {
+- /* NOTE: Can't assume boolean - ie value = 0,1, so use UINT_MAX (boolean more efficient ?) */
++static char *sem_name(char *fn, size_t l, int id) {
++ pa_snprintf(fn, l, "/pulse-sem-%u-%u", getpid(), id);
++ return fn;
++}
++
++pa_semaphore* pa_semaphore_new(unsigned value) {
+ pa_semaphore *s;
+
+ s = pa_xnew(pa_semaphore, 1);
+- pa_assert_se(MPCreateSemaphore(UINT_MAX, value, &s->sema) == 0);
+-
++ s->id = pa_atomic_inc(&id_counter);
++ char fn[32]; sem_name(fn, sizeof(fn), s->id);
++ sem_unlink(fn); // in case it already exists
++ if((s->sem = sem_open(fn, O_CREAT|O_EXCL, 0700, value)) == SEM_FAILED) {
++ perror("pa_semaphore_new: sem_open");
++ abort();
++ }
+ return s;
+ }
+
+ void pa_semaphore_free(pa_semaphore *s) {
+ pa_assert(s);
+- pa_assert_se(MPDeleteSemaphore(s->sema) == 0);
++ pa_assert_se(sem_close(s->sem) == 0);
++ char fn[32]; sem_name(fn, sizeof(fn), s->id);
++ if(sem_unlink(fn) != 0)
++ perror("pa_semaphore_free: sem_unlink");
+ pa_xfree(s);
+ }
+
+ void pa_semaphore_post(pa_semaphore *s) {
+ pa_assert(s);
+- pa_assert_se(MPSignalSemaphore(s->sema) == 0);
++ pa_assert_se(sem_post(s->sem) == 0);
+ }
+
+ void pa_semaphore_wait(pa_semaphore *s) {
++ int ret;
+ pa_assert(s);
+- /* should probably check return value (-ve is error), noErr is ok. */
+- pa_assert_se(MPWaitOnSemaphore(s->sema, kDurationForever) == 0);
++
++ do {
++ ret = sem_wait(s->sem);
++ } while (ret < 0 && errno == EINTR);
++
++ pa_assert(ret == 0);
+ }
diff --git a/audio/pulseaudio/patches/patch-src_pulsecore_svolume__mmx.c b/audio/pulseaudio/patches/patch-src_pulsecore_svolume__mmx.c
new file mode 100644
index 00000000000..706c0d41f02
--- /dev/null
+++ b/audio/pulseaudio/patches/patch-src_pulsecore_svolume__mmx.c
@@ -0,0 +1,24 @@
+$NetBSD: patch-src_pulsecore_svolume__mmx.c,v 1.1 2013/10/24 17:48:53 jperkin Exp $
+
+Avoid bad register usage on OSX 32-bit.
+
+--- src/pulsecore/svolume_mmx.c.orig 2012-07-19 11:29:39.000000000 +0000
++++ src/pulsecore/svolume_mmx.c
+@@ -34,7 +34,7 @@
+
+ #include "sample-util.h"
+
+-#if defined (__i386__) || defined (__amd64__)
++#if (defined (__i386__) && !defined(__APPLE__)) || defined (__amd64__)
+ /* in s: 2 int16_t samples
+ * in v: 2 int32_t volumes, fixed point 16:16
+ * out s: contains scaled and clamped int16_t samples.
+@@ -328,7 +328,7 @@ static void run_test(void) {
+
+
+ void pa_volume_func_init_mmx(pa_cpu_x86_flag_t flags) {
+-#if defined (__i386__) || defined (__amd64__)
++#if (defined (__i386__) && !defined(__APPLE__)) || defined (__amd64__)
+
+ #ifdef RUN_TEST
+ run_test();
diff --git a/audio/pulseaudio/patches/patch-src_pulsecore_svolume__sse.c b/audio/pulseaudio/patches/patch-src_pulsecore_svolume__sse.c
new file mode 100644
index 00000000000..721608f595e
--- /dev/null
+++ b/audio/pulseaudio/patches/patch-src_pulsecore_svolume__sse.c
@@ -0,0 +1,24 @@
+$NetBSD: patch-src_pulsecore_svolume__sse.c,v 1.1 2013/10/24 17:48:53 jperkin Exp $
+
+Avoid bad register usage on OSX 32-bit.
+
+--- src/pulsecore/svolume_sse.c.orig 2012-07-19 11:29:39.000000000 +0000
++++ src/pulsecore/svolume_sse.c
+@@ -34,7 +34,7 @@
+
+ #include "sample-util.h"
+
+-#if defined (__i386__) || defined (__amd64__)
++#if (defined (__i386__) && !defined(__APPLE__)) || defined (__amd64__)
+
+ #define VOLUME_32x16(s,v) /* .. | vh | vl | */ \
+ " pxor %%xmm4, %%xmm4 \n\t" /* .. | 0 | 0 | */ \
+@@ -335,7 +335,7 @@ static void run_test(void) {
+ #endif /* defined (__i386__) || defined (__amd64__) */
+
+ void pa_volume_func_init_sse(pa_cpu_x86_flag_t flags) {
+-#if defined (__i386__) || defined (__amd64__)
++#if (defined (__i386__) && !defined(__APPLE__)) || defined (__amd64__)
+
+ #ifdef RUN_TEST
+ run_test();