pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/games/scummvm Add support for flac-1.1.3. Since packag...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f81ea9103d33
branches:  trunk
changeset: 523782:f81ea9103d33
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Sat Jan 13 14:20:25 2007 +0000

description:
Add support for flac-1.1.3. Since package was compiling without flac
support in the meantime, bump PKGREVISION.
Patch from ftp.altlinux.org /pub/people/thresh

diffstat:

 games/scummvm/Makefile         |    4 +-
 games/scummvm/distinfo         |    4 +-
 games/scummvm/patches/patch-ae |   25 ++
 games/scummvm/patches/patch-af |  451 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 481 insertions(+), 3 deletions(-)

diffs (truncated from 512 to 300 lines):

diff -r e84f7417fe34 -r f81ea9103d33 games/scummvm/Makefile
--- a/games/scummvm/Makefile    Sat Jan 13 13:50:11 2007 +0000
+++ b/games/scummvm/Makefile    Sat Jan 13 14:20:25 2007 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.47 2007/01/07 12:25:54 wiz Exp $
+# $NetBSD: Makefile,v 1.48 2007/01/13 14:20:25 wiz Exp $
 
 DISTNAME=      scummvm-0.9.1
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    games
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=scummvm/}
 EXTRACT_SUFX=  .tar.bz2
diff -r e84f7417fe34 -r f81ea9103d33 games/scummvm/distinfo
--- a/games/scummvm/distinfo    Sat Jan 13 13:50:11 2007 +0000
+++ b/games/scummvm/distinfo    Sat Jan 13 14:20:25 2007 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.24 2006/10/30 15:38:36 adam Exp $
+$NetBSD: distinfo,v 1.25 2007/01/13 14:20:25 wiz Exp $
 
 SHA1 (scummvm-0.9.1.tar.bz2) = 6fcd00903f13fbafab65b432458e097f0e0d5d83
 RMD160 (scummvm-0.9.1.tar.bz2) = c77a7fa4251b6f6ee303dc35049671547dffed7a
@@ -7,3 +7,5 @@
 SHA1 (patch-ab) = 8769804560a8410da0a6f9e95a987fa6be630a6d
 SHA1 (patch-ac) = 28764fefc214073610d94a236728f5c6b40d54ae
 SHA1 (patch-ad) = 56a6e4e931a30fe3f394fc84ef7e84e49a9370e4
