aboutsummaryrefslogtreecommitdiff
path: root/audio/openal
diff options
context:
space:
mode:
authorJean-Yves Lefort <jylefort@FreeBSD.org>2005-11-24 06:49:56 +0000
committerJean-Yves Lefort <jylefort@FreeBSD.org>2005-11-24 06:49:56 +0000
commit80d0833c0e8505587a40dc0961202f6f4c87f494 (patch)
treebfda2a6316c523f5da7a30630c8fbda39fbd9fc6 /audio/openal
parent5cda33769cc80803a0719cc70c2a83dddc6777c9 (diff)
downloadports-80d0833c0e8505587a40dc0961202f6f4c87f494.tar.gz
ports-80d0833c0e8505587a40dc0961202f6f4c87f494.zip
Notes
Diffstat (limited to 'audio/openal')
-rw-r--r--audio/openal/Makefile54
-rw-r--r--audio/openal/files/patch-src_arch_bsd_bsd__dsp.c58
2 files changed, 107 insertions, 5 deletions
diff --git a/audio/openal/Makefile b/audio/openal/Makefile
index f3d7f75e836d..a2c4fb2706e5 100644
--- a/audio/openal/Makefile
+++ b/audio/openal/Makefile
@@ -7,6 +7,7 @@
PORTNAME= openal
PORTVERSION= 20050401
+PORTREVISION= 1
CATEGORIES= audio
MASTER_SITES= http://math.missouristate.edu/~erik/files/fbsd/\
http://www.smluc.org/~erik/files/fbsd/
@@ -19,16 +20,59 @@ INFO= openal
WRKSRC= ${WRKDIR}/${DISTNAME}/linux
GNU_CONFIGURE= yes
CONFIGURE_TARGET=--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
+CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" LDFLAGS="-L${LOCALBASE}/lib"
+CONFIGURE_ARGS= --enable-capture
USE_GMAKE= yes
USE_GNOME= pkgconfig
+WANT_SDL= yes
INSTALLS_SHLIB= yes
USE_REINPLACE= yes
+OPTIONS= ARTS "aRts backend" off \
+ ESD "esd backend" off \
+ SDL "SDL backend" off \
+ VORBIS "vorbis support" off \
+ SMPEG "smpeg support" off
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITH_SMPEG)
+WITH_SDL= yes # smpeg requires SDL
+.endif
+
+.if defined(WITH_ARTS)
+LIB_DEPENDS+= artsc.0:${PORTSDIR}/audio/arts
+CONFIGURE_ARGS+=--enable-arts
+.endif
+
+.if defined(WITH_ESD)
+USE_GNOME+= esound
+CONFIGURE_ARGS+=--enable-esd
+.endif
+
+.if defined(WITH_SDL)
+USE_SDL+= sdl
+CONFIGURE_ENV+= HAVESDL="${SDL_CONFIG}"
+CONFIGURE_ARGS+=--enable-sdl
+.endif
+
+.if defined(WITH_VORBIS)
+LIB_DEPENDS+= vorbisfile.4:${PORTSDIR}/audio/libvorbis
+CONFIGURE_ARGS+=--enable-vorbis
+.endif
+
+.if defined(WITH_SMPEG)
+LIB_DEPENDS+= smpeg.1:${PORTSDIR}/multimedia/smpeg
+CONFIGURE_ARGS+=--enable-smpeg
+.endif
+
post-patch:
- @${REINPLACE_CMD} -e "s/-pthread/${PTHREAD_LIBS}/" ${WRKSRC}/configure
+ @${REINPLACE_CMD} -e 's/-pthread/${PTHREAD_LIBS}/; \
+ /CPPFLAGS=/ d' ${WRKSRC}/configure
+ @${REINPLACE_CMD} -e '/#include/ s|SDL/||' \
+ ${WRKSRC}/src/extensions/al_ext_mp3.c
-pre-install:
- @${INSTALL_DATA} ${WRKSRC}/doc/openal.info ${PREFIX}/info
- @install-info ${PREFIX}/info/openal.info ${PREFIX}/info/dir
+post-install:
+ ${INSTALL_DATA} ${WRKSRC}/doc/openal.info ${PREFIX}/info
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/audio/openal/files/patch-src_arch_bsd_bsd__dsp.c b/audio/openal/files/patch-src_arch_bsd_bsd__dsp.c
new file mode 100644
index 000000000000..ce94d0ee8101
--- /dev/null
+++ b/audio/openal/files/patch-src_arch_bsd_bsd__dsp.c
@@ -0,0 +1,58 @@
+--- src/arch/bsd/bsd_dsp.c.orig Wed Nov 9 13:15:27 2005
++++ src/arch/bsd/bsd_dsp.c Wed Nov 9 14:09:12 2005
+@@ -113,7 +113,6 @@
+ */
+ void *grab_write_native(void) {
+ const char *dsppath = "/dev/dsp";
+- int divisor = _alSpot(_AL_DEF_BUFSIZ) | (2<<16);
+
+ dsp_fd = open(dsppath, O_WRONLY | O_NONBLOCK);
+
+@@ -126,10 +125,6 @@
+ perror("fcntl");
+ }
+
+- if(ioctl(dsp_fd, SNDCTL_DSP_SETFRAGMENT, &divisor) < 0) {
+- perror("ioctl SETFRAGMENT");
+- }
+-
+ _alBlitBuffer = native_blitbuffer;
+
+ FD_ZERO(&dsp_fd_set);
+@@ -320,10 +315,11 @@
+ }
+
+ ALboolean set_write_native(UNUSED(void *handle),
+- UNUSED(unsigned int *bufsiz),
++ unsigned int *bufsiz,
+ ALenum *fmt,
+ unsigned int *speed) {
+ ALuint channels = _al_ALCHANNELS(*fmt);
++ int divisor;
+
+ if(dsp_fd < 0) {
+ return AL_FALSE;
+@@ -365,6 +361,23 @@
+
+
+ *fmt = BSD2ALFMT(*fmt, channels);
++
++ if(ioctl(dsp_fd, SNDCTL_DSP_GETBLKSIZE, bufsiz) < 0) {
++#ifdef DEBUG_MAXIMUS
++ fprintf(stderr, "blksize %d\n", *bufsiz);
++ perror("get_devsp blksize ioctl");
++#endif
++ return AL_FALSE;
++ }
++
++ divisor = _alSpot(*bufsiz) | (2<<16);
++ if(ioctl(dsp_fd, SNDCTL_DSP_SETFRAGMENT, &divisor) < 0) {
++#ifdef DEBUG_MAXIMUS
++ fprintf(stderr, "divisor %d\n", divisor);
++ perror("set_devsp fragment ioctl");
++#endif
++ return AL_FALSE;
++ }
+
+ return AL_TRUE;
+ }