Package: audiooss
Severity: important
Tags: patch

This package fails to build on GNU/kFreeBSD due to some unportable usages of the
OSS interface.

I also spotted a pair of obvious bugs in the package, which I also fixed:

  - audiooss doesn't use X11 (except for imake of course), so it doesn't need to
    link against it.
  - nas-dev is a virtual package.  For the build-dependency is should be
    libaudio-dev | nas-dev.

The attached patch includes a fix for all the above problems.  Please, could you
forward the upstream part to upstream developers?

Thank you very much

-- System Information:
Debian Release: testing/unstable
Architecture: kfreebsd-i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: GNU/kFreeBSD 5.3-17
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)
diff -ur audiooss-1.0.0.old/Imakefile audiooss-1.0.0/Imakefile
--- audiooss-1.0.0.old/Imakefile	2002-03-22 20:38:00.000000000 +0100
+++ audiooss-1.0.0/Imakefile	2005-08-09 20:24:11.000000000 +0200
@@ -62,7 +62,7 @@
  MALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL
 #endif
 
-        DEFINES = $(MALLOC_DEFINES) $(SYSV_DEFINES) -D_REENTRANT -D__REENTRANT -DLINUX_IOCTL
+        DEFINES = $(MALLOC_DEFINES) $(SYSV_DEFINES) -D_REENTRANT -D__REENTRANT
 
 HEADERS = 
 
@@ -76,7 +76,7 @@
 
    OBJS = audiooss.o nasaudio.o
 
-REQUIREDLIBS = -L/usr/X11R6/lib -laudio -lX11 -ldl
+REQUIREDLIBS = -laudio -ldl
 
 #if ProjectX >= 5
 LibraryObjectRule()
diff -ur audiooss-1.0.0.old/audiooss.c audiooss-1.0.0/audiooss.c
--- audiooss-1.0.0.old/audiooss.c	2005-08-09 20:23:51.000000000 +0200
+++ audiooss-1.0.0/audiooss.c	2005-08-09 20:24:29.000000000 +0200
@@ -48,14 +48,15 @@
 
 #define YELL	if (arg == NULL) { DPRINTF("ioctl with argp == NULL, returning -1\n"); errno = EINVAL; return -1; }
 
-#ifdef LINUX_IOCTL
-#include <linux/ioctl.h>
-#endif
+/* Hack to avoid ioctl() declaration */
+#define ioctl __dummy_ioctl
+#include <sys/soundcard.h>
+#undef ioctl
+
 #include <dlfcn.h>
 #include <stdarg.h>
 #include <unistd.h>
 
-#include "soundcard.h"
 #include "nasaudio.h"
 
 typedef struct _nasInfo {
@@ -625,14 +626,30 @@
       errno = EINVAL;
       return -1;
 
+#ifdef SOUND_MIXER_ACCESS
     case SOUND_MIXER_ACCESS:
+#endif
+#ifdef SOUND_MIXER_AGC
     case SOUND_MIXER_AGC:
+#endif
+#ifdef SOUND_MIXER_3DSE
     case SOUND_MIXER_3DSE:
+#endif
+#ifdef SOUND_MIXER_PRIVATE1
     case SOUND_MIXER_PRIVATE1:
+#endif
+#ifdef SOUND_MIXER_PRIVATE2
     case SOUND_MIXER_PRIVATE2:
+#endif
+#ifdef SOUND_MIXER_PRIVATE3
     case SOUND_MIXER_PRIVATE3:
+#endif
+#ifdef SOUND_MIXER_PRIVATE4
     case SOUND_MIXER_PRIVATE4:
+#endif
+#ifdef SOUND_MIXER_PRIVATE5
     case SOUND_MIXER_PRIVATE5:
+#endif
       DPRINTF("MIXER: sound_mixer r/w obscure ioctl %x\n", request);
       errno = EINVAL;
       return -1;
diff -ur audiooss-1.0.0.old/debian/control audiooss-1.0.0/debian/control
--- audiooss-1.0.0.old/debian/control	2005-08-09 20:23:51.000000000 +0200
+++ audiooss-1.0.0/debian/control	2005-08-09 20:24:11.000000000 +0200
@@ -2,7 +2,7 @@
 Section: sound
 Priority: optional
 Maintainer: Lex Spoon <[EMAIL PROTECTED]>
-Build-Depends: debhelper (>> 3.0.0), nas-dev, xlibs-dev, xutils
+Build-Depends: debhelper (>> 3.0.0), libaudio-dev | nas-dev, xutils
 Standards-Version: 3.5.2
 
 Package: audiooss

Reply via email to