+SHA1 (patch-ae) = 7251b705af68e601006a2eb2d12cdc1fe171c1cf
+SHA1 (patch-af) = e2efa1f075118bb6bbb789090ed1a29d6b917102
diff -r e84f7417fe34 -r f81ea9103d33 games/scummvm/patches/patch-ae
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/games/scummvm/patches/patch-ae    Sat Jan 13 14:20:25 2007 +0000
@@ -0,0 +1,25 @@
+$NetBSD: patch-ae,v 1.1 2007/01/13 14:20:25 wiz Exp $
+
+--- configure.orig     2006-10-22 21:01:09.000000000 +0000
++++ configure
+@@ -1099,15 +1099,15 @@ echocheck "FLAC >= 1.0.1"
+ if test "$_flac" = auto ; then
+       _flac=no
+       cat > $TMPC << EOF
+-#include <FLAC/seekable_stream_decoder.h>
+-int main(void) { FLAC__seekable_stream_decoder_init( 0 ); return 0; }
++#include <FLAC/format.h>
++int main(void) { return FLAC__STREAM_SYNC_LEN >> 30; /* guaranteed to be 0 */ }
+ EOF
+-      cc_check $LDFLAGS $CXXFLAGS $FLAC_CFLAGS $FLAC_LIBS \
+-      -lFLAC -lm && _flac=yes
++      cc_check $LDFLAGS $CXXFLAGS $FLAC_CFLAGS $FLAC_LIBS $OGG_CFLAGS $OGG_LIBS \
++      -lFLAC -logg -lm && _flac=yes
+ fi
+ if test "$_flac" = yes ; then
+       _def_flac='#define USE_FLAC'
+-      LIBS="$LIBS $FLAC_LIBS -lFLAC"
++      LIBS="$LIBS $FLAC_LIBS $OGG_LIBS -lFLAC -logg"
+       INCLUDES="$INCLUDES $FLAC_CFLAGS"
+ else
+       _def_flac='#undef USE_FLAC'
diff -r e84f7417fe34 -r f81ea9103d33 games/scummvm/patches/patch-af
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/games/scummvm/patches/patch-af    Sat Jan 13 14:20:25 2007 +0000
@@ -0,0 +1,451 @@
+$NetBSD: patch-af,v 1.1 2007/01/13 14:20:25 wiz Exp $
+
+--- sound/flac.cpp.orig        2006-10-22 21:12:03.000000000 +0000
++++ sound/flac.cpp
+@@ -31,7 +31,18 @@
+ #include "sound/audiocd.h"
+ 
+ #define FLAC__NO_DLL // that MS-magic gave me headaches - just link the library you like
++#include <FLAC/export.h>
++// check if we have FLAC >= 1.1.3; LEGACY_FLAC code can be removed once FLAC-1.1.3 propagates everywhere
++#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8
++#define LEGACY_FLAC
++#else
++#undef LEGACY_FLAC
++#endif
++#ifdef LEGACY_FLAC
+ #include <FLAC/seekable_stream_decoder.h>
++#else
++#include <FLAC/stream_decoder.h>
++#endif
+ 
+ 
+ using Common::File;
+@@ -67,7 +78,11 @@ public:
+ 
+       const FLAC__StreamMetadata_StreamInfo& getStreamInfo() const {return _streaminfo;}
+ 
++#ifdef LEGACY_FLAC
+       inline FLAC__SeekableStreamDecoderState getState() const;
++#else
++      inline FLAC__StreamDecoderState getState() const;
++#endif
+       inline FLAC__StreamDecoderState getStreamDecoderState() const;
+ 
+ 
+@@ -81,18 +96,30 @@ public:
+       inline void setLastSample(FLAC__uint64 absoluteSample);
+ 
+ protected:
++#ifdef LEGACY_FLAC
+       inline ::FLAC__SeekableStreamDecoderReadStatus callbackRead(FLAC__byte buffer[], uint *bytes);
+       inline ::FLAC__SeekableStreamDecoderSeekStatus callbackSeek(FLAC__uint64 absoluteByteOffset);
+       inline ::FLAC__SeekableStreamDecoderTellStatus callbackTell(FLAC__uint64 *absoluteByteOffset);
+       inline ::FLAC__SeekableStreamDecoderLengthStatus callbackLength(FLAC__uint64 *streamLength);
++#else
++      inline ::FLAC__StreamDecoderReadStatus callbackRead(FLAC__byte buffer[], size_t *bytes);
++      inline ::FLAC__StreamDecoderSeekStatus callbackSeek(FLAC__uint64 absoluteByteOffset);
++      inline ::FLAC__StreamDecoderTellStatus callbackTell(FLAC__uint64 *absoluteByteOffset);
++      inline ::FLAC__StreamDecoderLengthStatus callbackLength(FLAC__uint64 *streamLength);
++#endif
+       inline bool callbackEOF();
+       inline ::FLAC__StreamDecoderWriteStatus callbackWrite(const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[]);
+       inline void callbackMetadata(const ::FLAC__StreamMetadata *metadata);
+       inline void callbackError(::FLAC__StreamDecoderErrorStatus status);
+ 
++#ifdef LEGACY_FLAC
+       ::FLAC__SeekableStreamDecoder *_decoder;
++#else
++      ::FLAC__StreamDecoder *_decoder;
++#endif
+ 
+ private:
++#ifdef LEGACY_FLAC
+       static ::FLAC__SeekableStreamDecoderReadStatus callWrapRead(const ::FLAC__SeekableStreamDecoder *decoder, FLAC__byte buffer[], uint *bytes, void *clientData);
+       static ::FLAC__SeekableStreamDecoderSeekStatus callWrapSeek(const ::FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 absoluteByteOffset, void *clientData);
+       static ::FLAC__SeekableStreamDecoderTellStatus callWrapTell(const ::FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *absoluteByteOffset, void *clientData);
+@@ -101,6 +128,16 @@ private:
+       static ::FLAC__StreamDecoderWriteStatus callWrapWrite(const ::FLAC__SeekableStreamDecoder *decoder, const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *clientData);
+       static void callWrapMetadata(const ::FLAC__SeekableStreamDecoder *decoder, const ::FLAC__StreamMetadata *metadata, void *clientData);
+       static void callWrapError(const ::FLAC__SeekableStreamDecoder *decoder, ::FLAC__StreamDecoderErrorStatus status, void *clientData);
++#else
++      static ::FLAC__StreamDecoderReadStatus callWrapRead(const ::FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *clientData);
++      static ::FLAC__StreamDecoderSeekStatus callWrapSeek(const ::FLAC__StreamDecoder *decoder, FLAC__uint64 absoluteByteOffset, void *clientData);
++      static ::FLAC__StreamDecoderTellStatus callWrapTell(const ::FLAC__StreamDecoder *decoder, FLAC__uint64 *absoluteByteOffset, void *clientData);
++      static ::FLAC__StreamDecoderLengthStatus callWrapLength(const ::FLAC__StreamDecoder *decoder, FLAC__uint64 *streamLength, void *clientData);
++      static FLAC__bool callWrapEOF(const ::FLAC__StreamDecoder *decoder, void *clientData);
++      static ::FLAC__StreamDecoderWriteStatus callWrapWrite(const ::FLAC__StreamDecoder *decoder, const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *clientData);
++      static void callWrapMetadata(const ::FLAC__StreamDecoder *decoder, const ::FLAC__StreamMetadata *metadata, void *clientData);
++      static void callWrapError(const ::FLAC__StreamDecoder *decoder, ::FLAC__StreamDecoderErrorStatus status, void *clientData);
++#endif
+       // Private and undefined so you can't use them:
+       FlacInputStream(const FlacInputStream &);
+       void operator=(const FlacInputStream &);
+@@ -157,7 +194,12 @@ private:
+ };
+ 
+ FlacInputStream::FlacInputStream(File *sourceFile, const uint32 fileStart)
+-                      :       _decoder(::FLAC__seekable_stream_decoder_new()), _firstSample(0), _lastSample(0),
++#ifdef LEGACY_FLAC
++                      :       _decoder(::FLAC__seekable_stream_decoder_new()),
++#else
++                      :       _decoder(::FLAC__stream_decoder_new()),
++#endif
++                              _firstSample(0), _lastSample(0),
+                               _outBuffer(NULL), _requestedSamples(0), _lastSampleWritten(true),
+                               _methodConvertBuffers(&FlacInputStream::convertBuffersGeneric)
+ {
+@@ -178,7 +220,12 @@ FlacInputStream::FlacInputStream(File *s
+ }
+ 
+ FlacInputStream::FlacInputStream(File *sourceFile, const uint32 fileStart, const uint32 fileStop)
+-                      :       _decoder(::FLAC__seekable_stream_decoder_new()), _firstSample(0), _lastSample(0),
++#ifdef LEGACY_FLAC
++                      :       _decoder(::FLAC__seekable_stream_decoder_new()),
++#else
++                      :       _decoder(::FLAC__stream_decoder_new()),
++#endif
++                              _firstSample(0), _lastSample(0),
+                               _outBuffer(NULL), _requestedSamples(0), _lastSampleWritten(true),
+                               _methodConvertBuffers(&FlacInputStream::convertBuffersGeneric)
+ {
+@@ -201,8 +248,13 @@ FlacInputStream::FlacInputStream(File *s
+ 
+ FlacInputStream::~FlacInputStream() {
+       if (_decoder != NULL) {
++#ifdef LEGACY_FLAC
+               (void) ::FLAC__seekable_stream_decoder_finish(_decoder);
+               ::FLAC__seekable_stream_decoder_delete(_decoder);
++#else
++              (void) ::FLAC__stream_decoder_finish(_decoder);
++              ::FLAC__stream_decoder_delete(_decoder);
++#endif
+       }
+       if (_preBuffer.bufData != NULL)
+               delete[] _preBuffer.bufData;
+@@ -210,14 +262,27 @@ FlacInputStream::~FlacInputStream() {
+       _fileInfo.fileHandle->decRef();
+ }
+ 
+-inline FLAC__SeekableStreamDecoderState FlacInputStream::getState() const {
++#ifdef LEGACY_FLAC
++inline FLAC__SeekableStreamDecoderState FlacInputStream::getState() const
++#else
++inline FLAC__StreamDecoderState FlacInputStream::getState() const
++#endif
++{
+       assert(isValid());
++#ifdef LEGACY_FLAC
+       return ::FLAC__seekable_stream_decoder_get_state(_decoder);
++#else
++      return ::FLAC__stream_decoder_get_state(_decoder);
++#endif
+ }
+ 
+ inline FLAC__StreamDecoderState FlacInputStream::getStreamDecoderState() const {
+       assert(isValid());
++#ifdef LEGACY_FLAC
+       return ::FLAC__seekable_stream_decoder_get_stream_decoder_state(_decoder);
++#else
++      return ::FLAC__stream_decoder_get_state(_decoder);
++#endif
+ }
+ 
+ bool FlacInputStream::init() {
+@@ -229,6 +294,7 @@ bool FlacInputStream::init() {
+       _lastSampleWritten = false;
+       _methodConvertBuffers = &FlacInputStream::convertBuffersGeneric;
+ 
++#ifdef LEGACY_FLAC
+       ::FLAC__seekable_stream_decoder_set_read_callback(_decoder, &FlacInputStream::callWrapRead);
+       ::FLAC__seekable_stream_decoder_set_seek_callback(_decoder, &FlacInputStream::callWrapSeek);
+       ::FLAC__seekable_stream_decoder_set_tell_callback(_decoder, &FlacInputStream::callWrapTell);
+@@ -247,6 +313,27 @@ bool FlacInputStream::init() {
+                       }
+               }
+       }
++#else
++      if (::FLAC__stream_decoder_init_stream(
++              _decoder,
++              &FlacInputStream::callWrapRead, 
++              &FlacInputStream::callWrapSeek, 
++              &FlacInputStream::callWrapTell, 
++              &FlacInputStream::callWrapLength, 
++              &FlacInputStream::callWrapEOF, 
++              &FlacInputStream::callWrapWrite, 
++              &FlacInputStream::callWrapMetadata, 
++              &FlacInputStream::callWrapError, 
++              (void*)this
++      ) == FLAC__STREAM_DECODER_INIT_STATUS_OK) {
++              if (processUntilEndOfMetadata() && _streaminfo.channels > 0) {
++                      if (_firstSample == 0 || 0 != ::FLAC__stream_decoder_seek_absolute(_decoder, _firstSample)) {
++                              // FLAC__StreamDecoderState state = getStreamDecoderState();
++                              return true; // no error occured
++                      }
++              }
++      }
++#endif
+ 
+       warning("FlacInputStream: could not create an Audiostream from File %s", _fileInfo.fileHandle->name());
+       return false;
+@@ -255,28 +342,48 @@ bool FlacInputStream::init() {
+ bool FlacInputStream::finish() {
+       assert(isValid());
+       deleteBuffer();
++#ifdef LEGACY_FLAC
+       return 0 != ::FLAC__seekable_stream_decoder_finish(_decoder);
++#else
++      return 0 != ::FLAC__stream_decoder_finish(_decoder);
++#endif
+ }
+ 
+ bool FlacInputStream::flush() {
+       assert(isValid());
+       flushBuffer();
++#ifdef LEGACY_FLAC
+       return 0 != ::FLAC__seekable_stream_decoder_flush(_decoder);
++#else
++      return 0 != ::FLAC__stream_decoder_flush(_decoder);
++#endif
+ }
+ 
+ inline bool FlacInputStream::processSingleBlock() {
+       assert(isValid());
++#ifdef LEGACY_FLAC
+       return 0 != ::FLAC__seekable_stream_decoder_process_single(_decoder);
++#else
++      return 0 != ::FLAC__stream_decoder_process_single(_decoder);
++#endif
+ }
+ 
+ inline bool FlacInputStream::processUntilEndOfMetadata() {
+       assert(isValid());
++#ifdef LEGACY_FLAC
+       return 0 != ::FLAC__seekable_stream_decoder_process_until_end_of_metadata(_decoder);
++#else
++      return 0 != ::FLAC__stream_decoder_process_until_end_of_metadata(_decoder);
++#endif
+ }
+ 
+ bool FlacInputStream::seekAbsolute(FLAC__uint64 sample) {
+       assert(isValid());
++#ifdef LEGACY_FLAC
+       const bool result = (0 != ::FLAC__seekable_stream_decoder_seek_absolute(_decoder, sample));
++#else
++      const bool result = (0 != ::FLAC__stream_decoder_seek_absolute(_decoder, sample));
++#endif
+       if (result) {
+               flushBuffer();
+               _lastSampleWritten = (_lastSample != 0 && sample >= _lastSample); // only set if we are SURE



Home | Main Index | Thread Index | Old Index