# 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.
--- /dev/null
+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);
# 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
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 ) )"
S=${WORKDIR}/stratagus-${MY_PV}
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/flac-1.1.3.patch
+}
+
src_compile() {
local myconf