On Jun 15 09:30:42, Stuart Henderson wrote:
> In gmane.os.openbsd.ports, you wrote:
> > This brings audio/sox to the latest release,
> > adds myself as MAINTAINER as the port didn't have one,
> > and deletes an unnecessary "-I" option that was solved upstream.
> > http://sourceforge.net/mailarchive/message.php?msg_id=27073571
> 
> thanks, committed with the following tweaks;
> 
> - a function was renamed (and some new ones added), so bump
> library major. (not hugely important as nothing depends on the
> library, but it is correct to do this).
> 
> - zap REVISION
> 
> - more specific GPL version info (v2 or newer => v2+)


It seems we don't even need the patch file:

$OpenBSD: patch-src_formats_c,v 1.1 2009/11/06 00:04:37 sthen Exp $
--- src/formats.c.orig  Tue Jun 14 14:47:49 2011
+++ src/formats.c       Tue Jun 14 14:48:58 2011
@@ -407,7 +407,7 @@
   /* To fix this #error, either simply remove the #error line and live without
    * file-type detection with pipes, or add support for your compiler in the
    * lines above.  Test with cat monkey.au | ./sox --info - */
-  #error FIX NEEDED HERE
+  /*#error FIX NEEDED HERE*/
   #define NO_REWIND_PIPE
   (void)fp;
 #endif


Looking at the source, this patch just comments out this #error:

/* Hack to rewind pipes (a small amount).
 * Works by resetting the FILE buffer pointer */
static void UNUSED rewind_pipe(FILE * fp)
{
/* _FSTDIO is for Torek stdio (i.e. most BSD-derived libc's)
 * In theory, we no longer need to check _NEWLIB_VERSION or __APPLE__ */
#if defined _FSTDIO || defined _NEWLIB_VERSION || defined __APPLE__
  fp->_p -= AUTO_DETECT_SIZE;
  fp->_r += AUTO_DETECT_SIZE;
#elif defined __GLIBC__
  fp->_IO_read_ptr = fp->_IO_read_base;
#elif defined _MSC_VER || defined __MINGW_H || defined _ISO_STDIO_ISO_H
  fp->_ptr = fp->_base;
#else
  /* To fix this #error, either simply remove the #error line and live without
   * file-type detection with pipes, or add support for your compiler in the
   * lines above.  Test with cat monkey.au | ./sox --info - */
  #error FIX NEEDED HERE
  #define NO_REWIND_PIPE
  (void)fp;
#endif
}


So we are already "supported" in the FSTDIO branch,
and we can just leave the #error there.

$ grep -Fr FSTDIO /usr/include/                                   
/usr/include/stdio.h:#define _FSTDIO /* Define for new stdio with functions. */

SoX so compiled indeed does filetype detection on pipes
(at least on my 4.9/i386 and current/amd64).

        Jan

Reply via email to