also remove jason@ as maintainer since that address bounces

-- 
jake...@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org

Index: Makefile
===================================================================
RCS file: /cvs/ports/audio/flite/Makefile,v
retrieving revision 1.10
diff -N -u -p Makefile
--- Makefile    4 Jan 2008 17:48:33 -0000       1.10
+++ Makefile    10 Dec 2009 05:27:36 -0000
@@ -8,7 +8,7 @@ BROKEN=         gcc hang compiling cmu_us_kal_diphone.c
 
 VERSION=       1.2
 DISTNAME=      flite-${VERSION}-release
-PKGNAME=       flite-${VERSION}p1
+PKGNAME=       flite-${VERSION}p2
 SHARED_LIBS=   flite                   1.2 \
                flite_cmu_time_awb      1.2 \
                flite_cmu_us_kal        1.2 \
@@ -27,21 +27,22 @@ CATEGORIES= audio
 
 HOMEPAGE=      http://www.cmuflite.org/
 
-MAINTAINER=    Jason L. Wright <ja...@openbsd.org>
-
 PERMIT_PACKAGE_CDROM=   Yes
 PERMIT_PACKAGE_FTP=     Yes
 PERMIT_DISTFILES_CDROM= Yes
 PERMIT_DISTFILES_FTP=   Yes
-WANTLIB=               c m
+WANTLIB=               c m sndio
 
 MASTER_SITES=  http://www.speech.cs.cmu.edu/flite/packed/flite-${VERSION}/
 
 CONFIGURE_STYLE= gnu dest
-CONFIGURE_ARGS= ${CONFIGURE_SHARED}
+CONFIGURE_ARGS= ${CONFIGURE_SHARED} --with-audio=sndio
 
 USE_GMAKE=     Yes
 NO_REGRESS=    Yes
 VMEM_WARNING=  Yes
+
+post-extract:
+       cp ${FILESDIR}/au_sndio.c ${WRKSRC}/src/audio
 
 .include <bsd.port.mk>
Index: files/au_sndio.c
===================================================================
RCS file: files/au_sndio.c
diff -N -u -p files/au_sndio.c
--- /dev/null   9 Dec 2009 22:27:36 -0000
+++ files/au_sndio.c    10 Dec 2009 05:27:36 -0000
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2009 Jacob Meuser <jake...@sdf.lonestar.org>
+ *
+ * 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 <sndio.h>
+
+#include "cst_string.h"
+#include "cst_audio.h"
+
+cst_audiodev *
+audio_open_sndio(int sps, int channels, cst_audiofmt fmt)
+{
+       struct sio_par par;
+       struct sio_hdl *hdl;
+       cst_audiodev *ad;
+       char *audio_device;
+
+       audio_device = getenv("AUDIODEVICE");
+
+       hdl = sio_open(audio_device, SIO_PLAY, 0);
+       if (hdl == NULL) {
+               cst_errmsg("sndio_audio: failed to open audio device\n");
+               cst_error();
+       }
+
+       sio_initpar(&par);
+       switch (fmt) {
+       case CST_AUDIO_LINEAR16:
+               par.bits = 16;
+               par.sig = 1;
+               break;
+       case CST_AUDIO_LINEAR8:
+               par.bits = 8;
+               par.sig = 0;
+               break;
+       default:
+               cst_errmsg("sndio_audio: invalid format\n");
+               cst_error();
+       }
+
+       par.pchan = 1;
+       par.rate = sps;
+
+       if (!sio_setpar(hdl, &par)) {
+               cst_errmsg("sndio_audio: failed to set audio params\n");
+               cst_error();
+       }
+       if (!sio_getpar(hdl, &par)) {
+               cst_errmsg("sndio_audio: failed to get audio params\n");
+               cst_error();
+       }
+
+       ad = cst_alloc(cst_audiodev, 1);
+
+       ad->sps = sps;
+       ad->real_sps = par.rate;
+
+       ad->channels = channels;
+       ad->real_channels = par.pchan;
+
+       ad->fmt = fmt;
+       if (par.sig == 1 && par.bits == 16)
+               ad->real_fmt = CST_AUDIO_LINEAR16;
+       else if (par.sig == 0 && par.bits == 8)
+               ad->real_fmt = CST_AUDIO_LINEAR8;
+       else {
+               cst_errmsg("sndio_audio: returned audio format unsupported\n");
+               cst_free(ad);
+               cst_error();
+       }
+
+       if (!sio_start(hdl)) {
+               cst_errmsg("sndio_audio: start failed\n");
+               cst_free(ad);
+               cst_error();
+       }
+
+       ad->platform_data = hdl;
+
+       return ad;
+}
+
+int
+audio_close_sndio(cst_audiodev *ad)
+{
+       if (ad == NULL)
+               return 0;
+
+       sio_close(ad->platform_data);
+
+       cst_free(ad);
+
+       return 0;
+}
+
+int
+audio_write_sndio(cst_audiodev *ad, void *samples, int num_bytes)
+{
+       return sio_write(ad->platform_data, samples, num_bytes);
+}
+
+int
+audio_flush_sndio(cst_audiodev *ad)
+{
+       return 0;
+}
+
+int
+audio_drain_sndio(cst_audiodev *ad)
+{
+       return 0;
+}
Index: patches/patch-configure
===================================================================
RCS file: /cvs/ports/audio/flite/patches/patch-configure,v
retrieving revision 1.1.1.1
diff -N -u -p patches/patch-configure
--- patches/patch-configure     23 Apr 2003 05:33:19 -0000      1.1.1.1
+++ patches/patch-configure     10 Dec 2009 05:27:36 -0000
@@ -1,6 +1,6 @@
 $OpenBSD: patch-configure,v 1.1.1.1 2003/04/23 05:33:19 jason Exp $
