pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/audio/pulseaudio Fix build on NetBSD 4.0.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a0be7975b623
branches:  trunk
changeset: 552032:a0be7975b623
user:      jmcneill <jmcneill%pkgsrc.org@localhost>
date:      Tue Dec 23 19:29:28 2008 +0000

description:
Fix build on NetBSD 4.0.

diffstat:

 audio/pulseaudio/Makefile         |   3 +-
 audio/pulseaudio/distinfo         |  11 +++++----
 audio/pulseaudio/patches/patch-aa |  43 ++++++++++++++++++++++++--------------
 audio/pulseaudio/patches/patch-ac |  25 +++++++++++++++++++--
 audio/pulseaudio/patches/patch-ak |  41 +++++++++++++++++++++++++++++++++++++
 audio/pulseaudio/patches/patch-ba |  29 ++++++++++++++-----------
 audio/pulseaudio/patches/patch-bb |   6 ++--
 7 files changed, 117 insertions(+), 41 deletions(-)

diffs (truncated from 378 to 300 lines):

diff -r 7902f8188031 -r a0be7975b623 audio/pulseaudio/Makefile
--- a/audio/pulseaudio/Makefile Tue Dec 23 18:27:28 2008 +0000
+++ b/audio/pulseaudio/Makefile Tue Dec 23 19:29:28 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2008/12/22 03:32:11 jmcneill Exp $
+# $NetBSD: Makefile,v 1.10 2008/12/23 19:29:28 jmcneill Exp $
 #
 
 DISTNAME=      pulseaudio-0.9.13
@@ -72,6 +72,7 @@
 .if ${OPSYS} == "NetBSD" && exists(/usr/include/sys/atomic.h)
 CONFIGURE_ARGS+=       --enable-netbsd-atomic-ops
 .else
+CONFIGURE_ARGS+=       --disable-netbsd-atomic-ops
 .include "../../devel/libatomic_ops/buildlink3.mk"
 .endif
 
diff -r 7902f8188031 -r a0be7975b623 audio/pulseaudio/distinfo
--- a/audio/pulseaudio/distinfo Tue Dec 23 18:27:28 2008 +0000
+++ b/audio/pulseaudio/distinfo Tue Dec 23 19:29:28 2008 +0000
@@ -1,11 +1,11 @@
-$NetBSD: distinfo,v 1.7 2008/12/23 08:58:01 dsainty Exp $
+$NetBSD: distinfo,v 1.8 2008/12/23 19:29:29 jmcneill Exp $
 
 SHA1 (pulseaudio-0.9.13.tar.gz) = c8482f1bb42d5213bfdbe2154e1a55b7bc04c915
 RMD160 (pulseaudio-0.9.13.tar.gz) = 07cea9939dfb4fc76f13bf01dfe22ab6d0fd8459
 Size (pulseaudio-0.9.13.tar.gz) = 1308493 bytes
-SHA1 (patch-aa) = b29591d8d338a4521d4aa0fb1dcd726368cb2304
+SHA1 (patch-aa) = 1493bed9c983c5c2a69f059b43926b936c62ccb7
 SHA1 (patch-ab) = b894cf1797a2f02e8131be8abc8250774bfec1ec
-SHA1 (patch-ac) = 8f61cf7c4a6681ab53c9ddf1007acb1bf524fe15
+SHA1 (patch-ac) = e19d134985565da015e8db6a1f29483e68ba1a2e
 SHA1 (patch-ad) = 40474c4e04dffe836c41ff348d959c821da527fd
 SHA1 (patch-ae) = 1cd31d18c133fdd5e8db59be319ba5b7a45fe0fe
 SHA1 (patch-af) = 31b8564cb91aabb5de5490659e77de984fd1920b
@@ -13,5 +13,6 @@
 SHA1 (patch-ah) = 13cee1dc10be17f51978208843048ba9db7d9a3f
 SHA1 (patch-ai) = b8e9e2dee9d1c5d9de488cfa0d06440eedacb7c6
 SHA1 (patch-aj) = 50edf909d5d7cc35e925685cdf0831e73d06f6ec
