From 0922f5d03ba180c71800ade9470131c5d09afed5 Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Sat, 18 Nov 2006 11:11:50 +0000 Subject: [PATCH] Add patch from Josh Coalson to be able to build with flac 1.1.3 Package-Manager: portage-2.1.2_rc2 --- media-sound/moc/ChangeLog | 6 +- media-sound/moc/Manifest | 26 +- .../moc/files/moc-2.4.1+flac-1.1.3.patch | 318 ++++++++++++++++++ media-sound/moc/moc-2.4.1.ebuild | 5 +- 4 files changed, 341 insertions(+), 14 deletions(-) create mode 100644 media-sound/moc/files/moc-2.4.1+flac-1.1.3.patch diff --git a/media-sound/moc/ChangeLog b/media-sound/moc/ChangeLog index 877ada213b65..e3eb093ea9dc 100644 --- a/media-sound/moc/ChangeLog +++ b/media-sound/moc/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for media-sound/moc # Copyright 2000-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-sound/moc/ChangeLog,v 1.27 2006/11/07 06:53:15 aballier Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-sound/moc/ChangeLog,v 1.28 2006/11/18 11:11:50 aballier Exp $ + + 18 Nov 2006; Alexis Ballier + +files/moc-2.4.1+flac-1.1.3.patch, moc-2.4.1.ebuild: + Add patch from Josh Coalson to be able to build with flac 1.1.3 *moc-2.4.1 (07 Nov 2006) diff --git a/media-sound/moc/Manifest b/media-sound/moc/Manifest index 8cb85c667c10..d462dce4991c 100644 --- a/media-sound/moc/Manifest +++ b/media-sound/moc/Manifest @@ -9,6 +9,10 @@ AUX moc-2.3.2-configure.patch 3063 RMD160 8c9c31f98ca7ce0f5104e571e51cd47f718a17 MD5 7d3794df50327b997ab26ab0a1b6de61 files/moc-2.3.2-configure.patch 3063 RMD160 8c9c31f98ca7ce0f5104e571e51cd47f718a1740 files/moc-2.3.2-configure.patch 3063 SHA256 a8be1021c7dbdb174acdb9978693e8686adfd22f29a465ca4cef0b6dbd316809 files/moc-2.3.2-configure.patch 3063 +AUX moc-2.4.1+flac-1.1.3.patch 9407 RMD160 ebb75d57339ac06e471ac458cacb8ee66e06a242 SHA1 4bc86b8676bee1a53e99da5b3752a5601834231d SHA256 488245b26d2b4e1ae4480882f67762a0a7a7708103368b2116cde4788ef8c826 +MD5 60edb5eb095015cf5aadd3ed1911f9e0 files/moc-2.4.1+flac-1.1.3.patch 9407 +RMD160 ebb75d57339ac06e471ac458cacb8ee66e06a242 files/moc-2.4.1+flac-1.1.3.patch 9407 +SHA256 488245b26d2b4e1ae4480882f67762a0a7a7708103368b2116cde4788ef8c826 files/moc-2.4.1+flac-1.1.3.patch 9407 DIST moc-2.1.4.tar.gz 197152 RMD160 3e3cd1f88a32d685bf9600e8b48322f595d1e054 SHA1 c4cbe30a437b4e9f658be9ffd744649fb612f8bb SHA256 c61525976c65e9b9cb1cb0630f8bad19d7850334b16013ff543309f7deab2494 DIST moc-2.2.0.tar.gz 233176 RMD160 ffc6ba4f9c30ddb9349ba989020e0db2b3736a2c SHA1 e269c731c989b63334a67180203abb7873edd118 SHA256 6791dac133c86ff2a2dd77fc19ecfcde2397358c8e27ec5918d2b2b99b7b60f7 DIST moc-2.3.0.tar.bz2 402954 RMD160 e6f4a094ac65004b18ef06dabc2d5524208be8a5 SHA1 42e987be93436ef7263b20375b45f855e3e9dd4b SHA256 5a8804fbbba43d20e3ec80e823f9eefacb5f73ce4090aa3e5d064bc12ce813a7 @@ -40,14 +44,14 @@ EBUILD moc-2.4.0.ebuild 1820 RMD160 59eedc06d186639a80d1ae0115f2890ff19dc5ee SHA MD5 a50aabad0e316b1e450df360c3fcdd52 moc-2.4.0.ebuild 1820 RMD160 59eedc06d186639a80d1ae0115f2890ff19dc5ee moc-2.4.0.ebuild 1820 SHA256 13bde2f5e9a1feea68d6d39b3a5982fc1c6459b7ef0fa6e525c5674afe99b97e moc-2.4.0.ebuild 1820 -EBUILD moc-2.4.1.ebuild 1775 RMD160 fb71cf9142088b0ed638ddf40308b5f861f2b4a3 SHA1 4a96eac663f73df20f1a51a0d4d60cecf4b3d40c SHA256 ab60a3068bd988bab27b51da72f593bba14b1531fb4e5b33744f8335b687a0d7 -MD5 78ce88639f70dc1c331ce25696eb6a46 moc-2.4.1.ebuild 1775 -RMD160 fb71cf9142088b0ed638ddf40308b5f861f2b4a3 moc-2.4.1.ebuild 1775 -SHA256 ab60a3068bd988bab27b51da72f593bba14b1531fb4e5b33744f8335b687a0d7 moc-2.4.1.ebuild 1775 -MISC ChangeLog 4068 RMD160 e6800c9daf3392c74c7b2874c79dd5c93180adeb SHA1 27359d6f006ece3ac78cf30705e8ab364feea4e1 SHA256 7c5341e9c6d51fd3332806c7a238df7ab941a3e10bd262fc7a9c0b79318efe3a -MD5 20d37a25076e83d17b8b98b7a0eb385a ChangeLog 4068 -RMD160 e6800c9daf3392c74c7b2874c79dd5c93180adeb ChangeLog 4068 -SHA256 7c5341e9c6d51fd3332806c7a238df7ab941a3e10bd262fc7a9c0b79318efe3a ChangeLog 4068 +EBUILD moc-2.4.1.ebuild 1812 RMD160 0a4381b79c20e2656fa52158362d357a9a378702 SHA1 ddcd00ca7879e92fc9ba1618d7ff276ca1155b92 SHA256 5586c7f97f93ce1a1bbdb12b6e6aaf4d02105e8999dfc06ca8d31567d0d46059 +MD5 8317ba2c4614e8cfd072247fdd95a6b9 moc-2.4.1.ebuild 1812 +RMD160 0a4381b79c20e2656fa52158362d357a9a378702 moc-2.4.1.ebuild 1812 +SHA256 5586c7f97f93ce1a1bbdb12b6e6aaf4d02105e8999dfc06ca8d31567d0d46059 moc-2.4.1.ebuild 1812 +MISC ChangeLog 4242 RMD160 5fa98e2c5524ecd13dc976b95e1f9ae37696e1e4 SHA1 51f6dc06c3a3f20f49eede5a31cdeece09135f16 SHA256 697ec50839361c86ed5ca7e30b37d15da0599c0d33eb00d38066b2c7f20341d1 +MD5 2c5354d24cfa70120fd622b9feced98b ChangeLog 4242 +RMD160 5fa98e2c5524ecd13dc976b95e1f9ae37696e1e4 ChangeLog 4242 +SHA256 697ec50839361c86ed5ca7e30b37d15da0599c0d33eb00d38066b2c7f20341d1 ChangeLog 4242 MISC metadata.xml 158 RMD160 6842e2189a50bd8a98e84802c38180ac1421c00e SHA1 703cea5a2109d41f7c87993c1f01d418a4c85174 SHA256 dfb5b47e6836db39fb187301dfcff1c2605e91d13d21db160806a563d8c75f9b MD5 a1eaeb2ae801daeb712c90c060e922dc metadata.xml 158 RMD160 6842e2189a50bd8a98e84802c38180ac1421c00e metadata.xml 158 @@ -76,7 +80,7 @@ SHA256 84d4ad52835e1558fae5249cb8f19cdf311bde1bb85ba62b976cd85f23da50c8 files/di -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) -iD8DBQFFUC0zvFcC4BYPU0oRAjKlAKCQFov6eX6sFKu6k1gsf6LifMtXGgCfVe2F -++xbxA9m6xbdkmQqGeR68kI= -=150N +iD8DBQFFXuoCvFcC4BYPU0oRAqclAJ0QfzZWEi79PxpQiTjiDvGjHaRaMACfe8ML +EhywiE/1AMYgEbHbSpMC33A= +=q9FW -----END PGP SIGNATURE----- diff --git a/media-sound/moc/files/moc-2.4.1+flac-1.1.3.patch b/media-sound/moc/files/moc-2.4.1+flac-1.1.3.patch new file mode 100644 index 000000000000..176db8d9e0fe --- /dev/null +++ b/media-sound/moc/files/moc-2.4.1+flac-1.1.3.patch @@ -0,0 +1,318 @@ +diff -ru moc-2.4.1/configure moc-2.4.1-b2/configure +--- moc-2.4.1/configure 2006-10-08 08:38:06.000000000 -0700 ++++ moc-2.4.1-b2/configure 2006-10-31 00:22:00.000000000 -0800 +@@ -30698,7 +30698,7 @@ + LIBFLAC_LIBS="-L$libdir" + fi + +- LIBFLAC_LIBS="$LIBFLAC_LIBS -lFLAC -lm" ++ LIBFLAC_LIBS="$LIBFLAC_LIBS -lFLAC -logg -lm" + + if test "x$libFLAC_includes" != "x" ; then + LIBFLAC_CFLAGS="-I$libFLAC_includes" +diff -ru moc-2.4.1/decoder_plugins/flac/flac.c moc-2.4.1-b2/decoder_plugins/flac/flac.c +--- moc-2.4.1/decoder_plugins/flac/flac.c 2006-02-12 03:55:10.000000000 -0800 ++++ moc-2.4.1-b2/decoder_plugins/flac/flac.c 2006-10-31 00:23:55.000000000 -0800 +@@ -28,6 +28,13 @@ + #include "log.h" + #include "io.h" + ++/* by LEGACY_FLAC we mean pre-1.1.3, before FLAC__SeekableStreamDecoder was merged into FLAC__StreamDecoder */ ++#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8 ++#define LEGACY_FLAC ++#else ++#undef LEGACY_FLAC ++#endif ++ + #define MAX_SUPPORTED_CHANNELS 2 + + #define SAMPLES_PER_WRITE 512 +@@ -35,7 +42,11 @@ + + struct flac_data + { ++#ifdef LEGACY_FLAC + FLAC__SeekableStreamDecoder *decoder; ++#else ++ FLAC__StreamDecoder *decoder; ++#endif + struct io_stream *stream; + int bitrate; + int abort; /* abort playing (due to an error) */ +@@ -109,7 +120,11 @@ + } + + static FLAC__StreamDecoderWriteStatus write_callback ( ++#ifdef LEGACY_FLAC + const FLAC__SeekableStreamDecoder *decoder ATTR_UNUSED, ++#else ++ const FLAC__StreamDecoder *decoder ATTR_UNUSED, ++#endif + const FLAC__Frame *frame, + const FLAC__int32 * const buffer[], void *client_data) + { +@@ -127,7 +142,11 @@ + } + + static void metadata_callback ( ++#ifdef LEGACY_FLAC + const FLAC__SeekableStreamDecoder *decoder ATTR_UNUSED, ++#else ++ const FLAC__StreamDecoder *decoder ATTR_UNUSED, ++#endif + const FLAC__StreamMetadata *metadata, void *client_data) + { + struct flac_data *data = (struct flac_data *)client_data; +@@ -147,7 +166,11 @@ + } + + static void error_callback ( ++#ifdef LEGACY_FLAC + const FLAC__SeekableStreamDecoder *decoder ATTR_UNUSED, ++#else ++ const FLAC__StreamDecoder *decoder ATTR_UNUSED, ++#endif + FLAC__StreamDecoderErrorStatus status, void *client_data) + { + struct flac_data *data = (struct flac_data *)client_data; +@@ -160,9 +183,15 @@ + decoder_error (&data->error, ERROR_FATAL, 0, "FLAC: lost sync"); + } + ++#ifdef LEGACY_FLAC + static FLAC__SeekableStreamDecoderReadStatus read_callback ( + const FLAC__SeekableStreamDecoder *decoder ATTR_UNUSED, + FLAC__byte buffer[], unsigned *bytes, void *client_data) ++#else ++static FLAC__StreamDecoderReadStatus read_callback ( ++ const FLAC__StreamDecoder *decoder ATTR_UNUSED, ++ FLAC__byte buffer[], size_t *bytes, void *client_data) ++#endif + { + struct flac_data *data = (struct flac_data *)client_data; + ssize_t res; +@@ -171,52 +200,97 @@ + + if (res > 0) { + *bytes = res; ++#ifdef LEGACY_FLAC ++ return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK; ++#else + return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; ++#endif + } + + if (res == 0) { + *bytes = 0; ++ /* not sure why this works, but if it ain't broke... */ + return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; + } + + error ("read error: %s", io_strerror(data->stream)); + ++#ifdef LEGACY_FLAC ++ return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR; ++#else + return FLAC__STREAM_DECODER_READ_STATUS_ABORT; ++#endif + } + ++#ifdef LEGACY_FLAC + static FLAC__SeekableStreamDecoderSeekStatus seek_callback ( + const FLAC__SeekableStreamDecoder *decoder ATTR_UNUSED, + FLAC__uint64 absolute_byte_offset, void *client_data) ++#else ++static FLAC__StreamDecoderSeekStatus seek_callback ( ++ const FLAC__StreamDecoder *decoder ATTR_UNUSED, ++ FLAC__uint64 absolute_byte_offset, void *client_data) ++#endif + { + struct flac_data *data = (struct flac_data *)client_data; + ++#ifdef LEGACY_FLAC + return io_seek(data->stream, absolute_byte_offset, SEEK_SET) >= 0 + ? FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK + : FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR; ++#else ++ return io_seek(data->stream, absolute_byte_offset, SEEK_SET) >= 0 ++ ? FLAC__STREAM_DECODER_SEEK_STATUS_OK ++ : FLAC__STREAM_DECODER_SEEK_STATUS_ERROR; ++#endif + } + ++#ifdef LEGACY_FLAC + static FLAC__SeekableStreamDecoderTellStatus tell_callback ( + const FLAC__SeekableStreamDecoder *decoder ATTR_UNUSED, + FLAC__uint64 *absolute_byte_offset, void *client_data) ++#else ++static FLAC__StreamDecoderTellStatus tell_callback ( ++ const FLAC__StreamDecoder *decoder ATTR_UNUSED, ++ FLAC__uint64 *absolute_byte_offset, void *client_data) ++#endif + { + struct flac_data *data = (struct flac_data *)client_data; + + *absolute_byte_offset = io_tell (data->stream); ++#ifdef LEGACY_FLAC + return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK; ++#else ++ return FLAC__STREAM_DECODER_TELL_STATUS_OK; ++#endif + } + ++#ifdef LEGACY_FLAC + static FLAC__SeekableStreamDecoderLengthStatus length_callback ( + const FLAC__SeekableStreamDecoder *decoder ATTR_UNUSED, + FLAC__uint64 *stream_length, void *client_data) ++#else ++static FLAC__StreamDecoderLengthStatus length_callback ( ++ const FLAC__StreamDecoder *decoder ATTR_UNUSED, ++ FLAC__uint64 *stream_length, void *client_data) ++#endif + { + struct flac_data *data = (struct flac_data *)client_data; + + *stream_length = io_file_size (data->stream); ++#ifdef LEGACY_FLAC + return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK; ++#else ++ return FLAC__STREAM_DECODER_LENGTH_STATUS_OK; ++#endif + } + + static FLAC__bool eof_callback ( ++#ifdef LEGACY_FLAC + const FLAC__SeekableStreamDecoder *decoder ATTR_UNUSED, ++#else ++ const FLAC__StreamDecoder *decoder ATTR_UNUSED, ++#endif + void *client_data) + { + struct flac_data *data = (struct flac_data *)client_data; +@@ -248,6 +322,7 @@ + + data->ok = 1; + ++#ifdef LEGACY_FLAC + if (!(data->decoder = FLAC__seekable_stream_decoder_new())) { + decoder_error (&data->error, ERROR_FATAL, 0, + "FLAC__seekable_stream_decoder_new() failed"); +@@ -279,7 +354,7 @@ + eof_callback); + + if (FLAC__seekable_stream_decoder_init(data->decoder) +- != FLAC__FILE_DECODER_OK) { ++ != FLAC__SEEKABLE_STREAM_DECODER_OK) { + decoder_error (&data->error, ERROR_FATAL, 0, + "FLAC__seekable_stream_decoder_init() failed"); + data->ok = 0; +@@ -294,6 +369,36 @@ + data->ok = 0; + return data; + } ++#else ++ if (!(data->decoder = FLAC__stream_decoder_new())) { ++ decoder_error (&data->error, ERROR_FATAL, 0, ++ "FLAC__stream_decoder_new() failed"); ++ data->ok = 0; ++ return data; ++ } ++ ++ FLAC__stream_decoder_set_md5_checking (data->decoder, false); ++ ++ FLAC__stream_decoder_set_metadata_ignore_all (data->decoder); ++ FLAC__stream_decoder_set_metadata_respond (data->decoder, ++ FLAC__METADATA_TYPE_STREAMINFO); ++ ++ if (FLAC__stream_decoder_init_stream(data->decoder, read_callback, seek_callback, tell_callback, length_callback, eof_callback, write_callback, metadata_callback, error_callback, data) ++ != FLAC__STREAM_DECODER_INIT_STATUS_OK) { ++ decoder_error (&data->error, ERROR_FATAL, 0, ++ "FLAC__stream_decoder_init() failed"); ++ data->ok = 0; ++ return data; ++ } ++ ++ if (!FLAC__stream_decoder_process_until_end_of_metadata(data->decoder)) { ++ decoder_error (&data->error, ERROR_FATAL, 0, ++ "FLAC__stream_decoder_process_until_end_of_metadata()" ++ " failed."); ++ data->ok = 0; ++ return data; ++ } ++#endif + + return data; + } +@@ -309,8 +414,13 @@ + + if (data->ok) { + if (data->decoder) { ++#ifdef LEGACY_FLAC + FLAC__seekable_stream_decoder_finish (data->decoder); + FLAC__seekable_stream_decoder_delete (data->decoder); ++#else ++ FLAC__stream_decoder_finish (data->decoder); ++ FLAC__stream_decoder_delete (data->decoder); ++#endif + } + io_close (data->stream); + } +@@ -430,11 +540,19 @@ + target_sample = (FLAC__uint64)((sec/(double)data->length) * + (double)data->total_samples); + ++#ifdef LEGACY_FLAC + if (FLAC__seekable_stream_decoder_seek_absolute(data->decoder, + target_sample)) ++#else ++ if (FLAC__stream_decoder_seek_absolute(data->decoder, target_sample)) ++#endif + return sec; + else { ++#ifdef LEGACY_FLAC + logit ("FLAC__seekable_stream_decoder_seek_absolute() failed."); ++#else ++ logit ("FLAC__stream_decoder_seek_absolute() failed."); ++#endif + return -1; + } + } +@@ -469,22 +587,34 @@ + if (!data->sample_buffer_fill) { + debug ("decoding..."); + +- if (FLAC__seekable_stream_decoder_get_state(data->decoder) +- == FLAC__FILE_DECODER_END_OF_FILE) { ++#ifdef LEGACY_FLAC ++ if (FLAC__seekable_stream_decoder_get_state(data->decoder) == FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM) ++#else ++ if (FLAC__stream_decoder_get_state(data->decoder) == FLAC__STREAM_DECODER_END_OF_STREAM) ++#endif ++ { + logit ("EOF"); + return 0; + } + +- if (!FLAC__seekable_stream_decoder_process_single( +- data->decoder)) { ++#ifdef LEGACY_FLAC ++ if (!FLAC__seekable_stream_decoder_process_single(data->decoder)) ++#else ++ if (!FLAC__stream_decoder_process_single(data->decoder)) ++#endif ++ { + decoder_error (&data->error, ERROR_FATAL, 0, + "Read error processing frame."); + return 0; + } + + /* Count the bitrate */ ++#ifdef LEGACY_FLAC + if(!FLAC__seekable_stream_decoder_get_decode_position( + data->decoder, &decode_position)) ++#else ++ if(!FLAC__stream_decoder_get_decode_position(data->decoder, &decode_position)) ++#endif + decode_position = 0; + if (decode_position > data->last_decode_position) { + int bytes_per_sec = bytes_per_sample * data->sample_rate diff --git a/media-sound/moc/moc-2.4.1.ebuild b/media-sound/moc/moc-2.4.1.ebuild index f7c086aea524..345cd1e6fa2e 100644 --- a/media-sound/moc/moc-2.4.1.ebuild +++ b/media-sound/moc/moc-2.4.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/media-sound/moc/moc-2.4.1.ebuild,v 1.1 2006/11/07 06:53:15 aballier Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-sound/moc/moc-2.4.1.ebuild,v 1.2 2006/11/18 11:11:50 aballier Exp $ inherit eutils autotools @@ -20,7 +20,7 @@ DEPEND="media-libs/libao sys-libs/ncurses alsa? ( >=media-libs/alsa-lib-0.9 ) sndfile? ( >=media-libs/libsndfile-1.0.0 ) - flac? ( ~media-libs/flac-1.1.2 ) + flac? ( media-libs/flac ) ffmpeg? ( media-video/ffmpeg ) mad? ( media-libs/libmad sys-libs/zlib media-libs/libid3tag ) musepack? ( media-libs/libmpcdec >=media-libs/taglib-1.3 ) @@ -32,6 +32,7 @@ DEPEND="media-libs/libao src_unpack() { unpack ${A} cd "${S}" + epatch "${FILESDIR}/${P}+flac-1.1.3.patch" } src_compile() { -- 2.26.2