Skip to content

Commit

Permalink
Merge from vendor branch FIX_VENDOR:
Browse files Browse the repository at this point in the history
import of pulseaudio 0.9.23 a cross-platform networked sound-server
many fixes from jasper@ and me.
  • Loading branch information
rnagy committed Sep 25, 2011
2 parents a23274f + 51c090a commit ccc357a
Show file tree
Hide file tree
Showing 20 changed files with 741 additions and 0 deletions.
81 changes: 81 additions & 0 deletions audio/pulseaudio/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# $OpenBSD: Makefile,v 1.1.1.1 2011/09/25 09:30:52 robert Exp $

SHARED_ONLY= Yes

COMMENT= cross-platform networked sound server

VERSION= 0.9.23
DISTNAME= pulseaudio-${VERSION}
SHARED_LIBS += pulse-browse 0.0 # 1.1
SHARED_LIBS += pulse-mainloop-glib 0.0 # 0.4
SHARED_LIBS += pulse-simple 0.0 # 0.3
SHARED_LIBS += pulse 0.0 # 12.4
CATEGORIES= audio

MAINTAINER= Robert Nagy <[email protected]>
HOMEPAGE= http://www.pulseaudio.org/

# LGPLv2.1
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes

MASTER_SITES= http://freedesktop.org/software/pulseaudio/releases/
TAR= ${LOCALBASE}/bin/gtar

MODULES= devel/gettext

WANTLIB += ICE ORBit-2 SM X11 X11-xcb Xext Xi Xtst avahi-client
WANTLIB += avahi-common c crypto dbus-1 execinfo ffi gconf-2 gdbm
WANTLIB += gio-2.0 glib-2.0 gmodule-2.0 gobject-2.0 gthread-2.0
WANTLIB += ltdl m ossaudio pcre pthread samplerate sndfile speexdsp
WANTLIB += ssl xcb z

USE_GMAKE= Yes
USE_LIBTOOL= gnu

BUILD_DEPENDS+= archivers/gtar
LIB_DEPENDS= audio/libsamplerate \
audio/speex \
databases/gdbm \
devel/gconf2 \
devel/libexecinfo \
devel/libtool,-ltdl>=2.4 \
net/avahi

AUTOCONF_VERSION= 2.68
CONFIGURE_STYLE= autoconf gnu
CONFIGURE_ARGS+= ${CONFIGURE_SHARED} \
--disable-atomic-arm-linux-helpers \
--with-system-user=_pulse \
--with-system-group=_pulse \
--with-access-group=_pulse-access \
--with-database=gdbm \
--enable-x11 \
--disable-alsa \
--disable-jack \
--disable-hal \
--disable-hal-compat \
--disable-udev \
--disable-lirc \
--disable-tcpwrap \
--enable-oss-output \
--enable-oss-wrapper \
--localstatedir=/var
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib \
-Wl,-rpath,${TRUEPREFIX}/lib/pulse-${VERSION}/modules/" \
PTHREAD_LIBS="-pthread"

FAKE_FLAGS+= xdgautostartdir="${PREFIX}/share/examples/pulseaudio/xdg/autostart" \
dbuspolicydir="${PREFIX}/share/examples/pulseaudio/dbus-1/system.d" \
pulseconfdir="${PREFIX}/share/examples/pulseaudio/pulse/"

SUBST_VARS+= VERSION

pre-configure:
${SUBST_CMD} ${WRKSRC}/src/daemon/default.pa.in \
${WRKSRC}/src/pulse/util.c