---- configure.orig     Sun Apr 20 23:05:35 2003
-+++ configure  Sun Apr 20 23:04:27 2003
+--- configure.orig     Tue Feb 18 08:18:20 2003
++++ configure  Wed Dec  9 20:13:56 2009
 @@ -1120,6 +1120,9 @@ if test "$shared" = true; then
                SHFLAGS="-fPIC"
                OTHERLIBS="-lsocket -ldl"
@@ -11,3 +11,33 @@ $OpenBSD: patch-configure,v 1.1.1.1 2003/04/23 05:33:1
        *)
        ;;
     esac
+@@ -1492,7 +1495,7 @@ if test "${with_audio+set}" = set; then
+ fi
+ 
+ 
+-if test "x$AUDIODEFS" = x; then
++#if test "x$AUDIODEFS" = x; then
+     case "$AUDIODRIVER" in
+       linux|oss)
+           AUDIODRIVER=oss
+@@ -1502,6 +1505,11 @@ if test "x$AUDIODEFS" = x; then
+           AUDIODRIVER=oss
+           AUDIODEFS=-DCST_AUDIO_FREEBSD
+           ;;
++      sndio)
++          AUDIODRIVER=sndio
++          AUDIODEFS=-DCST_AUDIO_SNDIO
++          AUDIOLIBS=-lsndio
++          ;;
+       qnx)
+           AUDIODRIVER=alsa
+           AUDIODEFS=-DCST_AUDIO_QNX
+@@ -1510,7 +1518,7 @@ if test "x$AUDIODEFS" = x; then
+           AUDIODEFS=-DCST_AUDIO_NONE
+           ;;
+     esac
+-fi
++#fi
+ 
+ 
+ 
Index: patches/patch-configure_in
===================================================================
RCS file: /cvs/ports/audio/flite/patches/patch-configure_in,v
retrieving revision 1.1.1.1
diff -N -u -p patches/patch-configure_in
--- patches/patch-configure_in  23 Apr 2003 05:33:19 -0000      1.1.1.1
+++ /dev/null   10 Dec 2009 04:31:01 -0000
@@ -1,13 +0,0 @@
-$OpenBSD: patch-configure_in,v 1.1.1.1 2003/04/23 05:33:19 jason Exp $
---- configure.in.orig  Sun Apr 20 23:05:32 2003
-+++ configure.in       Sun Apr 20 23:04:58 2003
-@@ -68,6 +68,9 @@ if test "$shared" = true; then
-               SHFLAGS="-fPIC"
-               OTHERLIBS="-lsocket -ldl"
-         ;;
-+      openbsd*)
-+              SHFLAGS="-shared -fPIC"
-+      ;;
-       *)
-       ;;
-    esac
Index: patches/patch-src_audio_Makefile
===================================================================
RCS file: patches/patch-src_audio_Makefile
diff -N -u -p patches/patch-src_audio_Makefile
--- /dev/null   9 Dec 2009 22:27:36 -0000
+++ patches/patch-src_audio_Makefile    10 Dec 2009 05:27:36 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- src/audio/Makefile.orig    Wed Dec  9 19:24:16 2009
++++ src/audio/Makefile Wed Dec  9 19:24:35 2009
+@@ -45,7 +45,7 @@ BASESRCS = auclient.c auserver.c audio.c 
+ SRCS = $(BASESRCS) $(AUDIODRIVER:%=au_%.c)
+ OBJS = $(SRCS:.c=.o)
+ FILES = Makefile $(H) $(BASESRCS) au_alsa.c au_command.c au_none.c \
+-      au_oss.c au_sun.c au_wince.c
++      au_oss.c au_sun.c au_wince.c au_sndio.c
+ LIBNAME = flite
+ 
+ LOCAL_INCLUDES = -I. $(AUDIODEFS)
Index: patches/patch-src_audio_au_sun_c
===================================================================
RCS file: /cvs/ports/audio/flite/patches/patch-src_audio_au_sun_c,v
retrieving revision 1.1.1.1
diff -N -u -p patches/patch-src_audio_au_sun_c
--- patches/patch-src_audio_au_sun_c    23 Apr 2003 05:33:19 -0000      1.1.1.1
+++ /dev/null   10 Dec 2009 04:31:01 -0000
@@ -1,23 +0,0 @@
-$OpenBSD: patch-src_audio_au_sun_c,v 1.1.1.1 2003/04/23 05:33:19 jason Exp $
---- src/audio/au_sun.c.orig    Mon Jan  7 18:25:52 2002
-+++ src/audio/au_sun.c Sun Apr 20 18:12:34 2003
-@@ -45,6 +45,7 @@
- #include <sys/stat.h>
- #include <fcntl.h>
- #include <errno.h>
-+#include <sys/ioctl.h>
- #include <sys/filio.h>
- #include <sys/audioio.h>
- #include "cst_string.h"
-@@ -76,7 +77,11 @@ cst_audiodev *audio_open_sun(int sps, in
-           cst_error();
-       }
-     }
-+#ifdef __OpenBSD__
-+    AUDIO_INITINFO(&ainfo);
-+#else
-     ioctl(fd,AUDIO_GETINFO,&ainfo);
-+#endif
- 
-     switch (fmt)
-     {
Index: patches/patch-src_audio_native_audio_h
===================================================================
RCS file: patches/patch-src_audio_native_audio_h
diff -N -u -p patches/patch-src_audio_native_audio_h
--- /dev/null   9 Dec 2009 22:27:36 -0000
+++ patches/patch-src_audio_native_audio_h      10 Dec 2009 05:27:36 -0000
@@ -0,0 +1,21 @@
+$OpenBSD$
+--- src/audio/native_audio.h.orig      Wed Dec  9 19:46:49 2009
++++ src/audio/native_audio.h   Wed Dec  9 19:48:27 2009
+@@ -63,6 +63,17 @@
+ 
+ #endif
+ 
++#ifdef CST_AUDIO_SNDIO
++
++#define AUDIO_OPEN_NATIVE audio_open_sndio
++#define AUDIO_CLOSE_NATIVE audio_close_sndio
++#define AUDIO_SET_SAMPLE_RATE_NATIVE audio_set_sample_rate_sndio
++#define AUDIO_WRITE_NATIVE audio_write_sndio
++#define AUDIO_DRAIN_NATIVE audio_drain_sndio
++#define AUDIO_FLUSH_NATIVE audio_flush_sndio
++
++#endif
++
+ #ifdef CST_AUDIO_LINUX
+ 
+ #define AUDIO_OPEN_NATIVE audio_open_oss
Index: patches/patch-tools_find_sts_main_c
===================================================================
RCS file: /cvs/ports/audio/flite/patches/patch-tools_find_sts_main_c,v
retrieving revision 1.1
diff -N -u -p patches/patch-tools_find_sts_main_c
--- patches/patch-tools_find_sts_main_c 13 Dec 2004 11:59:48 -0000      1.1
+++ patches/patch-tools_find_sts_main_c 10 Dec 2009 05:27:36 -0000
@@ -1,7 +1,7 @@
 $OpenBSD: patch-tools_find_sts_main_c,v 1.1 2004/12/13 11:59:48 espie Exp $
---- tools/find_sts_main.c.orig Mon Dec 13 12:55:55 2004
-+++ tools/find_sts_main.c      Mon Dec 13 12:58:01 2004
-@@ -75,6 +75,11 @@ cst_sts *find_sts(cst_wave *sig, cst_tra
+--- tools/find_sts_main.c.orig Thu Dec 26 09:18:30 2002
++++ tools/find_sts_main.c      Wed Dec  9 19:23:23 2009
+@@ -75,6 +75,11 @@ cst_sts *find_sts(cst_wave *sig, cst_track *lpc)
      double *resd;
      int size,start,end;
      short *sigplus;
@@ -13,7 +13,7 @@ $OpenBSD: patch-tools_find_sts_main_c,v 1.1 2004/12/13
  
      sts = cst_alloc(cst_sts,lpc->num_frames);
      start = 0;
-@@ -93,14 +98,16 @@ cst_sts *find_sts(cst_wave *sig, cst_tra
+@@ -93,14 +98,16 @@ cst_sts *find_sts(cst_wave *sig, cst_track *lpc)
                        lpc->frames[i],lpc->num_channels,
                        resd,
                        size);
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/audio/flite/pkg/PLIST,v
retrieving revision 1.2
diff -N -u -p pkg/PLIST
--- pkg/PLIST   5 Aug 2004 03:28:12 -0000       1.2
+++ pkg/PLIST   10 Dec 2009 05:27:36 -0000
@@ -1,6 +1,6 @@
 @comment $OpenBSD: PLIST,v 1.2 2004/08/05 03:28:12 espie Exp $
-bin/flite
-bin/flite_time
+...@bin bin/flite
+...@bin bin/flite_time
 include/flite/
 include/flite/cst_alloc.h
 include/flite/cst_args.h

Reply via email to