how about this

On Mon, Dec 22, 2008 at 01:38:51AM +0100, Hannah Schroeter wrote:
> Hi!
> 
> On Sun, Dec 21, 2008 at 11:04:38PM +0000, Christian Weisgerber wrote:
> >Jacob Meuser <[email protected]> wrote:
> 
> >> > > here's a version to do that and add a device dialog.  "AUDIODEVICE"
> >> > > means to use sndio default ...
> 
> >> > I think it would be more intuitive to just use an empty string to
> >> > mean the sndio default.
> 
> >> otoh, maybe people will think they have to type something in.  the sun
> >> backend has something there by default ...
> 
> >My thinking is that the sndio plugin should be the default.
> 
> Probably difficult to model in a clean way. It *has* a sense that the
> plugins depend on xmms-main. But if that is so, making xmms-main
> depend on xmms-sndio would create circular dependencies. And OpenBSD
> doesn't have "Suggests" or "Recommends" as Debian has.
> 
> One could, of course, instead rename xmms-main into xmms-core, make
> xmms-main a kind of meta-package, containing no files, but depending on
> xmms-main and xmms-sndio.
> 
> >In
> >that case, people will probably have used it with success before
> >they get to the configuration panel, so they wouldn't feel any need
> >to put something in there.
> 
> >"AUDIODEVICE" is a magic value and these are never good.
> 
> I agree. Would be nothing bad in having the empty string use the sndio
> default and have a short explanatory text in the configuration dialogue
> of the plugin (like "empty = sndio default", or "empty = use
> $AUDIODEVICE, or default").
> 
> >What do other people think?
> 
> Here my 0.02 of your favourite unit of currency.
> 
> Kind regards,
> 
> Hannah.
> 

-- 
[email protected]
SDF Public Access UNIX System - http://sdf.lonestar.org

Index: Makefile
===================================================================
RCS file: /home2/cvs/OpenBSD/ports/audio/xmms/Makefile,v
retrieving revision 1.58
diff -u -r1.58 Makefile
--- Makefile    14 Jan 2008 01:16:37 -0000      1.58
+++ Makefile    24 Dec 2008 10:28:12 -0000
@@ -10,7 +10,7 @@
 
 VERSION=               1.2.11
 DISTNAME=              xmms-${VERSION}
-PKGNAME-main=          xmms-${VERSION}p1
+PKGNAME-main=          xmms-${VERSION}p2
 PKGNAME-esd=           xmms-esd-${VERSION}p0
 PKGNAME-vorbis=                xmms-vorbis-${VERSION}p0
 PKGNAME-mikmod=                xmms-mikmod-${VERSION}p0
@@ -21,7 +21,7 @@
 
 MAINTAINER=            Robert Nagy <[email protected]>
 
-# GPL
+# GPL v2
 PERMIT_PACKAGE_CDROM=  Yes
 PERMIT_PACKAGE_FTP=    Yes
 PERMIT_DISTFILES_CDROM= Yes
@@ -34,30 +34,16 @@
                        ftp://ftp.sunet.se/pub/multimedia/xmms/$V/ \
                        ftp://ftp.stealth.net/xmms/$V/
 
-PSEUDO_FLAVORS=                no_esd no_vorbis no_mikmod no_mp3
-FLAVOR?=
-
-MULTI_PACKAGES=                -main
-.if !${FLAVOR:L:Mno_esd}
-MULTI_PACKAGES+=       -esd
-.endif
-.if !${FLAVOR:L:Mno_vorbis}
-MULTI_PACKAGES+=       -vorbis
-.endif
-.if !${FLAVOR:L:Mno_mikmod}
-MULTI_PACKAGES+=       -mikmod
-.endif
-.if !${FLAVOR:L:Mno_mp3}
-MULTI_PACKAGES+=       -mp3
-.endif
+MULTI_PACKAGES=                -main -esd -vorbis -mikmod -mp3
 
 .if ${MACHINE_ARCH} == "sparc64"
 PATCH_LIST=    patch-* gcc-*
 .endif
 
-WANTLIB-main=          ${WANTLIB} GL ICE c Xxf86vm SM pthread
+WANTLIB-main=          ${WANTLIB} GL ICE c Xxf86vm SM pthread sndio
 
 MODULES=               devel/gettext
+BUILD_DEPENDS=         ${MODGNU_AUTOCONF_DEPENDS} ${MODGNU_AUTOMAKE_DEPENDS}
 RUN_DEPENDS=           :unzip-*:archivers/unzip
 LIB_DEPENDS=           gtk.>=1.2,gdk.>=1.2::x11/gtk+ \
                        gthread.>=1.2::devel/glib
@@ -65,10 +51,15 @@
 USE_X11=               Yes
 USE_LIBTOOL=           Yes
 LIBTOOL_FLAGS=         --tag=disable-static
-CONFIGURE_STYLE=       autoconf
+CONFIGURE_STYLE=       gnu
 AUTOCONF_VERSION=      2.59
+AUTOMAKE_VERSION=      1.9
 CONFIGURE_ARGS=                --without-gnome \
-                       --enable-ipv6
+                       --enable-ipv6 \
+                       --with-esd-prefix=${LOCALBASE} \
+                       --with-ogg-prefix=${LOCALBASE} \
+                       --with-vorbis-prefix=${LOCALBASE} \
+                       --with-mikmod-prefix=${LOCALBASE}
 
 CONFIGURE_ENV=         CPPFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include" \
                        CFLAGS="${CFLAGS:C/ *$//} -I${LOCALBASE}/include 
-I${X11BASE}/include" \
@@ -76,9 +67,9 @@
 
 DOCS=                  README NEWS FAQ
 
-LIB_DEPENDS-esd=       ${LIB_DEPENDS} esd.>=2::audio/esound
+LIB_DEPENDS-esd=       ${LIB_DEPENDS} esd::audio/esound
 RUN_DEPENDS-esd=       ::audio/xmms
-WANTLIB-esd=           ${WANTLIB} audiofile
+WANTLIB-esd=           ${WANTLIB} audiofile sndio
 
 LIB_DEPENDS-vorbis=    ${LIB_DEPENDS} vorbis,vorbisfile.>=1::audio/libvorbis
 RUN_DEPENDS-vorbis=    ::audio/xmms
@@ -92,27 +83,19 @@
 LIB_DEPENDS-mp3=       ${LIB_DEPENDS} 
xmms.>=4:xmms-${VERSION}*:${BUILD_PKGPATH}
 WANTLIB-mp3=           ${WANTLIB} z
 
-.if ${MULTI_PACKAGES:M-esd}
-CONFIGURE_ARGS+=       --with-esd-prefix=${LOCALBASE}
-.else
-CONFIGURE_ARGS+=       --disable-esd
-.endif
-
-.if ${MULTI_PACKAGES:M-vorbis}
-CONFIGURE_ARGS+=       --with-ogg-prefix=${LOCALBASE}  \
-                       --with-vorbis-prefix=${LOCALBASE}
-.else
-CONFIGURE_ARGS+=       --disable-vorbis
-.endif
-
-.if ${MULTI_PACKAGES:M-mikmod}
-CONFIGURE_ARGS+=       --with-mikmod-prefix=${LOCALBASE}
-.else
-CONFIGURE_ARGS+=       --disable-mikmod
-.endif
-
-pre-configure:
-       @cd ${WRKSRC}/libxmms && ${LOCALBASE}/bin/autoconf-${AUTOCONF_VERSION}
+post-patch:
+       @mkdir -p ${WRKSRC}/Output/sndio
+       @cp ${FILESDIR}/{Makefile.am,audio_sndio.c} ${WRKSRC}/Output/sndio
+.for dir in $${WRKSRC} $${WRKSRC}/libxmms
+       cd ${dir} && env AUTOCONF_VERSION=${AUTOCONF_VERSION} \
+               AUTOMAKE_VERSION=${AUTOMAKE_VERSION} aclocal
+       cd ${dir} && env AUTOCONF_VERSION=${AUTOCONF_VERSION} \
+               AUTOMAKE_VERSION=${AUTOMAKE_VERSION} autoheader
+       cd ${dir} && env AUTOCONF_VERSION=${AUTOCONF_VERSION} \
+               AUTOMAKE_VERSION=${AUTOMAKE_VERSION} automake
+       cd ${dir} && env AUTOCONF_VERSION=${AUTOCONF_VERSION} \
+               AUTOMAKE_VERSION=${AUTOMAKE_VERSION} autoconf
+.endfor
 
 post-install:
        ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/xmms
Index: files/Makefile.am
===================================================================
RCS file: files/Makefile.am
diff -N files/Makefile.am
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ files/Makefile.am   24 Dec 2008 10:28:12 -0000
@@ -0,0 +1,17 @@
+if HAVE_SNDIO
+sndioltlibs = libsndioout.la
+sndiosources = audio_sndio.c
+else
+sndioltlibs =
+sndiosources =
+endif
+
+EXTRA_DIST = audio_sndio.c
+
+libdir = $(plugindir)/$(OUTPUT_PLUGIN_DIR)
+lib_LTLIBRARIES = $(sndioltlibs)
+
+INCLUDES = @GTK_CFLAGS@ -I$(top_builddir)/intl -I$(top_srcdir)
+libsndioout_la_LDFLAGS = @PLUGIN_LDFLAGS@
+libsndioout_la_LIBADD = @GTK_LIBS@ @PTHREAD_LIBS@ @SNDIO_LIBS@
+libsndioout_la_SOURCES= $(sndiosources)
Index: files/audio_sndio.c
===================================================================
RCS file: files/audio_sndio.c
diff -N files/audio_sndio.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ files/audio_sndio.c 24 Dec 2008 10:28:12 -0000
@@ -0,0 +1,388 @@
+/*
+ * Copyright (c) 2008 Thomas Pfaff <[email protected]>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+
+#include <gtk/gtk.h>
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <sndio.h>
+
+#include <xmms/plugin.h>
+#include <xmms/i18n.h>
+#include <libxmms/util.h>
+#include <libxmms/configfile.h>
+
+#define XMMS_MAXVOL 100
+
+static void op_about (void);
+static void op_init (void);
+static void op_configure (void);
+static void op_get_volume (int *, int *);
+static void op_set_volume (int, int);
+static int op_open (AFormat, int, int);
+static void op_write (void *, int);
+static void op_close (void);
+static void op_seek (int);
+static void op_pause (short);
+static int op_buffer_free (void);
+static int op_playing (void);
+static int op_get_output_time (void);
+static int op_get_written_time (void);
+
+static void onmove_cb (void *, int);
+
+static void configure_win_ok_cb(GtkWidget *, gpointer);
+static void configure_win_cancel_cb(GtkWidget *, gpointer);
+static void configure_win_destroy(void);
+
+static struct sio_par par;
+static struct sio_hdl *hdl;
+static long long rdpos;
+static long long wrpos;
+static int paused;
+static int volume = XMMS_MAXVOL;
+static long bytes_per_sec;
+
+static GtkWidget *configure_win;
+static GtkWidget *adevice_entry;
+static gchar *audiodev;
+
+static OutputPlugin sndio_op = {
+       NULL,
+       NULL,
+       "sndio Output Plugin",
+       op_init,
+       op_about,
+       op_configure,
+       op_get_volume,
+       op_set_volume,
+       op_open,
+       op_write,
+       op_close,
+       op_seek,
+       op_pause,
+       op_buffer_free,
+       op_playing,
+       op_get_output_time,
+       op_get_written_time
+};
+
+OutputPlugin *
+get_oplugin_info (void)
+{
+       return &sndio_op;
+}
+
+static void
+op_about (void)
+{
+       static GtkWidget *about;
+
+       if (about != NULL)
+               return;
+
+       about = xmms_show_message (
+               "About sndio Output Plugin",
+               "XMMS sndio Output Plugin\n\n"
+               "Written by Thomas Pfaff <[email protected]>\n",
+               "Ok", FALSE, NULL, NULL);
+
+       gtk_signal_connect (GTK_OBJECT (about), "destroy",
+               GTK_SIGNAL_FUNC (gtk_widget_destroyed), &about);
+}
+
+static void
+op_init (void)
+{
+       ConfigFile *cfgfile;
+
+       cfgfile = xmms_cfg_open_default_file();
+       xmms_cfg_read_string(cfgfile, "sndio", "audiodev", &audiodev);
+       xmms_cfg_free(cfgfile);
+
+       if (!audiodev)
+               audiodev = g_strdup("");
+}
+
+static void
+op_get_volume (int *left, int *right)
+{
+       *left = *right = volume;
+}
+
+static void
+op_set_volume (int left, int right)
+{
+       /* Ignore balance control, so use unattenuated channel. */
+       volume = left > right ? left : right;
+       if (hdl != NULL)
+               sio_setvol (hdl, volume * SIO_MAXVOL / XMMS_MAXVOL);
+}
+
+static int
+op_open (AFormat fmt, int rate, int nch)
+{
+       struct sio_par askpar;
+
+       if (strlen(audiodev) == 0)
+               hdl = sio_open (NULL, SIO_PLAY, 0);
+       else
+               hdl = sio_open (audiodev, SIO_PLAY, 0);
+       if (hdl == NULL) {
+               fprintf (stderr, "%s: failed to open audio device\n", __func__);
+               return 0;
+       }
+
+       sio_initpar (&par);
+       switch (fmt) {
+       case FMT_U8:
+               par.bits = 8;
+               par.sig = 0;
+               break;
+       case FMT_S8:
+               par.bits = 8;
+               par.sig = 1;
+               break;
+       case FMT_U16_LE:
+               par.bits = 16;
+               par.sig = 0;
+               par.le = 1;
+               break;
+       case FMT_U16_BE:
+               par.bits = 16;
+               par.sig = 0;
+               par.le = 0;
+               break;
+       case FMT_U16_NE:
+               par.bits = 16;
+               par.sig = 0;
+               par.le = SIO_LE_NATIVE;
+               break;
+       case FMT_S16_LE:
+               par.bits = 16;
+               par.sig = 1;
+               par.le = 1;
+               break;
+       case FMT_S16_BE:
+               par.bits = 16;
+               par.sig = 1;
+               par.le = 0;
+       case FMT_S16_NE:
+               par.bits = 16;
+               par.sig = 1;
+               par.le = SIO_LE_NATIVE;
+               break;
+       default:
+               fprintf (stderr, "%s: unknown format requested\n", __func__);
+               op_close ();
+               return 0;
+       }
+       par.pchan = nch;
+       par.rate = rate;
+
+       /* 250 ms buffer */
+       par.appbufsz = par.rate / 4;
+
+       askpar = par;
+       if (!sio_setpar (hdl, &par) || !sio_getpar (hdl, &par)) {
+               fprintf (stderr, "%s: failed to set parameters\n", __func__);
+               op_close ();
+               return 0;
+       }
+
+       if ((par.bits == 16 && par.le != askpar.le) ||
+           par.bits != askpar.bits ||
+           par.sig != askpar.sig ||
+           par.pchan != askpar.pchan ||
+            par.rate != askpar.rate) {
+               fprintf (stderr, "%s: parameters not supported\n", __func__);
+               xmms_show_message ("Unsupported format", "XMMS requested a "
+                       "format that is not supported by the audio device.\n\n"
+                       "Please try again with the aucat(1) server running.",
+                       "OK", FALSE, NULL, NULL);
+               op_close ();
+               return 0;
+       }
+
+       wrpos = 0;
+       rdpos = 0;
+       sio_onmove (hdl, onmove_cb, NULL);
+
+       op_set_volume (volume, volume);
+
+       paused = 0;
+       if (!sio_start (hdl)) {
+               fprintf (stderr, "%s: failed to start audio device\n",
+                       __func__);
+               op_close ();
+               return 0;
+       }
+
+       bytes_per_sec = par.bps * par.pchan * par.rate;
+       return 1;
+}
+
+static void
+op_write (void *ptr, int len)
+{
+       if (!paused)
+               wrpos += sio_write (hdl, ptr, len);
+}
+
+static void
+op_close (void)
+{
+       if (hdl != NULL) {
+               sio_close (hdl);
+               hdl = NULL;
+       }
+}
+
+static void
+op_seek (int time_ms)
+{
+       int bufused = (rdpos < 0) ? wrpos : wrpos - rdpos;
+       rdpos = time_ms / 1000 * bytes_per_sec;
+       wrpos = rdpos + bufused;
+}
+
+static void
+op_pause (short flag)
+{
+       paused = flag;
+}
+
+static int
+op_buffer_free (void)
+{
+#define MAGIC 1000000 /* See Output/{OSS,sun,esd}/audio.c */
+       return paused ? 0 : MAGIC; 
+}
+
+static int
+op_playing (void)
+{
+       return paused ? TRUE : FALSE;
+}
+
+static int
+op_get_output_time (void)
+{
+       return hdl ? rdpos * 1000 / bytes_per_sec : 0;
+}
+
+static int
+op_get_written_time (void)
+{
+       return hdl ? wrpos * 1000 / bytes_per_sec : 0;
+}
+
+static void
+onmove_cb (void *addr, int delta)
+{
+       rdpos += delta * (int)(par.bps * par.pchan);
+}
+
+static void op_configure(void)
+{
+       GtkWidget *dev_vbox;
+       GtkWidget *adevice_frame, *adevice_text, *adevice_vbox;
+       GtkWidget *bbox, *ok, *cancel;
+
+       if (configure_win) {
+               gdk_window_raise(configure_win->window);
+               return;
+       }
+       configure_win = gtk_window_new(GTK_WINDOW_DIALOG);
+       gtk_signal_connect(GTK_OBJECT(configure_win), "destroy",
+           GTK_SIGNAL_FUNC(configure_win_destroy), NULL);
+
+       gtk_window_set_title(GTK_WINDOW(configure_win), _("sndio device"));
+       gtk_window_set_policy(GTK_WINDOW(configure_win), FALSE, FALSE, FALSE);
+       gtk_window_set_position(GTK_WINDOW(configure_win), GTK_WIN_POS_MOUSE);
+       gtk_container_border_width(GTK_CONTAINER(configure_win), 10);
+
+       dev_vbox = gtk_vbox_new(FALSE, 5);
+       gtk_container_add(GTK_CONTAINER(configure_win), dev_vbox);
+       gtk_container_set_border_width(GTK_CONTAINER(dev_vbox), 5);
+
+       adevice_frame = gtk_frame_new(_("Audio device:"));
+       gtk_box_pack_start(GTK_BOX(dev_vbox), adevice_frame, FALSE, FALSE, 0);
+
+       adevice_vbox = gtk_vbox_new(FALSE, 5);
+       gtk_container_set_border_width(GTK_CONTAINER(adevice_vbox), 5);
+       gtk_container_add(GTK_CONTAINER(adevice_frame), adevice_vbox);
+
+       adevice_text = gtk_label_new(_("(empty means default)"));
+       gtk_box_pack_start_defaults(GTK_BOX(adevice_vbox), adevice_text);
+
+       adevice_entry = gtk_entry_new();
+       gtk_entry_set_text(GTK_ENTRY(adevice_entry), audiodev);
+       gtk_box_pack_start_defaults(GTK_BOX(adevice_vbox), adevice_entry);
+
+       bbox = gtk_hbutton_box_new();
+       gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
+       gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5);
+       gtk_box_pack_start(GTK_BOX(dev_vbox), bbox, FALSE, FALSE, 0);
+
+       ok = gtk_button_new_with_label(_("OK"));
+       gtk_signal_connect(GTK_OBJECT(ok), "clicked",
+           GTK_SIGNAL_FUNC(configure_win_ok_cb), NULL);
+
+       GTK_WIDGET_SET_FLAGS(ok, GTK_CAN_DEFAULT);
+       gtk_box_pack_start(GTK_BOX(bbox), ok, TRUE, TRUE, 0);
+       gtk_widget_grab_default(ok);
+
+       cancel = gtk_button_new_with_label(_("Cancel"));
+       gtk_signal_connect_object(GTK_OBJECT(cancel), "clicked",
+           GTK_SIGNAL_FUNC(configure_win_cancel_cb),
+           GTK_OBJECT(configure_win));
+
+       GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT);
+       gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0);
+
+       gtk_widget_show_all(configure_win);
+}
+
+static void
+configure_win_ok_cb(GtkWidget *w, gpointer data)
+{
+       ConfigFile *cfgfile;
+
+       strlcpy(audiodev, gtk_entry_get_text(GTK_ENTRY(adevice_entry)),
+           PATH_MAX);
+
+       cfgfile = xmms_cfg_open_default_file();
+       xmms_cfg_write_string(cfgfile, "sndio", "audiodev", audiodev);
+       xmms_cfg_write_default_file(cfgfile);
+       xmms_cfg_free(cfgfile);
+
+       gtk_widget_destroy(configure_win);
+}
+
+static void
+configure_win_cancel_cb(GtkWidget *w, gpointer data)
+{
+       gtk_widget_destroy(configure_win);
+}
+
+static void
+configure_win_destroy(void)
+{
+       configure_win = NULL;
+}
Index: patches/patch-Output_Makefile_am
===================================================================
RCS file: patches/patch-Output_Makefile_am
diff -N patches/patch-Output_Makefile_am
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-Output_Makefile_am    24 Dec 2008 10:28:12 -0000
@@ -0,0 +1,7 @@
+$OpenBSD$
+--- Output/Makefile.am.orig    Sat Dec 20 02:20:46 2008
++++ Output/Makefile.am Mon May 19 14:22:06 2003
+@@ -1,2 +1,2 @@
+-ALL_PLUGINS = OSS esd disk_writer solaris sun alsa
++ALL_PLUGINS = OSS esd disk_writer solaris sun alsa sndio
+ SUBDIRS = @OUTPUT_PLUGINS@
Index: patches/patch-configure_in
===================================================================
RCS file: /home2/cvs/OpenBSD/ports/audio/xmms/patches/patch-configure_in,v
retrieving revision 1.8
diff -u -r1.8 patch-configure_in
--- patches/patch-configure_in  8 Dec 2007 21:54:57 -0000       1.8
+++ patches/patch-configure_in  24 Dec 2008 10:28:12 -0000
@@ -1,7 +1,49 @@
 $OpenBSD: patch-configure_in,v 1.8 2007/12/08 21:54:57 ajacoutot Exp $
