On Tue, 12 Apr 2011, Christian Weisgerber wrote: > David Coppa <dco...@gmail.com> wrote: > > > Does anybody remember why audio/libsndfile is built using > > "--disable-external-libs" ? > > IIRC, we wanted to avoid the dependencies to keep things small and > simple.
The following diff updates libsndfile to version 1.0.24. sndio support has been merged upstream, so patches can go away. Ok? Ciao, David Index: Makefile =================================================================== RCS file: /cvs/ports/audio/libsndfile/Makefile,v retrieving revision 1.19 diff -u -p -r1.19 Makefile --- Makefile 18 Oct 2010 16:52:45 -0000 1.19 +++ Makefile 13 Apr 2011 08:16:01 -0000 @@ -2,10 +2,10 @@ COMMENT= library to handle various audio file formats -DISTNAME= libsndfile-1.0.21 +DISTNAME= libsndfile-1.0.24 CATEGORIES= audio HOMEPAGE= http://www.mega-nerd.com/libsndfile/ -SHARED_LIBS += sndfile 3.2 # .1.21 +SHARED_LIBS += sndfile 3.3 # .1.24 # LGPLv2.1 PERMIT_PACKAGE_CDROM= Yes @@ -23,9 +23,7 @@ CONFIGURE_ARGS= ${CONFIGURE_SHARED} \ --disable-alsa \ --disable-external-libs \ --disable-octave \ - --disable-sqlite \ - --disable-shave -CONFIGURE_ENV= CPPFLAGS="-DUSE_SNDIO" + --disable-sqlite MODGNU_CONFIG_GUESS_DIRS=${WRKSRC}/Cfg USE_GROFF = Yes Index: distinfo =================================================================== RCS file: /cvs/ports/audio/libsndfile/distinfo,v retrieving revision 1.11 diff -u -p -r1.11 distinfo --- distinfo 2 Jan 2010 17:53:27 -0000 1.11 +++ distinfo 13 Apr 2011 08:16:01 -0000 @@ -1,5 +1,5 @@ -MD5 (libsndfile-1.0.21.tar.gz) = iApA7GNqshhbl/iScpmykg== -RMD160 (libsndfile-1.0.21.tar.gz) = P000cq6/JLAsLOPzcAI/UAlsH70= -SHA1 (libsndfile-1.0.21.tar.gz) = E2hFqLtWeeAz+PU/uY3ete6PHZc= -SHA256 (libsndfile-1.0.21.tar.gz) = fpCDolUf80cnbYLNth8rT5zRN8C3ZDOADpkVg97Y6mc= -SIZE (libsndfile-1.0.21.tar.gz) = 1014722 +MD5 (libsndfile-1.0.24.tar.gz) = j4I8MMHY1Egw22q4RdZnng== +RMD160 (libsndfile-1.0.24.tar.gz) = Ws6II7O0RXboz17I+o1Gk12Ps1A= +SHA1 (libsndfile-1.0.24.tar.gz) = reLa0nK1L2G7WKyjpABLKFSe4Pg= +SHA256 (libsndfile-1.0.24.tar.gz) = tgUOb7+7csi/vIlRBGl6SvHUkHemTkhG4L56+HyeVqQ= +SIZE (libsndfile-1.0.24.tar.gz) = 963034 Index: patches/patch-man_Makefile_in =================================================================== RCS file: patches/patch-man_Makefile_in diff -N patches/patch-man_Makefile_in --- patches/patch-man_Makefile_in 2 Jan 2010 17:53:27 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -$OpenBSD: patch-man_Makefile_in,v 1.1 2010/01/02 17:53:27 naddy Exp $ ---- man/Makefile.in.orig Tue Dec 29 21:14:33 2009 -+++ man/Makefile.in Tue Dec 29 21:14:44 2009 -@@ -505,7 +505,7 @@ uninstall-man: uninstall-man1 - - # Same manpage for both programs. - sndfile-metadata-set.1 : sndfile-metadata-get.1 -- $(LN_S) $< $@ -+ $(LN_S) $? $@ - - # Tell versions [3.59,3.63) of GNU make to not export all variables. - # Otherwise a system limit (for SysV at least) may be exceeded. Index: patches/patch-programs_Makefile_in =================================================================== RCS file: patches/patch-programs_Makefile_in diff -N patches/patch-programs_Makefile_in --- patches/patch-programs_Makefile_in 2 Jan 2010 17:53:27 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -$OpenBSD: patch-programs_Makefile_in,v 1.1 2010/01/02 17:53:27 naddy Exp $ ---- programs/Makefile.in.orig Tue Dec 29 13:49:47 2009 -+++ programs/Makefile.in Tue Dec 29 13:50:08 2009 -@@ -301,7 +301,7 @@ EXTRA_DIST = sndfile-play-beos.cpp test-sndfile-metada - sndfile_info_SOURCES = sndfile-info.c - sndfile_info_LDADD = $(top_builddir)/src/libsndfile.la - sndfile_play_SOURCES = sndfile-play.c --sndfile_play_LDADD = $(top_builddir)/src/libsndfile.la $(OS_SPECIFIC_LINKS) $(ALSA_LIBS) -+sndfile_play_LDADD = $(top_builddir)/src/libsndfile.la $(OS_SPECIFIC_LINKS) $(ALSA_LIBS) -lsndio - sndfile_convert_SOURCES = sndfile-convert.c common.c common.h - sndfile_convert_LDADD = $(top_builddir)/src/libsndfile.la - sndfile_cmp_SOURCES = sndfile-cmp.c Index: patches/patch-programs_sndfile-play_c =================================================================== RCS file: patches/patch-programs_sndfile-play_c diff -N patches/patch-programs_sndfile-play_c --- patches/patch-programs_sndfile-play_c 2 Jan 2010 17:53:27 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,90 +0,0 @@ -$OpenBSD: patch-programs_sndfile-play_c,v 1.2 2010/01/02 17:53:27 naddy Exp $ ---- programs/sndfile-play.c.orig Wed Dec 2 10:45:39 2009 -+++ programs/sndfile-play.c Thu Dec 31 02:41:17 2009 -@@ -57,6 +57,9 @@ - #include <Carbon.h> - #include <CoreAudio/AudioHardware.h> - -+#elif defined(USE_SNDIO) -+ #include <sndio.h> -+ - #elif (defined (sun) && defined (unix)) - #include <fcntl.h> - #include <sys/ioctl.h> -@@ -820,6 +823,67 @@ win32_play (int argc, char *argv []) - #endif /* Win32 */ - - /*------------------------------------------------------------------------------ -+** Sndio. -+*/ -+ -+#if defined (USE_SNDIO) -+ -+static void -+sndio_play (int argc, char *argv []) -+{ -+ struct sio_hdl *hdl; -+ struct sio_par par; -+ short buffer[BUFFER_LEN]; -+ SNDFILE *sndfile; -+ SF_INFO sfinfo; -+ int k, readcount; -+ -+ for (k = 1; k < argc; k++) -+ { printf ("Playing %s\n", argv [k]) ; -+ if (! (sndfile = sf_open (argv [k], SFM_READ, &sfinfo))) -+ { puts (sf_strerror (NULL)) ; -+ continue ; -+ } ; -+ -+ if (sfinfo.channels < 1 || sfinfo.channels > 2) -+ { printf ("Error : channels = %d.\n", sfinfo.channels) ; -+ continue ; -+ } ; -+ -+ if ((hdl = sio_open(NULL, SIO_PLAY, 0)) == NULL) -+ { fprintf(stderr, "open sndio device failed") ; -+ return ; -+ } ; -+ -+ sio_initpar(&par); -+ par.rate = sfinfo.samplerate ; -+ par.pchan = sfinfo.channels ; -+ par.bits = 16 ; -+ par.sig = 1; -+ par.le = SIO_LE_NATIVE; -+ -+ if (!sio_setpar(hdl, &par) || !sio_getpar(hdl, &par)) -+ { fprintf (stderr, "set sndio params failed") ; -+ return ; -+ } ; -+ -+ if (!sio_start(hdl)) -+ { fprintf (stderr, "sndio start failed") ; -+ return ; -+ } ; -+ -+ while ((readcount = sf_read_short (sndfile, buffer, BUFFER_LEN))) -+ sio_write (hdl, buffer, readcount * sizeof (short)) ; -+ -+ sio_close (hdl) ; -+ } ; -+ -+ return ; -+} /* sndio_play */ -+ -+#endif /* sndio */ -+ -+/*------------------------------------------------------------------------------ - ** Solaris. - */ - -@@ -941,6 +1005,8 @@ main (int argc, char *argv []) - opensoundsys_play (argc, argv) ; - #elif (defined (__MACH__) && defined (__APPLE__)) - macosx_play (argc, argv) ; -+#elif defined USE_SNDIO -+ sndio_play (argc, argv) ; - #elif (defined (sun) && defined (unix)) - solaris_play (argc, argv) ; - #elif (OS_IS_WIN32 == 1) Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/audio/libsndfile/pkg/PLIST,v retrieving revision 1.9 diff -u -p -r1.9 PLIST --- pkg/PLIST 2 Jan 2010 17:53:27 -0000 1.9 +++ pkg/PLIST 13 Apr 2011 08:16:01 -0000 @@ -10,6 +10,7 @@ @bin bin/sndfile-metadata-set @bin bin/sndfile-play @comment bin/sndfile-regtest +@bin bin/sndfile-salvage include/sndfile.h include/sndfile.hh lib/libsndfile.a @@ -19,7 +20,9 @@ lib/pkgconfig/sndfile.pc @man man/man1/sndfile-cmp.1 @man man/man1/sndfile-concat.1 @man man/man1/sndfile-convert.1 +@man man/man1/sndfile-deinterleave.1 @man man/man1/sndfile-info.1 +@man man/man1/sndfile-interleave.1 @man man/man1/sndfile-metadata-get.1 @man man/man1/sndfile-metadata-set.1 @man man/man1/sndfile-play.1