-SHA1 (patch-ba) = b3e587cad73564c47ec921cf1c916d89102d36db
-SHA1 (patch-bb) = ded51f4642163dd5f78bb51522df64cb6ef8b985
+SHA1 (patch-ak) = d2ed994750f4aadaa9c50abb4374c4dab363d01e
+SHA1 (patch-ba) = da9742d49ecb409cd13bee4468e64f982c03cffe
+SHA1 (patch-bb) = ae0209dac352df7abfcf66c452f2ebb91e35e42a
diff -r 7902f8188031 -r a0be7975b623 audio/pulseaudio/patches/patch-aa
--- a/audio/pulseaudio/patches/patch-aa Tue Dec 23 18:27:28 2008 +0000
+++ b/audio/pulseaudio/patches/patch-aa Tue Dec 23 19:29:28 2008 +0000
@@ -1,8 +1,19 @@
-$NetBSD: patch-aa,v 1.3 2008/12/23 08:58:01 dsainty Exp $
+$NetBSD: patch-aa,v 1.4 2008/12/23 19:29:29 jmcneill Exp $
 
 --- src/utils/padsp.c.orig     2008-10-01 19:05:01.000000000 -0400
-+++ src/utils/padsp.c
-@@ -114,7 +114,11 @@ static pthread_mutex_t func_mutex = PTHR
++++ src/utils/padsp.c  2008-12-23 12:55:02.000000000 -0500
+@@ -59,6 +59,10 @@
+ # define SIOCINQ FIONREAD
+ #endif
+ 
++#if !defined(SNDCTL_DSP_GETODELAY)
++# define SNDCTL_DSP_GETODELAY _IOR ('P', 23, int)
++#endif
++
+ /* make sure gcc doesn't redefine open and friends as macros */
+ #undef open
+ #undef open64
+@@ -114,7 +118,11 @@ static pthread_mutex_t func_mutex = PTHR
  
  static PA_LLIST_HEAD(fd_info, fd_infos) = NULL;
  
@@ -14,7 +25,7 @@
  static int (*_close)(int) = NULL;
  static int (*_open)(const char *, int, mode_t) = NULL;
  static FILE* (*_fopen)(const char *path, const char *mode) = NULL;