---- configure.in.orig  Fri Nov 16 22:52:30 2007
-+++ configure.in       Fri Nov 23 16:25:25 2007
-@@ -607,7 +607,7 @@ AC_SUBST([GENERAL_PLUGIN_DIR])
+--- configure.in.orig  Fri Nov 16 13:52:30 2007
++++ configure.in       Sat Dec 20 19:15:06 2008
+@@ -423,7 +423,8 @@ dnl ***
+ LIBS_save=$LIBS
+ CFLAGS_save=$CFLAGS
+ LDFLAGS_save=$LDFLAGS
+-AM_PATH_ALSA([0.9.0], [have_alsa=yes], [have_alsa=no])
++dnl AM_PATH_ALSA([0.9.0], [have_alsa=yes], [have_alsa=no])
++have_alsa=no
+ AM_CONDITIONAL([HAVE_ALSA], [test "x${have_alsa}" = "xyes"])
+ LIBS=$LIBS_save
+ CFLAGS=$CFLAGS_save
+@@ -449,7 +450,31 @@ if test "x$xmms_cv_newpcm_driver" = "xyes"; then
+       AC_DEFINE([HAVE_NEWPCM], [1], [Define if you have the FreeBSD newpcm 
driver])
+ fi
+ 
++dnl *** Check for libsndio
++SNDIO_LIBS=
++AC_ARG_ENABLE([sndio],
++      [  --disable-sndio           disable the libsndio output plugin],
++      [have_sndio=$enableval], [have_sndio=yes])
+ 
++if test "x$have_sndio" = "xauto"; then
++    AC_CHECK_HEADERS([sndio.h])
++    if test "x${ac_cv_header_sndio_h}" = "xyes"; then
++        have_sndio=yes
++    fi
++    if test "x${have_sndio}" = "xyes"; then
++        AC_CHECK_LIB(sndio, sio_open, [have_sndio=yes], [have_sndio=no])
++    fi
++fi
++if test "x$have_sndio" = "xyes"; then
++    AC_DEFINE([HAVE_SNDIO], [1], [Define if the libsndio output plugin should 
be built])
++    SNDIO_LIBS="$LIBS -lsndio"
++else
++    have_sndio=no
++fi
++AM_CONDITIONAL([HAVE_SNDIO], [test "x$have_sndio" = "xyes"])
++AC_SUBST(SNDIO_LIBS)
++    
++
+ AC_CHECK_HEADERS([linux/cdrom.h])
+ AC_CHECK_HEADERS([sys/cdrio.h])
+ AC_CHECK_HEADERS([sys/cdio.h])
+@@ -607,7 +632,7 @@ AC_SUBST([GENERAL_PLUGIN_DIR])
  AC_SUBST([VISUALIZATION_PLUGIN_DIR])
  AC_SUBST([pluginsubs])
  
