Added patch from Josh Coalson (from FLAC) and closing bug #157586.
authorChris Gianelloni <wolf31o2@gentoo.org>
Tue, 12 Dec 2006 22:47:21 +0000 (22:47 +0000)
committerChris Gianelloni <wolf31o2@gentoo.org>
Tue, 12 Dec 2006 22:47:21 +0000 (22:47 +0000)
Package-Manager: portage-2.1.2_rc2-r2

games-engines/stratagus/ChangeLog
games-engines/stratagus/files/flac-1.1.3.patch [new file with mode: 0644]
games-engines/stratagus/stratagus-2.1.ebuild

index c851c9b393cec3e1f5540c78c654a428bd65dd8e..99802d8ec4436938d042eeac26eb0ac6b6c2b08c 100644 (file)
@@ -1,6 +1,10 @@
 # ChangeLog for games-engines/stratagus
 # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/games-engines/stratagus/ChangeLog,v 1.8 2006/12/04 20:14:19 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-engines/stratagus/ChangeLog,v 1.9 2006/12/12 22:47:21 wolf31o2 Exp $
+
+  12 Dec 2006; Chris Gianelloni <wolf31o2@gentoo.org>
+  +files/flac-1.1.3.patch, stratagus-2.1.ebuild:
+  Added patch from Josh Coalson (from FLAC) and closing bug #157586.
 
   04 Dec 2006; Chris Gianelloni <wolf31o2@gentoo.org> stratagus-2.1.ebuild:
   Removing old virtual/x11 dependency.
diff --git a/games-engines/stratagus/files/flac-1.1.3.patch b/games-engines/stratagus/files/flac-1.1.3.patch
new file mode 100644 (file)
index 0000000..acb89fc
--- /dev/null
@@ -0,0 +1,68 @@
+diff -ru stratagus-040702/configure.in stratagus-040702-b2/configure.in
+--- stratagus-040702/configure.in      2004-06-12 04:55:49.000000000 -0700
++++ stratagus-040702-b2/configure.in   2006-10-25 17:07:48.000000000 -0700
+@@ -213,8 +213,9 @@
+     FLAC_CFLAGS=
+     FLAC_LIBS=
+ else
+-    FLAC_CFLAGS="-DUSE_FLAC"
+-    FLAC_LIBS="-lFLAC"
++      # starting with FLAC-1.1.3 libFLAC requires libogg
++    FLAC_CFLAGS="-DUSE_FLAC $OGG_CFLAGS"
++    FLAC_LIBS="-lFLAC $OGG_LIBS"
+ fi
+ AC_SUBST(FLAC_CFLAGS)
+ AC_SUBST(FLAC_LIBS)
+diff -ru stratagus-040702/src/sound/flac.c stratagus-040702-b2/src/sound/flac.c
+--- stratagus-040702/src/sound/flac.c  2004-06-25 16:22:33.000000000 -0700
++++ stratagus-040702-b2/src/sound/flac.c       2006-10-25 17:19:41.000000000 -0700
+@@ -47,6 +47,13 @@
+ #include "iolib.h"
+ #include "sound_server.h"
++/* FLAC 1.1.3 has FLAC_API_VERSION_CURRENT == 8 */
++#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8
++#define LEGACY_FLAC
++#else
++#undef LEGACY_FLAC
++#endif
++
+ /*----------------------------------------------------------------------------
+ --  Declaration
+ ----------------------------------------------------------------------------*/
+@@ -88,7 +95,12 @@
+ */
+ static FLAC__StreamDecoderReadStatus FLAC_read_callback(
+       const FLAC__StreamDecoder* stream, FLAC__byte buffer[],
+-      unsigned int* bytes, void* user)
++#ifdef LEGACY_FLAC
++      unsigned int* bytes,
++#else
++      size_t* bytes,
++#endif
++      void* user)
+ {
+       Sample* sample;
+       FlacData* data;
+@@ -339,12 +351,21 @@
+       sample->Pos = 0;
+       sample->User = data;
++#ifdef LEGACY_FLAC
+       FLAC__stream_decoder_set_read_callback(stream, FLAC_read_callback);
+       FLAC__stream_decoder_set_write_callback(stream, FLAC_write_callback);
+       FLAC__stream_decoder_set_metadata_callback(stream, FLAC_metadata_callback);
+       FLAC__stream_decoder_set_error_callback(stream, FLAC_error_callback);
+       FLAC__stream_decoder_set_client_data(stream, sample);
+       FLAC__stream_decoder_init(stream);
++#else
++      if(FLAC__stream_decoder_init_stream(stream, FLAC_read_callback, NULL, NULL, NULL, NULL, FLAC_write_callback, FLAC_metadata_callback, FLAC_error_callback, sample) != FLAC__STREAM_DECODER_INIT_STATUS_OK) {
++              FLAC__stream_decoder_delete(stream);
++              free(data);
++              free(sample);
++              return NULL;
++      }
++#endif
+       if (flags & PlayAudioStream) {
+               sample->Buffer = malloc(SOUND_BUFFER_SIZE);
index a5dcef9562d7d459a5ea5f0065a430f61a4d6e1d..7dd569096c665660ec903ae6a1012b9acdbf32b8 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/games-engines/stratagus/stratagus-2.1.ebuild,v 1.13 2006/12/04 20:14:19 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-engines/stratagus/stratagus-2.1.ebuild,v 1.14 2006/12/12 22:47:21 wolf31o2 Exp $
 
 inherit games
 
@@ -19,7 +19,7 @@ RDEPEND="app-arch/bzip2
        media-libs/libpng
        media-libs/libsdl
        sys-libs/zlib
-       flac? ( ~media-libs/flac-1.1.2 )
+       flac? ( media-libs/flac )
        mp3? ( media-libs/libmad )
        mikmod? ( media-libs/libmikmod )
        ogg? ( vorbis? ( media-libs/libogg media-libs/libvorbis ) )"
@@ -30,6 +30,12 @@ DEPEND="${RDEPEND}
 
 S=${WORKDIR}/stratagus-${MY_PV}
 
+src_unpack() {
+       unpack ${A}
+       cd "${S}"
+       epatch "${FILESDIR}"/flac-1.1.3.patch
+}
+
 src_compile() {
        local myconf