.include <bsd.port.mk>
5 changes: 5 additions & 0 deletions audio/pulseaudio/distinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
MD5 (pulseaudio-0.9.23.tar.gz) = c5EgWjN9HgSp/zgCX2hANA==
RMD160 (pulseaudio-0.9.23.tar.gz) = H10ZpAJ5Mn3NBJCOT0QclamGMT0=
SHA1 (pulseaudio-0.9.23.tar.gz) = Nh99iWBuhCOq0ZaRuyf2VS4LZ54=
SHA256 (pulseaudio-0.9.23.tar.gz) = rz6ExhTLYy/R9XEFSJ/NX5P5Btoc5aqQGUkiEgMfuk4=
SIZE (pulseaudio-0.9.23.tar.gz) = 2095454
24 changes: 24 additions & 0 deletions audio/pulseaudio/patches/patch-configure_ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
$OpenBSD: patch-configure_ac,v 1.1.1.1 2011/09/25 09:30:52 robert Exp $

- Fix path to soundcard.h

--- configure.ac.orig Thu Jun 23 22:56:05 2011
+++ configure.ac Sat Sep 17 15:34:58 2011
@@ -104,7 +104,7 @@ if test "x$M4" = xno ; then
fi

dnl Compiler flags
-CC_CHECK_CFLAGS_APPEND([-Wall -W -Wextra -pipe -Wno-long-long -Winline -Wvla -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -ffast-math -Wp,-D_FORTIFY_SOURCE=2 -fno-common -fdiagnostics-show-option])
+CC_CHECK_CFLAGS_APPEND([-Wall -W -Wextra -pipe -Wno-long-long -Winline -Wvla -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -ffast-math -Wp,-D_FORTIFY_SOURCE=2 -fno-common -fdiagnostics-show-option])

dnl Linker flags.
dnl Check whether the linker supports the -version-script option.
@@ -750,7 +750,7 @@ AC_ARG_ENABLE([oss-wrapper],
[oss_wrapper=auto])