@@ -10,3 +52,19 @@
  
  if test "x$enable_user_plugin_dir" = "xno"; then
        AC_DEFINE(DISABLE_USER_PLUGIN_DIR,, [Define to disable per user plugin 
directory])
+@@ -635,6 +660,7 @@ Output/Makefile
+ Output/OSS/Makefile
+ Output/esd/Makefile
+ Output/disk_writer/Makefile
++Output/sndio/Makefile
+ Output/solaris/Makefile
+ Output/sun/Makefile
+ Output/alsa/Makefile
+@@ -670,6 +696,7 @@ echo "  Current xmms                $XMMS_PATH"
+ fi
+ 
+ echo "  Build OSS plugin:           $have_oss"
++echo "  Build sndio plugin:         $have_sndio"
+ echo "  Build esd plugin:           $have_esd"
+ echo "  Build Solaris plugin:       $have_solaris"
+ echo "  Build BSD Sun plugin:       $have_sun"
Index: patches/patch-xmms_main_c
===================================================================
RCS file: /home2/cvs/OpenBSD/ports/audio/xmms/patches/patch-xmms_main_c,v
retrieving revision 1.8
diff -u -r1.8 patch-xmms_main_c
--- patches/patch-xmms_main_c   8 Dec 2007 21:54:57 -0000       1.8
+++ patches/patch-xmms_main_c   24 Dec 2008 10:28:12 -0000
@@ -1,7 +1,18 @@
 $OpenBSD: patch-xmms_main_c,v 1.8 2007/12/08 21:54:57 ajacoutot Exp $
 --- xmms/main.c.orig   Sun Jul 16 06:40:04 2006
