Subject: pkg/13893: Making games/xgalaga noise
To: None <gnats-bugs@gnats.netbsd.org>
From: None <rxg@ms25.url.com.tw>
List: netbsd-bugs
Date: 09/07/2001 15:12:17
>Number:         13893
>Category:       pkg
>Synopsis:       Making games/xgalaga noise
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 07 00:13:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Rui-Xiang Guo
>Release:        NetBSD-1.5X
>Organization:
	
>Environment:
	
System: NetBSD rxgpc.iplus.net.tw 1.5X NetBSD 1.5X (rxgpc) #0: Tue Aug 14 22:09:37 CST 2001 rxg@rxgpc.iplus.net.tw:/home/rxg/mysys/arch/i386/compile/rxgpc i386
Architecture: i386
Machine: i386
>Description:
	Making games/xgalaga noise :)
>How-To-Repeat:
	Let's hear sound from it.
>Fix:
	Please add these three patches:
patch-aa:

$NetBSD$

--- Makefile.in.orig    Mon May 11 14:52:59 1998
+++ Makefile.in Fri Sep  7 13:57:22 2001
@@ -25,7 +25,7 @@
 RM = rm -f
 CC = @CC@
 CFLAGS = -I. @CFLAGS@ @DEFS@ @X_CFLAGS@ -DXGALAGADIR=\"@prefix@/\" $(SOUNDDEFS)
-LDFLAGS = @LDFLAGS@
+LDFLAGS = -Wl,-R$(X11BASE)/lib @LDFLAGS@
 LIBS = @LIBS@ libsprite/libsprite.a @X_LIBS@
 INSTALL = @INSTALL@
 
@@ -40,7 +40,7 @@
 all: $(TARGET) $(SOUNDSRV)
 
 $(SOUNDSRV): $(SOUNDOBJS)
-       $(CC) $(LDFLAGS) -o $(SOUNDSRV) $(SOUNDOBJS) $(SOUNDLIBS)
+       $(CC) $(LDFLAGS) -o $(SOUNDSRV) $(SOUNDOBJS) $(SOUNDLIBS) -lossaudio
 
 install: all
        ./mkinstalldirs $(bindir)
@@ -52,7 +52,10 @@
        for i in levels/*.xgl; do $(INSTALL) $$i $(prefix)/$$i ; done
        for i in sounds/*.raw; do $(INSTALL) $$i $(prefix)/$$i ; done
        touch $(prefix)/scores
-       chmod 666 $(prefix)/scores
+       chown bin:games $(prefix)/scores
+       chown bin:games $(bindir)/$(TARGET)
+       chmod 2755 $(bindir)/$(TARGET)
+       chmod 664 $(prefix)/scores
 
 subdirs:
        for i in $(SUBDIRS); do cd $$i ; make ; done

patch-ab:

$NetBSD$

--- configure.orig      Fri Sep  7 11:50:14 2001
+++ configure
@@ -1813,6 +1813,9 @@
     *freebsd*)
         sound_type=native
        ;;
+    *netbsd*)
+       sound_type=native
+       ;;
     *sunos*)
         sound_type=native
         ;;
@@ -1849,6 +1852,17 @@
 #define SOUND 1
 EOF
 
+       ;;
+      *netbsd*)
+       SOUNDSERVER=xgal.sndsrv.linux
+       cat >> confdefs.h <<\EOF
+#define SOUNDDEV "/dev/audio"
+EOF
+
+       cat >> confdefs.h <<\EOF
+#define SOUND 1
+EOF
+ 
        ;;
       *sunos*)
         SOUNDSERVER=xgal.sndsrv.sun.c

patch-ac:

$NetBSD$

--- xgal.sndsrv.linux.c.orig    Fri Sep  7 14:33:57 2001
+++ xgal.sndsrv.linux.c
@@ -15,8 +15,12 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
+#ifdef __NetBSD__
+#include <soundcard.h>
+#else
 #include <linux/soundcard.h>
 /*#include "linux_pcsp.h"      /* /usr/include/linux/pcsp.h      */
+#endif
 #include <sys/time.h>
 #include <signal.h>
 #include <string.h>

And remember to add this line to pkg/PLIST:

share/xgalaga/xgal.sndsrv.linux
>Release-Note:
>Audit-Trail:
>Unformatted: