From 805becc564ac1bdcabc8e143520b67792f22650e Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Tue, 12 Dec 2006 22:47:21 +0000 Subject: [PATCH] Added patch from Josh Coalson (from FLAC) and closing bug #157586. Package-Manager: portage-2.1.2_rc2-r2 --- games-engines/stratagus/ChangeLog | 6 +- .../stratagus/files/flac-1.1.3.patch | 68 +++++++++++++++++++ games-engines/stratagus/stratagus-2.1.ebuild | 10 ++- 3 files changed, 81 insertions(+), 3 deletions(-) create mode 100644 games-engines/stratagus/files/flac-1.1.3.patch diff --git a/games-engines/stratagus/ChangeLog b/games-engines/stratagus/ChangeLog index c851c9b393ce..99802d8ec443 100644 --- a/games-engines/stratagus/ChangeLog +++ b/games-engines/stratagus/ChangeLog @@ -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 + +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 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 index 000000000000..acb89fca1332 --- /dev/null +++ b/games-engines/stratagus/files/flac-1.1.3.patch @@ -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); diff --git a/games-engines/stratagus/stratagus-2.1.ebuild b/games-engines/stratagus/stratagus-2.1.ebuild index a5dcef9562d7..7dd569096c66 100644 --- a/games-engines/stratagus/stratagus-2.1.ebuild +++ b/games-engines/stratagus/stratagus-2.1.ebuild @@ -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 -- 2.26.2