-@@ -140,6 +144,15 @@ static inline fnptr dlsym_fn(void *handl
+@@ -140,6 +148,15 @@ static inline fnptr dlsym_fn(void *handl
      return (fnptr) (long) dlsym(handle, symbol);
  }
  
@@ -30,7 +41,7 @@
  #define LOAD_IOCTL_FUNC() \
  do { \
      pthread_mutex_lock(&func_mutex); \
-@@ -147,6 +160,7 @@ do { \
+@@ -147,6 +164,7 @@ do { \
          _ioctl = (int (*)(int, int, void*)) dlsym_fn(RTLD_NEXT, "ioctl"); \
      pthread_mutex_unlock(&func_mutex); \
  } while(0)
@@ -38,7 +49,7 @@
  
  #define LOAD_OPEN_FUNC() \
  do { \
-@@ -180,11 +194,16 @@ do { \
+@@ -180,11 +198,16 @@ do { \
      pthread_mutex_unlock(&func_mutex); \
  } while(0)
  
@@ -56,7 +67,7 @@
      pthread_mutex_unlock(&func_mutex); \
  } while(0)
  
-@@ -1452,7 +1471,8 @@ static int real_open(const char *filenam
+@@ -1452,7 +1475,8 @@ static int real_open(const char *filenam
          return _open(filename, flags, mode);
      }
  
@@ -66,7 +77,7 @@
          r = dsp_open(flags, &_errno);
      else if (filename && mixer_cloak_enable() && strcmp(filename, "/dev/mixer") == 0)
          r = mixer_open(flags, &_errno);
-@@ -2313,19 +2333,27 @@ fail:
+@@ -2313,19 +2337,27 @@ fail:
  
  #ifdef sun
  int ioctl(int fd, int request, ...) {
@@ -94,7 +105,7 @@
  
      if (!function_enter()) {
          LOAD_IOCTL_FUNC();
-@@ -2383,6 +2411,8 @@ int access(const char *pathname, int mod
+@@ -2383,6 +2415,8 @@ int access(const char *pathname, int mod
  
      if (!pathname ||
          ( strcmp(pathname, "/dev/dsp") != 0 &&
@@ -103,7 +114,7 @@
            strcmp(pathname, "/dev/adsp") != 0 &&
            strcmp(pathname, "/dev/sndstat") != 0 &&
            strcmp(pathname, "/dev/mixer") != 0 )) {
-@@ -2412,6 +2442,8 @@ int stat(const char *pathname, struct st
+@@ -2412,6 +2446,8 @@ int stat(const char *pathname, struct st
      if (!pathname ||
          !buf ||
          ( strcmp(pathname, "/dev/dsp") != 0 &&
@@ -112,7 +123,7 @@
            strcmp(pathname, "/dev/adsp") != 0 &&
            strcmp(pathname, "/dev/sndstat") != 0 &&
            strcmp(pathname, "/dev/mixer") != 0 )) {
-@@ -2469,6 +2501,8 @@ int stat64(const char *pathname, struct 
+@@ -2469,6 +2505,8 @@ int stat64(const char *pathname, struct 
      if (!pathname ||
          !buf ||
          ( strcmp(pathname, "/dev/dsp") != 0 &&
@@ -121,7 +132,7 @@
            strcmp(pathname, "/dev/adsp") != 0 &&
            strcmp(pathname, "/dev/sndstat") != 0 &&
            strcmp(pathname, "/dev/mixer") != 0 )) {
-@@ -2514,6 +2548,8 @@ int open64(const char *filename, int fla
+@@ -2514,6 +2552,8 @@ int open64(const char *filename, int fla
  
      if (!filename ||
          ( strcmp(filename, "/dev/dsp") != 0 &&
@@ -130,7 +141,7 @@
            strcmp(filename, "/dev/adsp") != 0 &&
            strcmp(filename, "/dev/sndstat") != 0 &&
            strcmp(filename, "/dev/mixer") != 0 )) {
-@@ -2534,6 +2570,8 @@ int __xstat(int ver, const char *pathnam
+@@ -2534,6 +2574,8 @@ int __xstat(int ver, const char *pathnam
      if (!pathname ||
          !buf ||
          ( strcmp(pathname, "/dev/dsp") != 0 &&
@@ -139,7 +150,7 @@
            strcmp(pathname, "/dev/adsp") != 0 &&
            strcmp(pathname, "/dev/sndstat") != 0 &&
            strcmp(pathname, "/dev/mixer") != 0 )) {
-@@ -2557,6 +2595,8 @@ int __xstat64(int ver, const char *pathn
+@@ -2557,6 +2599,8 @@ int __xstat64(int ver, const char *pathn
      if (!pathname ||
          !buf ||
          ( strcmp(pathname, "/dev/dsp") != 0 &&
@@ -148,7 +159,7 @@
            strcmp(pathname, "/dev/adsp") != 0 &&
            strcmp(pathname, "/dev/sndstat") != 0 &&
            strcmp(pathname, "/dev/mixer") != 0 )) {
-@@ -2586,6 +2626,8 @@ FILE* fopen(const char *filename, const 
+@@ -2586,6 +2630,8 @@ FILE* fopen(const char *filename, const 
      if (!filename ||
          !mode ||
          ( strcmp(filename, "/dev/dsp") != 0 &&
@@ -157,7 +168,7 @@
            strcmp(filename, "/dev/adsp") != 0 &&
            strcmp(filename, "/dev/sndstat") != 0 &&
            strcmp(filename, "/dev/mixer") != 0 )) {
-@@ -2629,6 +2671,8 @@ FILE *fopen64(const char *filename, cons
+@@ -2629,6 +2675,8 @@ FILE *fopen64(const char *filename, cons
      if (!filename ||
          !mode ||
          ( strcmp(filename, "/dev/dsp") != 0 &&
diff -r 7902f8188031 -r a0be7975b623 audio/pulseaudio/patches/patch-ac
--- a/audio/pulseaudio/patches/patch-ac Tue Dec 23 18:27:28 2008 +0000
+++ b/audio/pulseaudio/patches/patch-ac Tue Dec 23 19:29:28 2008 +0000
@@ -1,7 +1,7 @@
-$NetBSD: patch-ac,v 1.1.1.1 2008/12/18 14:42:56 jmcneill Exp $
+$NetBSD: patch-ac,v 1.2 2008/12/23 19:29:29 jmcneill Exp $
 
 --- src/tests/rtstutter.c.orig 2008-08-19 17:25:05.000000000 -0400
-+++ src/tests/rtstutter.c
++++ src/tests/rtstutter.c      2008-12-23 13:25:08.000000000 -0500
 @@ -42,6 +42,7 @@ static int msec_lower, msec_upper;
  static void* work(void *p) PA_GCC_NORETURN;
  
@@ -10,7 +10,7 @@
      cpu_set_t mask;
      struct sched_param param;
  
-@@ -83,6 +84,7 @@ static void* work(void *p) {
+@@ -83,10 +84,11 @@ static void* work(void *p) {
          } while (now.tv_sec < end.tv_sec ||
                   (now.tv_sec == end.tv_sec && now.tv_nsec < end.tv_nsec));
      }
@@ -18,3 +18,22 @@
  }
  
  int main(int argc, char*argv[]) {
+-    int n;
++    int n, ncpus;
+ 
+     srand((unsigned) time(NULL));
+ 
+@@ -106,7 +108,12 @@ int main(int argc, char*argv[]) {
+ 
+     pa_log_notice("Creating random latencies in the range of %ims to  %ims.", msec_lower, msec_upper);
+ 
+-    for (n = 1; n < sysconf(_SC_NPROCESSORS_CONF); n++) {
++#ifdef _SC_NPROCESSORS_CONF
++    ncpus = sysconf(_SC_NPROCESSORS_CONF);
++#else
++    ncpus = 1;
++#endif
++    for (n = 1; n < ncpus; n++) {
+         pthread_t t;
+         pa_assert_se(pthread_create(&t, NULL, work, PA_INT_TO_PTR(n)) == 0);
+     }
diff -r 7902f8188031 -r a0be7975b623 audio/pulseaudio/patches/patch-ak
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/audio/pulseaudio/patches/patch-ak Tue Dec 23 19:29:28 2008 +0000
@@ -0,0 +1,41 @@
+$NetBSD: patch-ak,v 1.1 2008/12/23 19:29:29 jmcneill Exp $
+
+--- src/modules/module-oss.c.orig      2008-12-23 13:12:54.000000000 -0500
++++ src/modules/module-oss.c   2008-12-23 13:28:40.000000000 -0500
+@@ -71,6 +71,11 @@
+ #include <pulsecore/thread-mq.h>
+ #include <pulsecore/rtpoll.h>
+ 
++#if defined(__NetBSD__) && !defined(SNDCTL_DSP_GETODELAY)
++#include <sys/audioio.h>
++#include <sys/syscall.h>
++#endif
++
+ #include "oss-util.h"
+ #include "module-oss-symdef.h"
+ 
+@@ -399,13 +404,22 @@ static pa_usec_t io_sink_get_latency(str
+ 
+     if (u->use_getodelay) {
+         int arg;
+-
++#if defined(__NetBSD__) && !defined(SNDCTL_DSP_GETODELAY)
++        struct audio_info info;
++        if (syscall(SYS_ioctl, u->fd, AUDIO_GETBUFINFO, &info) < 0) {
++            pa_log_info("Device doesn't support AUDIO_GETBUFINFO: %s", pa_cstrerror(errno));
++            u->use_getodelay = 0;
++        } else {
++            arg = info.play.seek + info.blocksize / 2;
++            r = pa_bytes_to_usec((size_t) arg, &u->sink->sample_spec);
++        }
++#else
+         if (ioctl(u->fd, SNDCTL_DSP_GETODELAY, &arg) < 0) {
+             pa_log_info("Device doesn't support SNDCTL_DSP_GETODELAY: %s", pa_cstrerror(errno));
+             u->use_getodelay = 0;
+         } else
+             r = pa_bytes_to_usec((size_t) arg, &u->sink->sample_spec);
+-
++#endif
+     }
+ 
+     if (!u->use_getodelay && u->use_getospace) {
diff -r 7902f8188031 -r a0be7975b623 audio/pulseaudio/patches/patch-ba
--- a/audio/pulseaudio/patches/patch-ba Tue Dec 23 18:27:28 2008 +0000
+++ b/audio/pulseaudio/patches/patch-ba Tue Dec 23 19:29:28 2008 +0000
@@ -1,25 +1,28 @@
-$NetBSD: patch-ba,v 1.2 2008/12/23 02:15:27 hasso Exp $
+$NetBSD: patch-ba,v 1.3 2008/12/23 19:29:29 jmcneill Exp $
 
---- configure.ac.orig  2008-10-06 03:39:37 +0300
-+++ configure.ac       2008-12-23 03:11:41 +0200
-@@ -125,6 +125,16 @@ AC_ARG_ENABLE([atomic-arm-memory-barrier
+--- configure.ac.orig  2008-10-05 20:39:37.000000000 -0400
++++ configure.ac       2008-12-23 12:38:28.000000000 -0500
+@@ -125,7 +125,18 @@
                  no) ;;
                  *) AC_MSG_ERROR(bad value ${enableval} for --disable-atomic-arm-linux-helpers) ;;
              esac
+-        ],)
 +      ],)
 +
 +AC_ARG_ENABLE([netbsd-atomic-ops],
 +    AS_HELP_STRING([--enable-netbsd-atomic-ops],[Use the native NetBSD atomic_ops implementation]),
 +        [
 +            case "${enableval}" in



Home | Main Index | Thread Index | Old Index