-+++ xmms/main.c        Sat Dec  8 12:42:03 2007
-@@ -4192,11 +4192,12 @@ int main(int argc, char **argv)
++++ xmms/main.c        Tue Dec 23 23:47:01 2008
+@@ -501,7 +501,9 @@ static void read_config(void)
+               cfg.gentitle_format = g_strdup("%p - %t");
+       if (cfg.outputplugin == NULL)
+       {
+-#ifdef HAVE_OSS
++#if defined(HAVE_SNDIO)
++              cfg.outputplugin = g_strdup_printf("%s/%s/libsndioout.so", 
PLUGIN_DIR, plugin_dir_list[0]);
++#elif defined(HAVE_OSS)
+               cfg.outputplugin = g_strdup_printf("%s/%s/libOSS.so", 
PLUGIN_DIR, plugin_dir_list[0]);
+ #elif defined(sun)
+               cfg.outputplugin = g_strdup_printf("%s/%s/libSolaris.so", 
PLUGIN_DIR, plugin_dir_list[0]);
+@@ -4192,11 +4194,12 @@ int main(int argc, char **argv)
  
        signal(SIGPIPE, SIG_IGN); /* for controlsocket.c */
        signal(SIGSEGV, segfault_handler);
Index: pkg/PLIST-main
===================================================================
RCS file: /home2/cvs/OpenBSD/ports/audio/xmms/pkg/PLIST-main,v
retrieving revision 1.3
diff -u -r1.3 PLIST-main
--- pkg/PLIST-main      8 Dec 2007 21:54:57 -0000       1.3
+++ pkg/PLIST-main      24 Dec 2008 10:28:12 -0000
@@ -1,7 +1,7 @@
 @comment $OpenBSD: PLIST-main,v 1.3 2007/12/08 21:54:57 ajacoutot Exp $
 @pkgpath audio/xmms
-bin/wmxmms
-bin/xmms
+...@bin bin/wmxmms
+...@bin bin/xmms
 bin/xmms-config
 include/xmms/
 include/xmms/configfile.h
@@ -43,6 +43,8 @@
 @comment lib/xmms/Output/libdisk_writer.la
 lib/xmms/Output/libdisk_writer.so
 @comment lib/xmms/Output/libesdout.la
+...@comment lib/xmms/Output/libsndioout.la
+lib/xmms/Output/libsndioout.so
 @comment lib/xmms/Output/libsun.la
 lib/xmms/Output/libsun.so
 lib/xmms/Visualization/

Reply via email to