From ec578a8dfe7eec0c9d905c58f72f95b6c9e2da1a Mon Sep 17 00:00:00 2001 From: hans Date: Wed, 15 Feb 2012 22:09:31 +0000 Subject: Fix build on SunOS. --- audio/mad123/distinfo | 7 ++--- audio/mad123/patches/patch-aa | 13 +++++++++- audio/mad123/patches/patch-ab | 44 +++++++++++++++++++++++++++++--- audio/mad123/patches/patch-mp3__stream.c | 16 ++++++++++++ audio/maplay/Makefile | 4 ++- 5 files changed, 76 insertions(+), 8 deletions(-) create mode 100644 audio/mad123/patches/patch-mp3__stream.c (limited to 'audio') diff --git a/audio/mad123/distinfo b/audio/mad123/distinfo index 871606415d9..f719c74841b 100644 --- a/audio/mad123/distinfo +++ b/audio/mad123/distinfo @@ -1,9 +1,10 @@ -$NetBSD: distinfo,v 1.7 2012/02/05 20:39:50 sbd Exp $ +$NetBSD: distinfo,v 1.8 2012/02/15 22:09:31 hans Exp $ SHA1 (mad123-0.8.5.tar.gz) = 97c5d6185a54e2262d52a687ff3a3714ff260af8 RMD160 (mad123-0.8.5.tar.gz) = bd2bf0b79a3c9d3513583daccdfc182a2d17cc41 Size (mad123-0.8.5.tar.gz) = 24836 bytes -SHA1 (patch-aa) = 16aecc1f75178cb62bca7d5012cea4dffe393f9c -SHA1 (patch-ab) = d4522da4a3d11d6f758930a46be967b4e0fcd640 +SHA1 (patch-aa) = c2b6eb6eb4b23151c31ae7031150baae403aefad +SHA1 (patch-ab) = 2384933ec17a47fc677a93f3fc8eeca32c1168b9 SHA1 (patch-ac) = 7c150b2f15cbc00876c8619b80ee29c73b0b71df SHA1 (patch-audio__dev.h) = 699760f797aa4b90a5672b42b24e08443fe0ae69 +SHA1 (patch-mp3__stream.c) = bfd36ec13ab8f78e65007692195ed12275ffc0d8 diff --git a/audio/mad123/patches/patch-aa b/audio/mad123/patches/patch-aa index 4d0684a8ab9..0e56b9851bf 100644 --- a/audio/mad123/patches/patch-aa +++ b/audio/mad123/patches/patch-aa @@ -1,4 +1,4 @@ -$NetBSD: patch-aa,v 1.1 2005/11/11 18:58:18 joerg Exp $ +$NetBSD: patch-aa,v 1.2 2012/02/15 22:09:31 hans Exp $ --- mad123.c.orig 2005-11-11 18:19:59.000000000 +0000 +++ mad123.c @@ -10,3 +10,14 @@ $NetBSD: patch-aa,v 1.1 2005/11/11 18:58:18 joerg Exp $ #include #include #include +@@ -33,6 +34,10 @@ + #include + #include + ++#ifdef __sun ++#include ++#endif ++ + #include "audio_dev.h" + #include "mp3_stream.h" + diff --git a/audio/mad123/patches/patch-ab b/audio/mad123/patches/patch-ab index c01c28464ec..fab7aa2f342 100644 --- a/audio/mad123/patches/patch-ab +++ b/audio/mad123/patches/patch-ab @@ -1,4 +1,4 @@ -$NetBSD: patch-ab,v 1.2 2012/02/05 20:39:50 sbd Exp $ +$NetBSD: patch-ab,v 1.3 2012/02/15 22:09:31 hans Exp $ --- audio_dev.c.orig 2004-09-22 09:23:43.000000000 +0000 +++ audio_dev.c @@ -12,7 +12,18 @@ $NetBSD: patch-ab,v 1.2 2012/02/05 20:39:50 sbd Exp $ #include #include #include -@@ -43,6 +45,10 @@ +@@ -35,6 +35,10 @@ + #include + #include + ++#ifdef __sun ++#include ++#endif ++ + #include "audio_dev.h" + + #if (BYTE_ORDER == BIG_ENDIAN) +@@ -43,6 +47,10 @@ #undef WORDS_BIGENDIAN #endif @@ -23,7 +34,25 @@ $NetBSD: patch-ab,v 1.2 2012/02/05 20:39:50 sbd Exp $ #define PCM_BUFFSIZE ((sizeof(((struct mad_pcm *)0)->samples) / \ sizeof(mad_fixed_t)) * 2) struct pcm_data { -@@ -97,8 +103,12 @@ static void audio_convert_dither(unsigne +@@ -58,7 +66,7 @@ struct pcm_data { + #define PCM_LOW_WATER 32 + struct pcm_buffer { + volatile int pb_command; +- u_int64_t pb_playsamples; ++ uint64_t pb_playsamples; + int pb_rate; + int pb_nchannels; + volatile int pb_purge; +@@ -74,7 +82,7 @@ struct audio_dev_ctx { + int ac_paused; + int ac_peerread; + int ac_peerwrite; +- u_int64_t ac_buffersamples; ++ uint64_t ac_buffersamples; + void (*ac_readcallback)(void *); + void *ac_cbarg; + struct pcm_buffer *ac_pcm; +@@ -97,8 +105,12 @@ static void audio_convert_dither(unsigne static const struct audio_dev_backend *audio_dev_backends[] = { @@ -36,3 +65,12 @@ $NetBSD: patch-ab,v 1.2 2012/02/05 20:39:50 sbd Exp $ #ifndef NOARTS &audio_dev_arts, #endif +@@ -326,7 +338,7 @@ audio_dev_output(struct audio_dev_ctx *a + pd->pd_len = len; + + written /= pd->pd_nchannels; +- written /= sizeof(u_int16_t); ++ written /= sizeof(uint16_t); + ac->ac_pcm->pb_playsamples += written; + + return ((rv >= 0) ? 0 : -1); diff --git a/audio/mad123/patches/patch-mp3__stream.c b/audio/mad123/patches/patch-mp3__stream.c new file mode 100644 index 00000000000..33678b511ba --- /dev/null +++ b/audio/mad123/patches/patch-mp3__stream.c @@ -0,0 +1,16 @@ +$NetBSD: patch-mp3__stream.c,v 1.1 2012/02/15 22:09:31 hans Exp $ + +--- mp3_stream.c.orig 2004-10-21 11:11:42.000000000 +0200 ++++ mp3_stream.c 2012-01-11 19:53:46.065401047 +0100 +@@ -41,6 +41,11 @@ + #endif /* NOTAGLIB */ + #include /* Move *after* curl.h, 'cos it's braindamaged */ + ++#ifdef __sun ++#define madvise posix_madvise ++#define MAP_FILE 0 ++#endif ++ + #include "mp3_stream.h" + + static void *mps_file_open(const char *, int); diff --git a/audio/maplay/Makefile b/audio/maplay/Makefile index e27bf73fd94..8ac5b875d53 100644 --- a/audio/maplay/Makefile +++ b/audio/maplay/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.23 2011/11/22 20:57:34 wiz Exp $ +# $NetBSD: Makefile,v 1.24 2012/02/15 22:11:04 hans Exp $ DISTNAME= maplay1_2 PKGNAME= maplay-1.2 @@ -20,6 +20,8 @@ NOT_FOR_PLATFORM= Interix-*-* INSTALLATION_DIRS= bin +MAKE_ENV+= INSTALL=${TOOLS_PATH.install:Q} + pre-configure: cd ${WRKSRC} && ${MAKE} pre-install -- cgit v1.2.3