This doesn't change any functionality compared to Alexandre's patch,
but it cleans up a number of cosmetic issues.
Index: Makefile
===================================================================
RCS file: /cvs/ports/audio/libao/Makefile,v
retrieving revision 1.41
diff -u -r1.41 Makefile
--- Makefile 11 Dec 2007 22:02:11 -0000 1.41
+++ Makefile 29 Oct 2008 16:41:03 -0000
@@ -6,7 +6,7 @@
VERSION= 0.8.8
DISTNAME= libao-${VERSION}
-PKGNAME-main= libao-${VERSION}p0
+PKGNAME-main= libao-${VERSION}p1
PKGNAME-arts= libao-arts-${VERSION}
PKGNAME-esd= libao-esd-${VERSION}
CATEGORIES= audio
@@ -36,7 +36,10 @@
USE_LIBTOOL= Yes
SEPARATE_BUILD= simple
-CONFIGURE_STYLE=gnu
+AUTOCONF_VERSION = 2.61
+AUTOMAKE_VERSION = 1.9
+CONFIGURE_STYLE= no-autoheader automake autoconf
+
CONFIGURE_ARGS= ${CONFIGURE_SHARED} --enable-static
.if ${FLAVOR:L:Mno_arts}
CONFIGURE_ARGS+=--disable-arts
@@ -53,7 +56,7 @@
LIB_DEPENDS-main=
RUN_DEPENDS-main=
-WANTLIB-main= pthread
+WANTLIB-main= pthread sndio
LIB_DEPENDS-arts= ${MODGETTEXT_LIB_DEPENDS} \
artsc::x11/kde/arts3
@@ -65,10 +68,22 @@
RUN_DEPENDS-esd= :libao-${VERSION}:audio/libao
WANTLIB-esd= audiofile m pthread
+post-patch:
+ mkdir ${WRKSRC}/src/plugins/sndio
+ cp ${FILESDIR}/Makefile.am ${FILESDIR}/ao_sndio.c \
+ ${WRKSRC}/src/plugins/sndio
+ cd ${WRKSRC}; AUTOCONF_VERSION=${AUTOCONF_VERSION} \
+ AUTOMAKE_VERSION=${AUTOMAKE_VERSION} aclocal
+
+pre-configure:
+ cd ${WRKSRC}; AUTOCONF_VERSION=${AUTOCONF_VERSION} \
+ AUTOMAKE_VERSION=${AUTOMAKE_VERSION} automake \
+ --foreign --add-missing --copy
+
pre-build:
@perl -i -pe 's:/etc/libao.conf:${SYSCONFDIR}/libao.conf:g' \
- ${WRKDIST}/src/ao_private.h \
- ${WRKDIST}/libao.conf.5 \
- ${WRKDIST}/doc/config.html
+ ${WRKDIST}/src/ao_private.h \
+ ${WRKDIST}/libao.conf.5 \
+ ${WRKDIST}/doc/config.html
.include <bsd.port.mk>
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 29 Oct 2008 16:41:03 -0000
@@ -0,0 +1,26 @@
+## Process this file with automake to produce Makefile.in
+
+AUTOMAKE_OPTIONS = foreign
+
+if HAVE_SNDIO_AUDIO
+
+sndioltlibs = libsndio.la
+sndiosources = ao_sndio.c
+
+else
+
+sndioltlibs =
+sndiosources =
+
+endif
+
+INCLUDES = -I$(top_builddir)/include/ao -I$(top_srcdir)/include
+
+libdir = $(plugindir)
+lib_LTLIBRARIES = $(sndioltlibs)
+
+libsndio_la_LDFLAGS = @PLUGIN_LDFLAGS@
+libsndio_la_LIBADD = -lsndio
+libsndio_la_SOURCES = $(sndiosources)
+
+EXTRA_DIST = ao_sndio.c
Index: files/ao_sndio.c
===================================================================
RCS file: files/ao_sndio.c
diff -N files/ao_sndio.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ files/ao_sndio.c 29 Oct 2008 16:41:03 -0000
@@ -0,0 +1,112 @@
+/*
+ *
+ * ao_sndio.c
+ *
+ * Copyright (C) Alexandre Ratchov - 2008
+ *
+ * libao is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * libao is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+#include <sndio.h>
+#include <ao/ao.h>
+#include <ao/plugin.h>
+
+ao_info ao_sndio_info = {
+ AO_TYPE_LIVE,
+ "sndio audio output",
+ "sndio",
+ "Alexandre Ratchov <[EMAIL PROTECTED]>",
+ "Outputs to the sndio library",
+ AO_FMT_NATIVE,
+ 30,
+ NULL, /* no options */
+ 0 /* zero options */
+};
+
+int ao_plugin_test()
+{
+ struct sio_hdl *hdl;
+
+ hdl = sio_open(NULL, SIO_PLAY, 0);
+ if (hdl == NULL)
+ return 0;
+ sio_close(hdl);
+ return 1;
+}
+
+ao_info *ao_plugin_driver_info(void)
+{
+ return &ao_sndio_info;
+}
+
+int ao_plugin_device_init(ao_device *device)
+{
+ struct sio_hdl *hdl;
+
+ hdl = sio_open(NULL, SIO_PLAY, 0);
+ if (hdl == NULL)
+ return 0;
+ device->internal = hdl;
+ return 1;
+}
+
+int ao_plugin_set_option(ao_device *device, const char *key, const char *value)
+{
+ return 1;
+}
+
+int ao_plugin_open(ao_device *device, ao_sample_format *format)
+{
+ struct sio_hdl *hdl = (struct sio_hdl *)device->internal;
+ struct sio_par par;
+
+ sio_initpar(&par);
+ par.sig = 1;
+ par.le = SIO_LE_NATIVE;
+ par.bits = format->bits;
+ par.rate = format->rate;
+ par.pchan = format->channels;
+ if (!sio_setpar(hdl, &par))
+ return 0;
+ device->driver_byte_format = AO_FMT_NATIVE;
+ if (!sio_start(hdl))
+ return 0;
+ return 1;
+}
+
+int ao_plugin_play(ao_device *device, const char *output_samples, uint_32
num_bytes)
+{
+ struct sio_hdl *hdl = (struct sio_hdl *)device->internal;
+
+ if (!sio_write(hdl, output_samples, num_bytes))
+ return 0;
+ return 1;
+}
+
+int ao_plugin_close(ao_device *device)
+{
+ struct sio_hdl *hdl = (struct sio_hdl *)device->internal;
+
+ if (!sio_stop(hdl))
+ return 0;
+ return 1;
+}
+
+void ao_plugin_device_clear(ao_device *device)
+{
+ struct sio_hdl *hdl = (struct sio_hdl *)device->internal;
+
+ sio_close(hdl);
+}
Index: patches/patch-configure
===================================================================
RCS file: patches/patch-configure
diff -N patches/patch-configure
--- patches/patch-configure 12 Jul 2007 21:10:15 -0000 1.9
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,25 +0,0 @@
-$OpenBSD: patch-configure,v 1.9 2007/07/12 21:10:15 naddy Exp $
---- configure.orig Thu May 24 12:51:52 2007
-+++ configure Wed Jul 11 21:58:16 2007
-@@ -20076,7 +20076,7 @@ if test -z "$GCC"; then
- *)
- PLUGIN_LDFLAGS="-export-dynamic -avoid-version"
- DEBUG="-g"
-- CFLAGS="-O"
-+ CFLAGS=""
- PROFILE="-g -p" ;;
- esac
- else
-@@ -20099,9 +20099,9 @@ else
- PROFILE="-g -pg -D__NO_MATH_INLINES -fsigned-char
-Ddlsym=dlsym_auto_underscore" ;;
- *)
- PLUGIN_LDFLAGS="-export-dynamic -avoid-version"
-- DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char"
-- CFLAGS="-O20 -D__NO_MATH_INLINES -fsigned-char"
-- PROFILE="-O20 -g -pg -D__NO_MATH_INLINES -fsigned-char" ;;
-+ DEBUG="-g -Wall -fsigned-char"
-+ CFLAGS="-fsigned-char"
-+ PROFILE="-g -pg -fsigned-char" ;;
- esac
- fi
- CFLAGS="$CFLAGS $cflags_save"
Index: patches/patch-configure_ac
===================================================================
RCS file: patches/patch-configure_ac
diff -N patches/patch-configure_ac
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-configure_ac 29 Oct 2008 16:41:03 -0000
@@ -0,0 +1,34 @@
+$OpenBSD$
+--- configure.ac.orig Thu May 24 12:51:05 2007
++++ configure.ac Wed Oct 29 17:25:35 2008
+@@ -90,9 +90,9 @@ else
+ PROFILE="-g -pg -D__NO_MATH_INLINES -fsigned-char
-Ddlsym=dlsym_auto_underscore" ;;
+ *)
+ PLUGIN_LDFLAGS="-export-dynamic -avoid-version"
+- DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char"
+- CFLAGS="-O20 -D__NO_MATH_INLINES -fsigned-char"
+- PROFILE="-O20 -g -pg -D__NO_MATH_INLINES -fsigned-char" ;;
++ DEBUG="-g -Wall -fsigned-char"
++ CFLAGS="-fsigned-char"
++ PROFILE="-g -pg -fsigned-char" ;;
+ esac
+ fi
+ CFLAGS="$CFLAGS $cflags_save"
+@@ -300,6 +300,11 @@ dnl Check for Sun audio
+ AC_CHECK_HEADERS(sys/audioio.h)
+ AM_CONDITIONAL(HAVE_SUN_AUDIO,test "${ac_cv_header_sys_audioio_h}" = yes)
+
++dnl Check for libsndio audio
++
++AC_CHECK_HEADERS(sndio.h)
++AM_CONDITIONAL(HAVE_SNDIO_AUDIO,test "${ac_cv_header_sndio_h}" = yes)
++
+ dnl Check for AIX audio
+
+ case $host in
+@@ -415,4 +420,4 @@ dnl Plugins get special LDFLAGS
+ AC_SUBST(PLUGIN_LDFLAGS)
+
+
+-AC_OUTPUT(Makefile src/Makefile doc/Makefile include/Makefile
include/ao/Makefile include/ao/os_types.h src/plugins/Makefile
src/plugins/esd/Makefile src/plugins/oss/Makefile src/plugins/alsa/Makefile
src/plugins/alsa09/Makefile src/plugins/sun/Makefile src/plugins/irix/Makefile
src/plugins/arts/Makefile src/plugins/macosx/Makefile src/plugins/nas/Makefile
src/plugins/pulse/Makefile ao.pc)
++AC_OUTPUT(Makefile src/Makefile doc/Makefile include/Makefile
include/ao/Makefile include/ao/os_types.h src/plugins/Makefile
src/plugins/esd/Makefile src/plugins/oss/Makefile src/plugins/alsa/Makefile
src/plugins/alsa09/Makefile src/plugins/sun/Makefile src/plugins/irix/Makefile
src/plugins/arts/Makefile src/plugins/macosx/Makefile src/plugins/nas/Makefile
src/plugins/pulse/Makefile src/plugins/sndio/Makefile ao.pc)
Index: patches/patch-doc_Makefile_am
===================================================================
RCS file: patches/patch-doc_Makefile_am
diff -N patches/patch-doc_Makefile_am
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-doc_Makefile_am 29 Oct 2008 16:41:03 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- doc/Makefile.am.orig Thu May 24 11:19:08 2007
++++ doc/Makefile.am Wed Oct 29 17:25:35 2008
+@@ -2,7 +2,7 @@
+
+ AUTOMAKE_OPTIONS = foreign
+
+-docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)
++docdir = $(datadir)/doc/$(PACKAGE)
+
+ # We list all of these as opposed to using a wildcard so that
+ # building outside the source directory works.
Index: patches/patch-doc_Makefile_in
===================================================================
RCS file: patches/patch-doc_Makefile_in
diff -N patches/patch-doc_Makefile_in
--- patches/patch-doc_Makefile_in 12 Jul 2007 21:10:15 -0000 1.7
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-$OpenBSD: patch-doc_Makefile_in,v 1.7 2007/07/12 21:10:15 naddy Exp $
---- doc/Makefile.in.orig Wed Jul 11 21:56:58 2007
-+++ doc/Makefile.in Wed Jul 11 21:57:09 2007
-@@ -161,7 +161,7 @@ build_vendor = @build_vendor@
- builddir = @builddir@
- datadir = @datadir@
- datarootdir = @datarootdir@
--docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)
-+docdir = $(datadir)/doc/$(PACKAGE)
- dvidir = @dvidir@
- exec_prefix = @exec_prefix@
- host = @host@
Index: patches/patch-src_plugins_Makefile_am
===================================================================
RCS file: patches/patch-src_plugins_Makefile_am
diff -N patches/patch-src_plugins_Makefile_am
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_plugins_Makefile_am 29 Oct 2008 16:41:03 -0000
@@ -0,0 +1,10 @@
+$OpenBSD$
+--- src/plugins/Makefile.am.orig Thu May 24 11:19:07 2007
++++ src/plugins/Makefile.am Wed Oct 29 17:25:35 2008
+@@ -1,4 +1,5 @@
+ ## Process this file with automake to produce Makefile.in
+
+ AUTOMAKE_OPTIONS = foreign
+-SUBDIRS = oss esd arts alsa alsa09 sun irix macosx nas pulse
++SUBDIRS = oss esd arts alsa alsa09 sun irix macosx nas pulse sndio
++AM_MAKEFLAGS = LIBTOOL="$(LIBTOOL) --tag=disable-static"
Index: patches/patch-src_plugins_Makefile_in
===================================================================
RCS file: patches/patch-src_plugins_Makefile_in
diff -N patches/patch-src_plugins_Makefile_in
--- patches/patch-src_plugins_Makefile_in 12 Jul 2007 21:10:15 -0000
1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-$OpenBSD: patch-src_plugins_Makefile_in,v 1.3 2007/07/12 21:10:15 naddy Exp $
---- src/plugins/Makefile.in.orig Thu Jul 12 21:05:42 2007
-+++ src/plugins/Makefile.in Thu Jul 12 21:06:21 2007
-@@ -259,7 +259,7 @@ $(RECURSIVE_TARGETS):
- else \
- local_target="$$target"; \
- fi; \
-- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) LIBTOOL="$(LIBTOOL)
--tag=disable-static" $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
Index: pkg/DESCR-main
===================================================================
RCS file: /cvs/ports/audio/libao/pkg/DESCR-main,v
retrieving revision 1.1
diff -u -r1.1 DESCR-main
--- pkg/DESCR-main 24 Nov 2006 16:22:21 -0000 1.1
+++ pkg/DESCR-main 29 Oct 2008 16:41:03 -0000
@@ -5,4 +5,5 @@
* raw output
* AU files
* WAV files
- * sun (OpenBSD's native sound system)
+ * sun
+ * sndio (OpenBSD's native sound system)
Index: pkg/PFRAG.shared-main
===================================================================
RCS file: /cvs/ports/audio/libao/pkg/PFRAG.shared-main,v
retrieving revision 1.2
diff -u -r1.2 PFRAG.shared-main
--- pkg/PFRAG.shared-main 12 Jul 2007 21:10:15 -0000 1.2
+++ pkg/PFRAG.shared-main 29 Oct 2008 16:41:03 -0000
@@ -1,6 +1,8 @@
@comment $OpenBSD: PFRAG.shared-main,v 1.2 2007/07/12 21:10:15 naddy Exp $
lib/ao/
lib/ao/plugins-2/
[EMAIL PROTECTED] lib/ao/plugins-2/libsndio.la
+lib/ao/plugins-2/libsndio.so
@comment lib/ao/plugins-2/libsun.la
lib/ao/plugins-2/libsun.so
@lib lib/libao.so.${LIBao_VERSION}
--
Christian "naddy" Weisgerber [EMAIL PROTECTED]