if test "x${oss_output}" != xno || test "x${oss_wrapper}" != "xno"; then
- AC_CHECK_HEADERS([sys/soundcard.h],
+ AC_CHECK_HEADERS([soundcard.h],
[
if test "x${oss_output}" != "xno"; then
AC_DEFINE([HAVE_OSS_OUTPUT], 1, [Have OSS output?])
10 changes: 10 additions & 0 deletions audio/pulseaudio/patches/patch-m4_acx_pthread_m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- m4/acx_pthread.m4.orig Thu Jun 23 22:18:54 2011
+++ m4/acx_pthread.m4 Thu Sep 22 12:28:19 2011
@@ -235,6 +235,7 @@ if test "x$acx_pthread_ok" = xyes; then
check_inconsistencies=yes
case "${host_cpu}-${host_os}" in
*-darwin*) check_inconsistencies=no ;;
+ *-openbsd*) check_inconsistencies=no ;;
esac
if test x"$GCC" != xyes -o "x$check_inconsistencies" != xyes ; then
AC_MSG_RESULT([no])
36 changes: 36 additions & 0 deletions audio/pulseaudio/patches/patch-src_Makefile_in
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
$OpenBSD: patch-src_Makefile_in,v 1.1.1.1 2011/09/25 09:30:52 robert Exp $

- Don't install ALSA and UDEV files on OpenBSD.

--- src/Makefile.in.orig Thu Jun 23 22:56:35 2011
+++ src/Makefile.in Sat Sep 17 12:36:58 2011
@@ -3008,7 +3008,7 @@ libpulsecommon_@PA_MAJORMINORMICRO@_la_CFLAGS = $(AM_C
libpulsecommon_@PA_MAJORMINORMICRO@_la_LDFLAGS = $(AM_LDFLAGS) \
-avoid-version $(am__append_14)
libpulsecommon_@PA_MAJORMINORMICRO@_la_LIBADD = $(AM_LIBADD) \
- $(LIBWRAP_LIBS) $(WINSOCK_LIBS) $(LTLIBICONV) \
+ $(LIBWRAP_LIBS) $(WINSOCK_LIBS) $(LTLIBICONV) -lexecinfo \
$(LIBSNDFILE_LIBS) $(am__append_16) $(am__append_20)

###################################
@@ -3411,7 +3411,7 @@ module_x11_cork_request_la_LIBADD = $(AM_LIBADD) $(X11

# OSS
liboss_util_la_SOURCES = modules/oss/oss-util.c modules/oss/oss-util.h
-liboss_util_la_LDFLAGS = -avoid-version
+liboss_util_la_LDFLAGS = -avoid-version -lossaudio
liboss_util_la_LIBADD = libpulsecore-@[email protected] libpulsecommon-@[email protected] libpulse.la
module_oss_la_SOURCES = modules/oss/module-oss.c
module_oss_la_LDFLAGS = $(MODULE_LDFLAGS)
@@ -8049,9 +8049,8 @@ info: info-recursive

info-am:

-install-data-am: install-alsapathsDATA install-alsaprofilesetsDATA \
- install-dbuspolicyDATA install-pulseconfDATA \
- install-pulseincludeHEADERS install-udevrulesDATA \
+install-data-am: install-dbuspolicyDATA install-pulseconfDATA \
+ install-pulseincludeHEADERS \
install-xdgautostartDATA

install-dvi: install-dvi-recursive
21 changes: 21 additions & 0 deletions audio/pulseaudio/patches/patch-src_daemon_default_pa_in
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
$OpenBSD: patch-src_daemon_default_pa_in,v 1.1.1.1 2011/09/25 09:30:52 robert Exp $

- Adjust path to soundfiles.

--- src/daemon/default.pa.in.orig Thu Jun 23 22:18:54 2011
+++ src/daemon/default.pa.in Sat Sep 17 12:36:59 2011
@@ -22,10 +22,10 @@
.nofail

### Load something into the sample cache
-#load-sample-lazy x11-bell /usr/share/sounds/gtk-events/activate.wav
-#load-sample-lazy pulse-hotplug /usr/share/sounds/startup3.wav
-#load-sample-lazy pulse-coldplug /usr/share/sounds/startup3.wav
-#load-sample-lazy pulse-access /usr/share/sounds/generic.wav
+#load-sample-lazy x11-bell ${LOCALBASE}/share/sounds/gtk-events/activate.wav
+#load-sample-lazy pulse-hotplug ${LOCALBASE}/share/sounds/startup3.wav
+#load-sample-lazy pulse-coldplug ${LOCALBASE}/share/sounds/startup3.wav
+#load-sample-lazy pulse-access ${LOCALBASE}/share/sounds/generic.wav

.fail

21 changes: 21 additions & 0 deletions audio/pulseaudio/patches/patch-src_daemon_main_c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
$OpenBSD: patch-src_daemon_main_c,v 1.1.1.1 2011/09/25 09:30:52 robert Exp $
--- src/daemon/main.c.orig Thu Jun 23 22:18:54 2011
+++ src/daemon/main.c Thu Sep 22 12:17:30 2011
@@ -640,6 +640,7 @@ int main(int argc, char *argv[]) {
* first take the autospawn lock to make things
* synchronous. */

+#if notyet /* XXX broken on *BSD */
if ((autospawn_fd = pa_autospawn_lock_init()) < 0) {
pa_log("Failed to initialize autospawn lock");
goto finish;
@@ -649,8 +650,8 @@ int main(int argc, char *argv[]) {
pa_log("Failed to acquire autospawn lock");
goto finish;
}
-
autospawn_locked = TRUE;
+#endif
}

if (conf->daemonize) {
15 changes: 15 additions & 0 deletions audio/pulseaudio/patches/patch-src_daemon_start-pulseaudio-x11_in
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
$OpenBSD: patch-src_daemon_start-pulseaudio-x11_in,v 1.1.1.1 2011/09/25 09:30:52 robert Exp $

- --start doesn't work correctly (yet), so prefer -D.

--- src/daemon/start-pulseaudio-x11.in.orig Thu Jun 23 14:21:07 2011
+++ src/daemon/start-pulseaudio-x11.in Thu Jun 23 14:21:15 2011
@@ -21,7 +21,7 @@ set -e

[ -z "$PULSE_SERVER" ]

-@PA_BINARY@ --start "$@"
+@PA_BINARY@ -D "$@"

if [ x"$DISPLAY" != x ] ; then

45 changes: 45 additions & 0 deletions audio/pulseaudio/patches/patch-src_modules_module-detect_c
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
$OpenBSD: patch-src_modules_module-detect_c,v 1.1.1.1 2011/09/25 09:30:52 robert Exp $
--- src/modules/module-detect.c.orig Thu Jun 23 22:18:54 2011
+++ src/modules/module-detect.c Thu Sep 22 12:44:14 2011
@@ -120,6 +120,7 @@ static int detect_alsa(pa_core *c, int just_one) {
#endif

#ifdef HAVE_OSS_OUTPUT
+#if !defined(__OpenBSD__)
static int detect_oss(pa_core *c, int just_one) {
FILE *f;
int n = 0, b = 0;
@@ -177,6 +178,33 @@ static int detect_oss(pa_core *c, int just_one) {
fclose(f);
return n;
}
+#else
+static int detect_oss(pa_core *c, int just_one) {
+ struct stat s;
+ const char *dev;
+ char args[64];
+
+ dev = getenv("AUDIODEV");
+ if (!dev)
+ dev = "/dev/audio";
+
+ if (stat(dev, &s) < 0) {
+ if (errno != ENOENT)
+ pa_log_error("failed to open device %s: %s", dev, pa_cstrerror(errno));
+ return -1;
+ }
+
+ if (!S_ISCHR(s.st_mode))
+ return 0;
+
+ pa_snprintf(args, sizeof(args), "device=%s", dev);
+
+ if (!pa_module_load(c, "module-oss", args))
+ return 0;
+
+ return 1;
+}
+#endif
#endif

#ifdef HAVE_SOLARIS
38 changes: 38 additions & 0 deletions audio/pulseaudio/patches/patch-src_modules_oss_module-oss_c
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
$OpenBSD: patch-src_modules_oss_module-oss_c,v 1.1.1.1 2011/09/25 09:30:52 robert Exp $

- Fix path to soundcard.h
- Use correct fd.

--- src/modules/oss/module-oss.c.orig Fri Nov 26 01:45:23 2010
+++ src/modules/oss/module-oss.c Thu Jun 23 11:31:14 2011
@@ -42,7 +42,7 @@
#include <sys/mman.h>
#endif

-#include <sys/soundcard.h>
+#include <soundcard.h>
#include <sys/ioctl.h>
#include <stdlib.h>
#include <sys/stat.h>
@@ -1223,10 +1223,12 @@ int pa__init(pa_module*m) {
use_mmap = FALSE;
}

+#if !defined(__FreeBSD__) && !defined(__OpenBSD__)
if (use_mmap && mode == O_WRONLY) {
pa_log_info("Device opened for playback only, cannot do memory mapping, falling back to UNIX write() mode.");
use_mmap = FALSE;
}
+#endif

if (pa_oss_get_hw_description(dev, hwdesc, sizeof(hwdesc)) >= 0)
pa_log_info("Hardware name is '%s'.", hwdesc);
@@ -1420,7 +1422,7 @@ int pa__init(pa_module*m) {
if ((u->mixer_fd = pa_oss_open_mixer_for_device(u->device_name)) >= 0) {
pa_bool_t do_close = TRUE;

- if (ioctl(fd, SOUND_MIXER_READ_DEVMASK, &u->mixer_devmask) < 0)
+ if (ioctl(u->mixer_fd, SOUND_MIXER_READ_DEVMASK, &u->mixer_devmask) < 0)
pa_log_warn("SOUND_MIXER_READ_DEVMASK failed: %s", pa_cstrerror(errno));

else {
15 changes: 15 additions & 0 deletions audio/pulseaudio/patches/patch-src_modules_oss_oss-util_c
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
$OpenBSD: patch-src_modules_oss_oss-util_c,v 1.1.1.1 2011/09/25 09:30:52 robert Exp $

- Fix path to soundcard.h

--- src/modules/oss/oss-util.c.orig Wed Jun 8 13:10:07 2011
+++ src/modules/oss/oss-util.c Wed Jun 8 13:10:21 2011
@@ -24,7 +24,7 @@
#include <config.h>
#endif

-#include <sys/soundcard.h>
+#include <soundcard.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <errno.h>
15 changes: 15 additions & 0 deletions audio/pulseaudio/patches/patch-src_pulse_context_c
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
$OpenBSD: patch-src_pulse_context_c,v 1.1.1.1 2011/09/25 09:30:52 robert Exp $

- --start doesn't work correctly (yet), so prefer -D.

--- src/pulse/context.c.orig Thu Jun 23 14:20:41 2011
+++ src/pulse/context.c Thu Jun 23 14:20:48 2011
@@ -704,7 +704,7 @@ static int context_autospawn(pa_context *c) {

/* Setup argv */
argv[n++] = c->conf->daemon_binary;
- argv[n++] = "--start";
+ argv[n++] = "-D";

while (n < PA_ELEMENTSOF(argv)-1) {
char *a;
17 changes: 17 additions & 0 deletions audio/pulseaudio/patches/patch-src_pulse_util_c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$OpenBSD: patch-src_pulse_util_c,v 1.1.1.1 2011/09/25 09:30:52 robert Exp $
--- src/pulse/util.c.orig Thu Jun 23 22:18:54 2011
+++ src/pulse/util.c Wed Sep 21 13:03:15 2011
@@ -192,6 +192,13 @@ char *pa_get_binary_name(char *s, size_t l) {

#endif

+#ifdef __OpenBSD__
+ {
+ s = "${LOCALBASE}/bin/pulseaudio";
+ return s;
+ }
+#endif
+
#if defined(HAVE_SYS_PRCTL_H) && defined(PR_GET_NAME)
{

14 changes: 14 additions & 0 deletions audio/pulseaudio/patches/patch-src_pulsecore_parseaddr_c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
$OpenBSD: patch-src_pulsecore_parseaddr_c,v 1.1.1.1 2011/09/25 09:30:52 robert Exp $

- error: 'INET6_ADDRSTRLEN' undeclared (first use in this function)

--- src/pulsecore/parseaddr.c.orig Wed Jun 8 11:46:50 2011
+++ src/pulsecore/parseaddr.c Wed Jun 8 11:48:32 2011
@@ -27,6 +27,7 @@
#include <stdlib.h>
#include <arpa/inet.h>
#include <sys/socket.h>
+#include <netinet/in.h>

#include <pulse/xmalloc.h>
#include <pulse/util.h>
27 changes: 27 additions & 0 deletions audio/pulseaudio/patches/patch-src_pulsecore_pstream_c
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
$OpenBSD: patch-src_pulsecore_pstream_c,v 1.1.1.1 2011/09/25 09:30:52 robert Exp $

- Fix a lock-up.

--- src/pulsecore/pstream.c.orig Fri Nov 26 01:45:23 2010
+++ src/pulsecore/pstream.c Thu Jun 23 11:36:14 2011
@@ -181,14 +181,17 @@ static void do_something(pa_pstream *p) {
p->mainloop->defer_enable(p->defer_event, 0);

if (!p->dead && pa_iochannel_is_readable(p->io)) {
- if (do_read(p) < 0)
+ if (do_read(p) < 0) {
goto fail;
- } else if (!p->dead && pa_iochannel_is_hungup(p->io))
+ }
+ } else if (!p->dead && pa_iochannel_is_hungup(p->io)) {
goto fail;
+ }

if (!p->dead && pa_iochannel_is_writable(p->io)) {
- if (do_write(p) < 0)
+ if (do_write(p) < 0) {
goto fail;
+ }
}

pa_pstream_unref(p);
Loading

0 comments on commit ccc357a

Please sign in to comment.