diff options
author | jmcneill <jmcneill> | 2008-12-23 19:29:28 +0000 |
---|---|---|
committer | jmcneill <jmcneill> | 2008-12-23 19:29:28 +0000 |
commit | dd69e97f2a830cd61db6ef5053c34da051febf88 (patch) | |
tree | 48ce60e82f19a9f9014f19c6eac894a53059e03b | |
parent | d1684fcb3c79fe7a0e6b6aaf3c9d37c8dc1406f7 (diff) | |
download | pkgsrc-dd69e97f2a830cd61db6ef5053c34da051febf88.tar.gz |
Fix build on NetBSD 4.0.
-rw-r--r-- | audio/pulseaudio/Makefile | 3 | ||||
-rw-r--r-- | audio/pulseaudio/distinfo | 11 | ||||
-rw-r--r-- | audio/pulseaudio/patches/patch-aa | 43 | ||||
-rw-r--r-- | audio/pulseaudio/patches/patch-ac | 25 | ||||
-rw-r--r-- | audio/pulseaudio/patches/patch-ak | 41 | ||||
-rw-r--r-- | audio/pulseaudio/patches/patch-ba | 29 | ||||
-rw-r--r-- | audio/pulseaudio/patches/patch-bb | 6 |
7 files changed, 117 insertions, 41 deletions
diff --git a/audio/pulseaudio/Makefile b/audio/pulseaudio/Makefile index 9c5e2042efe..80f44928840 100644 --- a/audio/pulseaudio/Makefile +++ b/audio/pulseaudio/Makefile @@ -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 @@ BUILDLINK_TRANSFORM+= rm:-Wl,--gc-sections .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 --git a/audio/pulseaudio/distinfo b/audio/pulseaudio/distinfo index 0cbfdca419e..ff7ee43a2a0 100644 --- a/audio/pulseaudio/distinfo +++ b/audio/pulseaudio/distinfo @@ -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-ag) = 67e3330c52c605e1eec505166e4ceed1a1277b11 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 --git a/audio/pulseaudio/patches/patch-aa b/audio/pulseaudio/patches/patch-aa index 75ef3b2a1f6..c2d82bdaf60 100644 --- a/audio/pulseaudio/patches/patch-aa +++ b/audio/pulseaudio/patches/patch-aa @@ -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 @@ $NetBSD: patch-aa,v 1.3 2008/12/23 08:58:01 dsainty Exp $ 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 @@ $NetBSD: patch-aa,v 1.3 2008/12/23 08:58:01 dsainty Exp $ #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 @@ $NetBSD: patch-aa,v 1.3 2008/12/23 08:58:01 dsainty Exp $ #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 @@ $NetBSD: patch-aa,v 1.3 2008/12/23 08:58:01 dsainty Exp $ 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 @@ $NetBSD: patch-aa,v 1.3 2008/12/23 08:58:01 dsainty Exp $ 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 @@ $NetBSD: patch-aa,v 1.3 2008/12/23 08:58:01 dsainty Exp $ 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 @@ $NetBSD: patch-aa,v 1.3 2008/12/23 08:58:01 dsainty Exp $ 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 @@ $NetBSD: patch-aa,v 1.3 2008/12/23 08:58:01 dsainty Exp $ 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 @@ $NetBSD: patch-aa,v 1.3 2008/12/23 08:58:01 dsainty Exp $ 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 @@ $NetBSD: patch-aa,v 1.3 2008/12/23 08:58:01 dsainty Exp $ 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 @@ $NetBSD: patch-aa,v 1.3 2008/12/23 08:58:01 dsainty Exp $ 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 @@ $NetBSD: patch-aa,v 1.3 2008/12/23 08:58:01 dsainty Exp $ 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 @@ $NetBSD: patch-aa,v 1.3 2008/12/23 08:58:01 dsainty Exp $ 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 --git a/audio/pulseaudio/patches/patch-ac b/audio/pulseaudio/patches/patch-ac index ff8ba4e1c48..fb6f9ab098c 100644 --- a/audio/pulseaudio/patches/patch-ac +++ b/audio/pulseaudio/patches/patch-ac @@ -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 @@ $NetBSD: patch-ac,v 1.1.1.1 2008/12/18 14:42:56 jmcneill Exp $ 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 @@ $NetBSD: patch-ac,v 1.1.1.1 2008/12/18 14:42:56 jmcneill Exp $ } 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 --git a/audio/pulseaudio/patches/patch-ak b/audio/pulseaudio/patches/patch-ak new file mode 100644 index 00000000000..54aee0e9fb2 --- /dev/null +++ b/audio/pulseaudio/patches/patch-ak @@ -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 --git a/audio/pulseaudio/patches/patch-ba b/audio/pulseaudio/patches/patch-ba index af6d4a1813e..197f4cc2dfb 100644 --- a/audio/pulseaudio/patches/patch-ba +++ b/audio/pulseaudio/patches/patch-ba @@ -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 -+ yes) AC_DEFINE_UNQUOTED(NETBSD_ATOMIC_OPS_ENABLED, 1, [Enable NetBSD atomic_ops]) ;; -+ no) ;; ++ yes) atomic_netbsd_helpers=yes ;; ++ no) atomic_netbsd_helpers=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-netbsd-atomic-ops) ;; + esac - ],) ++ ], ++ [atomic_netbsd_helpers=auto]) AC_MSG_CHECKING([target operating system]) -@@ -133,6 +143,10 @@ case $host in + case $host in +@@ -133,6 +144,10 @@ AC_MSG_RESULT([linux]) pulse_target_os=linux ;; @@ -30,12 +33,12 @@ $NetBSD: patch-ba,v 1.2 2008/12/23 02:15:27 hasso Exp $ *) AC_MSG_RESULT([unknown]) pulse_target_os=unknown -@@ -193,7 +207,13 @@ else +@@ -193,7 +208,13 @@ fi ;; *) - AC_MSG_RESULT([unknown]) -+ if test "x$pulse_target_os" = "xnetbsd" && test "x$ac_cv_header_sys_atomic_h" != "xno"; then ++ if test "x$pulse_target_os" = "xnetbsd" && test "x$atomic_netbsd_helpers" = "xyes"; then + AC_MSG_RESULT([yes]) + AC_DEFINE_UNQUOTED(NETBSD_ATOMIC_OPS, 1, [netbsd implementation]) + need_libatomic_ops=no @@ -45,7 +48,7 @@ $NetBSD: patch-ba,v 1.2 2008/12/23 02:15:27 hasso Exp $ ;; esac fi -@@ -263,7 +283,7 @@ AC_HEADER_STDC +@@ -263,7 +284,7 @@ AC_CHECK_HEADERS([arpa/inet.h glob.h grp.h netdb.h netinet/in.h \ netinet/in_systm.h netinet/tcp.h poll.h pwd.h sched.h \ sys/mman.h sys/resource.h sys/select.h sys/socket.h sys/wait.h \ @@ -54,7 +57,7 @@ $NetBSD: patch-ba,v 1.2 2008/12/23 02:15:27 hasso Exp $ AC_CHECK_HEADERS([netinet/ip.h], [], [], [#include <sys/types.h> #if HAVE_NETINET_IN_H -@@ -292,6 +312,9 @@ AC_CHECK_HEADERS([sys/filio.h]) +@@ -292,6 +313,9 @@ # Windows AC_CHECK_HEADERS([windows.h winsock2.h ws2tcpip.h]) @@ -64,7 +67,7 @@ $NetBSD: patch-ba,v 1.2 2008/12/23 02:15:27 hasso Exp $ # Other AC_CHECK_HEADERS([sys/ioctl.h]) AC_CHECK_HEADERS([byteswap.h]) -@@ -359,8 +382,8 @@ AC_CHECK_FUNCS([lrintf strtof]) +@@ -359,8 +383,8 @@ AC_FUNC_FORK AC_FUNC_GETGROUPS AC_FUNC_SELECT_ARGTYPES diff --git a/audio/pulseaudio/patches/patch-bb b/audio/pulseaudio/patches/patch-bb index b77467f0300..c0a92b934f7 100644 --- a/audio/pulseaudio/patches/patch-bb +++ b/audio/pulseaudio/patches/patch-bb @@ -1,12 +1,12 @@ -$NetBSD: patch-bb,v 1.2 2008/12/20 17:53:51 jmcneill Exp $ +$NetBSD: patch-bb,v 1.3 2008/12/23 19:29:29 jmcneill Exp $ --- src/pulsecore/atomic.h.orig 2008-09-03 17:13:44.000000000 -0400 -+++ src/pulsecore/atomic.h 2008-12-20 12:35:13.000000000 -0500 ++++ src/pulsecore/atomic.h 2008-12-23 14:13:35.000000000 -0500 @@ -107,6 +107,85 @@ static inline pa_bool_t pa_atomic_ptr_cm return __sync_bool_compare_and_swap(&a->value, (long) old_p, (long) new_p); } -+#elif defined(NETBSD_ATOMIC_OPS) ++#elif defined(__NetBSD__) && defined(HAVE_SYS_ATOMIC_H) + +/* NetBSD 5.0+ atomic_ops(3) implementation */ + |