From 2e7de63b99d43d91228da937c2fab1030c613576 Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Mon, 4 Dec 2006 07:57:40 +0000 Subject: [PATCH] flac 1.1.3 compatibility fix Package-Manager: portage-2.1.2_rc2-r4 --- media-sound/gnusound/ChangeLog | 6 +- media-sound/gnusound/Manifest | 26 +- .../files/gnusound-0.7.4-flac-1.1.3.patch | 339 ++++++++++++++++++ media-sound/gnusound/gnusound-0.7.4.ebuild | 3 +- 4 files changed, 361 insertions(+), 13 deletions(-) create mode 100644 media-sound/gnusound/files/gnusound-0.7.4-flac-1.1.3.patch diff --git a/media-sound/gnusound/ChangeLog b/media-sound/gnusound/ChangeLog index 8bbfd65aea29..11556d9b0249 100644 --- a/media-sound/gnusound/ChangeLog +++ b/media-sound/gnusound/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for media-sound/gnusound # Copyright 2000-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-sound/gnusound/ChangeLog,v 1.11 2006/11/29 19:23:12 aballier Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-sound/gnusound/ChangeLog,v 1.12 2006/12/04 07:57:40 aballier Exp $ + + 04 Dec 2006; Alexis Ballier + +files/gnusound-0.7.4-flac-1.1.3.patch, gnusound-0.7.4.ebuild: + flac 1.1.3 compatibility fix *gnusound-0.7.4 (29 Nov 2006) diff --git a/media-sound/gnusound/Manifest b/media-sound/gnusound/Manifest index bdca8ededa3b..c73e74461e7d 100644 --- a/media-sound/gnusound/Manifest +++ b/media-sound/gnusound/Manifest @@ -33,6 +33,10 @@ AUX gnusound-0.7.4-ffmpeg-struct.patch 1680 RMD160 38d414fb73d73713a627fbb3ab9c2 MD5 012fc46dd33ab5808d0cdd297d12611e files/gnusound-0.7.4-ffmpeg-struct.patch 1680 RMD160 38d414fb73d73713a627fbb3ab9c2ec3f58460a9 files/gnusound-0.7.4-ffmpeg-struct.patch 1680 SHA256 e0bb91ee9430c8eeb5e503c697ca365d81e20c7f53000f495044b3fd1c2c9035 files/gnusound-0.7.4-ffmpeg-struct.patch 1680 +AUX gnusound-0.7.4-flac-1.1.3.patch 11622 RMD160 e157d53337f7840f6d0bd2294535bf0f9648ebd6 SHA1 c091a1217794ccbeee46574d4b3f63728c2bf4c6 SHA256 24472652fc113373e3fb4de780cd81d05026671f5dbdc48d90a6f11cd422a335 +MD5 9f6d1af17f682bfabec6552509f8ce3a files/gnusound-0.7.4-flac-1.1.3.patch 11622 +RMD160 e157d53337f7840f6d0bd2294535bf0f9648ebd6 files/gnusound-0.7.4-flac-1.1.3.patch 11622 +SHA256 24472652fc113373e3fb4de780cd81d05026671f5dbdc48d90a6f11cd422a335 files/gnusound-0.7.4-flac-1.1.3.patch 11622 DIST gnusound-0.6.2.tar.bz2 256284 RMD160 fbfa0249b6804707d491f5b74abdfceba9834285 SHA1 e82201bf7cd0c570ed6c6c396a623c0f8d3b5008 SHA256 f70cbb3ecf4c81b7c3fec2949d32d47710e9255d4b522fa02811637143fe56bc DIST gnusound-0.7.4.tar.bz2 513044 RMD160 775c7d3ae5dc94f56221526c7e1f0e9afb6a0b7f SHA1 c5fc8bc979d5031ab8850cbd39a072abe7372194 SHA256 9309d8212cf1d98ab1e8de776e52e2fcd6e68618b0bf4ac60766f6351746edfb DIST gnusound-0.7.tar.bz2 538950 RMD160 4985aa1cf66e75eed7c999ddf77ab3c1557d36f6 SHA1 cee586adb2f935738a850bdd8a3c7760ce385929 SHA256 09abbd9f70e65d92e884ae455a78a2b4cabbb2b1738e66073c22be5549ed4e94 @@ -40,18 +44,18 @@ EBUILD gnusound-0.6.2.ebuild 1331 RMD160 0212cfde72e7cd1eab9caab3e54a3d4dd94081b MD5 97129bc6a2d6e282221b1eecf07b0d90 gnusound-0.6.2.ebuild 1331 RMD160 0212cfde72e7cd1eab9caab3e54a3d4dd94081b0 gnusound-0.6.2.ebuild 1331 SHA256 b5e12d277157599649b32a26b2ec25c8712a1fa2abbaecc7eb98a160a503eb7a gnusound-0.6.2.ebuild 1331 -EBUILD gnusound-0.7.4.ebuild 2425 RMD160 25f341d4c68c88ffea9fe1eec7f4e7a231edc798 SHA1 359eff69019b7d4db950dd8905981566bdefeb53 SHA256 0efd4b654b79e59db1c28c7ff9d62f9ffa48b09dc023dda930ce1c8547b66ccf -MD5 8ea5cf63df747725dba4b9ff5df59d6f gnusound-0.7.4.ebuild 2425 -RMD160 25f341d4c68c88ffea9fe1eec7f4e7a231edc798 gnusound-0.7.4.ebuild 2425 -SHA256 0efd4b654b79e59db1c28c7ff9d62f9ffa48b09dc023dda930ce1c8547b66ccf gnusound-0.7.4.ebuild 2425 +EBUILD gnusound-0.7.4.ebuild 2469 RMD160 befc5a5cb0c168d4977ecf60f8ec75de3d1f9406 SHA1 06f3e8884d9263764c0443dc1c740ae23342c15d SHA256 9589ebfb4956881222ddaef327ac2079fd5c5e4819302a283537d65e5058fcd1 +MD5 e5091213628993b5d654ad8d0c0e28b9 gnusound-0.7.4.ebuild 2469 +RMD160 befc5a5cb0c168d4977ecf60f8ec75de3d1f9406 gnusound-0.7.4.ebuild 2469 +SHA256 9589ebfb4956881222ddaef327ac2079fd5c5e4819302a283537d65e5058fcd1 gnusound-0.7.4.ebuild 2469 EBUILD gnusound-0.7.ebuild 1288 RMD160 797a9eaf4dc37690937088ecac39cf3c6c12132a SHA1 c53819a0639a768ba11bb3fc5a0d4a03770c4c9f SHA256 02950ae9ed1aeee138427e37ec4326fa658463e79a281fd9a5f96533198da691 MD5 7b18357d587fce4ee0dd76340a595780 gnusound-0.7.ebuild 1288 RMD160 797a9eaf4dc37690937088ecac39cf3c6c12132a gnusound-0.7.ebuild 1288 SHA256 02950ae9ed1aeee138427e37ec4326fa658463e79a281fd9a5f96533198da691 gnusound-0.7.ebuild 1288 -MISC ChangeLog 2033 RMD160 343f0c0287ece704c984ccc6090b2209171a43ed SHA1 8811387eaaea1828969871b9bbba08482f42bfc7 SHA256 f4ef7c40dc94c177119b7f2c90c2faecd469f42715506a9366a3288aa1c7d8a6 -MD5 270a203d799cd687b8b293b0180e5067 ChangeLog 2033 -RMD160 343f0c0287ece704c984ccc6090b2209171a43ed ChangeLog 2033 -SHA256 f4ef7c40dc94c177119b7f2c90c2faecd469f42715506a9366a3288aa1c7d8a6 ChangeLog 2033 +MISC ChangeLog 2182 RMD160 21c9e18008486c9c75e2de196d8f6bf14cf9a931 SHA1 5c04b9b129313ef49775a01d1438d7093da2f3b5 SHA256 84fa2d38f061d373c8a0a5d2bf125539ad6e365b74a2bb1cd469c88a2c142ad9 +MD5 929b4fcb8af50590aa167f85db269875 ChangeLog 2182 +RMD160 21c9e18008486c9c75e2de196d8f6bf14cf9a931 ChangeLog 2182 +SHA256 84fa2d38f061d373c8a0a5d2bf125539ad6e365b74a2bb1cd469c88a2c142ad9 ChangeLog 2182 MISC metadata.xml 158 RMD160 6842e2189a50bd8a98e84802c38180ac1421c00e SHA1 703cea5a2109d41f7c87993c1f01d418a4c85174 SHA256 dfb5b47e6836db39fb187301dfcff1c2605e91d13d21db160806a563d8c75f9b MD5 a1eaeb2ae801daeb712c90c060e922dc metadata.xml 158 RMD160 6842e2189a50bd8a98e84802c38180ac1421c00e metadata.xml 158 @@ -68,7 +72,7 @@ SHA256 3961ff2a880a87ee5b2dad63c7e96a4d2fcaf07cdea6bc7487b88159e8aa10ea files/di -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) -iD8DBQFFbd3IvFcC4BYPU0oRAtG5AJ9hOHBE7yFxrtHI1AGQzejL2jT2jgCghNBN -VjMa8Bwv90JO54Pr+P5H1P4= -=mhiB +iD8DBQFFc9TVvFcC4BYPU0oRAvZjAKCp/TXYo+wp1fbmGOFt87aeaar43ACgr5+H +Us09ZwyVdQ+014lHCVGYKUM= +=GgHZ -----END PGP SIGNATURE----- diff --git a/media-sound/gnusound/files/gnusound-0.7.4-flac-1.1.3.patch b/media-sound/gnusound/files/gnusound-0.7.4-flac-1.1.3.patch new file mode 100644 index 000000000000..d05f6ecb6eac --- /dev/null +++ b/media-sound/gnusound/files/gnusound-0.7.4-flac-1.1.3.patch @@ -0,0 +1,339 @@ +--- gnusound-0.7.4/configure.ac.old 2006-12-01 09:22:39.000000000 +0100 ++++ gnusound-0.7.4/configure.ac 2006-12-01 09:22:44.000000000 +0100 +@@ -200,12 +200,26 @@ + AC_ARG_ENABLE(flac, AC_HELP_STRING([--disable-flac], [disable support for flac (default=autodetect)]), [ enable_flac=$enableval ], [ enable_flac=yes ]) + + if test "x$enable_flac" = "xyes"; then ++AC_TRY_RUN([ ++#include ++int main () { return FLAC_API_VERSION_CURRENT<8; } ++],legacy_flac=no,legacy_flac=yes,legacy_flac=no) ++ ++if test "x$legacy_flac" = xyes; then + AC_CHECK_HEADER([FLAC/format.h], + [AC_CHECK_LIB([FLAC], [FLAC__file_decoder_new], + [AC_DEFINE(HAVE_FLAC) + echo "-lFLAC -lm" > ${module_path}/.file_flac.cflags + file_drivers="flac $file_drivers"], + [echo > ${module_path}/.file_flac.cflags], [-lm])]) ++else ++AC_CHECK_HEADER([FLAC/format.h], ++ [AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_new], ++ [AC_DEFINE(HAVE_FLAC) ++ echo "-lFLAC -lm" > ${module_path}/.file_flac.cflags ++ file_drivers="flac $file_drivers"], ++ [echo > ${module_path}/.file_flac.cflags], [-lm])]) ++fi + fi + + if test "x${file_drivers}" = "x"; then +--- gnusound-0.7.4/modules/file_flac.c.old 2006-12-01 09:22:42.000000000 +0100 ++++ gnusound-0.7.4/modules/file_flac.c 2006-12-01 09:23:20.000000000 +0100 +@@ -32,11 +32,22 @@ + + #include + ++#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8 ++#define LEGACY_FLAC ++#else ++#undef LEGACY_FLAC ++#endif ++ ++ + struct flac_data { + + /* Decoder support. */ + ++#ifdef LEGACY_FLAC + FLAC__FileDecoder *decoder; ++#else ++ FLAC__StreamDecoder *decoder; ++#endif + + int dec_inited; + int dec_error; +@@ -51,7 +62,11 @@ + + /* Encoder support */ + ++#ifdef LEGACY_FLAC + FLAC__FileEncoder *encoder; ++#else ++ FLAC__StreamEncoder *encoder; ++#endif + + int enc_inited; + int enc_error; +@@ -95,11 +110,19 @@ + } \ + } + ++#ifdef LEGACY_FLAC + static FLAC__StreamDecoderWriteStatus + flac_dec_write_callback(const FLAC__FileDecoder *decoder, + const FLAC__Frame *frame, + const FLAC__int32 * const buffer[], + void *client_data) { ++#else ++static FLAC__StreamDecoderWriteStatus ++flac_dec_write_callback(const FLAC__StreamDecoder *decoder, ++ const FLAC__Frame *frame, ++ const FLAC__int32 * const buffer[], ++ void *client_data) { ++#endif + struct flac_data *flac_data = ((struct file *)client_data)->driver_data; + int i, j, count, channels; + void *dst; +@@ -131,8 +154,13 @@ + return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; + } + ++#ifdef LEGACY_FLAC + static void + flac_dec_metadata_callback(const FLAC__FileDecoder *decoder, ++#else ++static void ++flac_dec_metadata_callback(const FLAC__StreamDecoder *decoder, ++#endif + const FLAC__StreamMetadata *metadata, + void *client_data) { + struct flac_data *flac_data = ((struct file *)client_data)->driver_data; +@@ -173,10 +201,17 @@ + } + } + ++#ifdef LEGACY_FLAC + static void + flac_dec_error_callback(const FLAC__FileDecoder *decoder, + FLAC__StreamDecoderErrorStatus status, + void *client_data) { ++#else ++static void ++flac_dec_error_callback(const FLAC__StreamDecoder *decoder, ++ FLAC__StreamDecoderErrorStatus status, ++ void *client_data) { ++#endif + struct flac_data *flac_data = ((struct file *)client_data)->driver_data; + + flac_data->dec_error = 1; +@@ -186,8 +221,8 @@ + flac_open_for_reading(struct file *file, + struct file_params *params) { + struct flac_data *flac_data = file->driver_data; ++#ifdef LEGACY_FLAC + FLAC__FileDecoder *decoder; +- + decoder = FLAC__file_decoder_new(); + + FLAC__file_decoder_set_md5_checking(decoder, false); +@@ -204,12 +239,31 @@ + + if(!FLAC__file_decoder_process_until_end_of_metadata(decoder)) + return cmd_new_error_val("Could not process FLAC metadata: %s", FLAC__FileDecoderStateString[FLAC__file_decoder_get_state(decoder)]); +- ++#else ++ FLAC__StreamDecoder *decoder; ++ decoder = FLAC__stream_decoder_new(); ++ ++ FLAC__stream_decoder_set_md5_checking(decoder, true); ++ FLAC__stream_decoder_set_metadata_ignore_all(decoder); ++ FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_STREAMINFO); ++ FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_VORBIS_COMMENT); ++ ++ if(FLAC__stream_decoder_init_file(decoder, file->name, flac_dec_write_callback, flac_dec_metadata_callback, flac_dec_error_callback, file) != FLAC__STREAM_DECODER_INIT_STATUS_OK) ++ return cmd_new_error_val("Could not initialize FLAC decoder: %s", FLAC__StreamDecoderStateString[FLAC__stream_decoder_get_state(decoder)]); ++ ++ if(!FLAC__stream_decoder_process_until_end_of_metadata(decoder)) ++ return cmd_new_error_val("Could not process FLAC metadata: %s", FLAC__StreamDecoderStateString[FLAC__stream_decoder_get_state(decoder)]); ++#endif + flac_data->decoder = decoder; + + if(!flac_data->dec_inited || flac_data->dec_error) { ++#ifdef LEGACY_FLAC + FLAC__file_decoder_finish(decoder); + FLAC__file_decoder_delete(decoder); ++#else ++ FLAC__stream_decoder_finish(decoder); ++ FLAC__stream_decoder_delete(decoder); ++#endif + return cmd_new_error_val("Could not find STREAM info or " + "STREAM info was invalid"); + } +@@ -217,8 +271,13 @@ + /* This is highly unlikely. */ + + if(flac_data->dec_max_blocksize > SAVE_BUF_SIZE) { ++#ifdef LEGACY_FLAC + FLAC__file_decoder_finish(decoder); + FLAC__file_decoder_delete(decoder); ++#else ++ FLAC__stream_decoder_finish(decoder); ++ FLAC__stream_decoder_delete(decoder); ++#endif + return cmd_new_error_val("The maximum blocksize (%d) for this file " + "is larger than SAVE_BUF_SIZE (%d), increase " + "SAVE_BUF_SIZE and recompile", +@@ -239,7 +298,11 @@ + struct flac_data *flac_data = file->driver_data; + struct cmd_value *r; + int err, bits_per_sample; ++#ifdef LEGACY_FLAC + FLAC__FileEncoder *encoder; ++#else ++ FLAC__StreamEncoder *encoder; ++#endif + const char *status; + int max_lpc_order = 0, + blocksize = 1152, +@@ -258,13 +321,22 @@ + if(!flac_data->enc_buffer) + return cmd_new_error_val("Could not allocate encoder buffer"); + ++#ifdef LEGACY_FLAC + encoder = FLAC__file_encoder_new(); ++#else ++ encoder = FLAC__stream_encoder_new(); ++#endif + + /* Standard properties. */ + ++#ifdef LEGACY_FLAC + FLAC__file_encoder_set_filename(encoder, file->name); + FLAC__file_encoder_set_channels(encoder, params->channels); + FLAC__file_encoder_set_sample_rate(encoder, params->sample_rate); ++#else ++ FLAC__stream_encoder_set_channels(encoder, params->channels); ++ FLAC__stream_encoder_set_sample_rate(encoder, params->sample_rate); ++#endif + switch(params->sample_type) { + case SAMPLE_TYPE_INT_8: + bits_per_sample = 8; +@@ -281,7 +353,11 @@ + bits_per_sample = 24; + break; + } ++#ifdef LEGACY_FLAC + FLAC__file_encoder_set_bits_per_sample(encoder, bits_per_sample); ++#else ++ FLAC__stream_encoder_set_bits_per_sample(encoder, bits_per_sample); ++#endif + + /* FLAC encoding parameters. */ + +@@ -348,6 +424,7 @@ + break; + } + ++#ifdef LEGACY_FLAC + FLAC__file_encoder_set_do_exhaustive_model_search(encoder, exhaustive_model_search); + FLAC__file_encoder_set_blocksize(encoder, blocksize); + FLAC__file_encoder_set_max_lpc_order(encoder, max_lpc_order); +@@ -359,7 +436,6 @@ + } + + if((err = FLAC__file_encoder_init(encoder)) != FLAC__FILE_ENCODER_OK) { +- + /* Initialization failed, get error condition. */ + + if(flac_data->enc_buffer) +@@ -384,6 +460,39 @@ + return r; + + } ++#else ++ FLAC__stream_encoder_set_do_exhaustive_model_search(encoder, exhaustive_model_search); ++ FLAC__stream_encoder_set_blocksize(encoder, blocksize); ++ FLAC__stream_encoder_set_max_lpc_order(encoder, max_lpc_order); ++ FLAC__stream_encoder_set_min_residual_partition_order(encoder, residual_partition_order_min); ++ FLAC__stream_encoder_set_max_residual_partition_order(encoder, residual_partition_order_max); ++ if(params->channels == 2) { ++ FLAC__stream_encoder_set_do_mid_side_stereo(encoder, mid_side); ++ FLAC__stream_encoder_set_loose_mid_side_stereo(encoder, adaptive_mid_side); ++ } ++ ++ if((err = FLAC__stream_encoder_init_file(encoder, file->name, NULL, NULL)) != FLAC__STREAM_DECODER_INIT_STATUS_OK) { ++ /* Initialization failed, get error condition. */ ++ ++ if(flac_data->enc_buffer) ++ mem_free(flac_data->enc_buffer); ++ ++ if(FLAC__stream_encoder_get_state(encoder) != ++ FLAC__STREAM_ENCODER_OK) { ++ status = FLAC__StreamEncoderStateString[FLAC__stream_encoder_get_state(encoder)]; ++ } else { ++ status = FLAC__StreamEncoderStateString[FLAC__stream_encoder_get_state(encoder)]; ++ } ++ ++ FAIL("encoder initialization failure: %s\n", status); ++ r = cmd_new_error_val("Could not initialize encoder: %s", status); ++ ++ FLAC__stream_encoder_delete(encoder); ++ ++ return r; ++ ++ } ++#endif + + flac_data->encoder = encoder; + flac_data->enc_sample_type = params->sample_type; +@@ -419,7 +528,11 @@ + * buffer. + */ + ++#ifdef LEGACY_FLAC + if(!FLAC__file_decoder_process_single(flac_data->decoder)) ++#else ++ if(!FLAC__stream_decoder_process_single(flac_data->decoder)) ++#endif + return -1; + + if(flac_data->dec_error) +@@ -463,11 +576,21 @@ + break; + } + ++#ifdef LEGACY_FLAC + err = FLAC__file_encoder_process_interleaved(flac_data->encoder, + flac_data->enc_buffer, + count); ++#else ++ err = FLAC__stream_encoder_process_interleaved(flac_data->encoder, ++ flac_data->enc_buffer, ++ count); ++#endif + if(!err) { ++#ifdef LEGACY_FLAC + FAIL("encoder failure: %s\n", FLAC__FileEncoderStateString[FLAC__file_encoder_get_state(flac_data->encoder)]); ++#else ++ FAIL("encoder failure: %s\n", FLAC__StreamEncoderStateString[FLAC__stream_encoder_get_state(flac_data->encoder)]); ++#endif + return -1; + } + +@@ -479,16 +602,26 @@ + struct flac_data *flac_data = file->driver_data; + + if(flac_data->dec_inited) { ++#ifdef LEGACY_FLAC + FLAC__file_decoder_finish(flac_data->decoder); + FLAC__file_decoder_delete(flac_data->decoder); ++#else ++ FLAC__stream_decoder_finish(flac_data->decoder); ++ FLAC__stream_decoder_delete(flac_data->decoder); ++#endif + // if(flac_data->dec_buffer) + // mem_free(flac_data->dec_buffer); + flac_data->dec_inited = 0; + } + + if(flac_data->enc_inited) { ++#ifdef LEGACY_FLAC + FLAC__file_encoder_finish(flac_data->encoder); + FLAC__file_encoder_delete(flac_data->encoder); ++#else ++ FLAC__stream_encoder_finish(flac_data->encoder); ++ FLAC__stream_encoder_delete(flac_data->encoder); ++#endif + if(flac_data->enc_buffer) + mem_free(flac_data->enc_buffer); + flac_data->enc_inited = 0; diff --git a/media-sound/gnusound/gnusound-0.7.4.ebuild b/media-sound/gnusound/gnusound-0.7.4.ebuild index 803c5bd47eb2..e70e22507bfa 100644 --- a/media-sound/gnusound/gnusound-0.7.4.ebuild +++ b/media-sound/gnusound/gnusound-0.7.4.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/media-sound/gnusound/gnusound-0.7.4.ebuild,v 1.1 2006/11/29 19:23:12 aballier Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-sound/gnusound/gnusound-0.7.4.ebuild,v 1.2 2006/12/04 07:57:40 aballier Exp $ inherit toolchain-funcs @@ -52,6 +52,7 @@ src_unpack() { epatch "${FILESDIR}/${P}-amd64.patch" epatch "${FILESDIR}/${P}-ffmpeg-struct.patch" epatch "${FILESDIR}/${P}-automagic.patch" + epatch "${FILESDIR}/${P}-flac-1.1.3.patch" AT_M4DIR="config" eaclocal eautoconf -- 2.26.2