summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--media-sound/kwave/ChangeLog10
-rw-r--r--media-sound/kwave/files/kwave-0.7.9-debian-431199.diff61
-rw-r--r--media-sound/kwave/files/kwave-0.7.9_flac-v1.1.3_and_v1.1.4-support.diff175
-rw-r--r--media-sound/kwave/kwave-0.7.9.ebuild9
4 files changed, 253 insertions, 2 deletions
diff --git a/media-sound/kwave/ChangeLog b/media-sound/kwave/ChangeLog
index fde9ecc75c6e..8537a594bd0b 100644
--- a/media-sound/kwave/ChangeLog
+++ b/media-sound/kwave/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for media-sound/kwave
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-sound/kwave/ChangeLog,v 1.1 2007/06/21 06:00:51 philantrop Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-sound/kwave/ChangeLog,v 1.2 2007/07/21 20:11:55 philantrop Exp $
+
+ 21 Jul 2007; Wulf C. Krueger <philantrop@gentoo.org>
+ +files/kwave-0.7.9-debian-431199.diff,
+ +files/kwave-0.7.9_flac-v1.1.3_and_v1.1.4-support.diff,
+ kwave-0.7.9.ebuild:
+ Added the patches as requested in bug 186009 to fix compilation issues with
+ newer flac versions. Thanks, Roberto and Thomas, for providing all the
+ necessary information!
*kwave-0.7.9 (21 Jun 2007)
diff --git a/media-sound/kwave/files/kwave-0.7.9-debian-431199.diff b/media-sound/kwave/files/kwave-0.7.9-debian-431199.diff
new file mode 100644
index 000000000000..255ad0a23163
--- /dev/null
+++ b/media-sound/kwave/files/kwave-0.7.9-debian-431199.diff
@@ -0,0 +1,61 @@
+diff -u plugins/codec_flac/FlacDecoder.cpp /usr/src/packages/multimedia/sound/kwave-svn/trunk/plugins/codec_flac/FlacDecoder.cpp
+--- /tmp/kwave-0.7.9.orig/plugins/codec_flac/FlacDecoder.cpp 2007-07-01 09:50:18.000000000 +0200
++++ plugins/codec_flac/FlacDecoder.cpp 2007-06-17 10:28:45.000000000 +0200
+@@ -54,7 +54,7 @@
+
+ //***************************************************************************
+ ::FLAC__StreamDecoderReadStatus FlacDecoder::read_callback(
+- FLAC__byte buffer[], unsigned int *bytes)
++ FLAC__byte buffer[], size_t *bytes)
+ {
+ Q_ASSERT(bytes);
+ Q_ASSERT(m_source);
+@@ -67,7 +67,7 @@
+ }
+
+ // read into application buffer
+- unsigned long int len = *bytes;
++ Q_LONG len = *bytes;
+ *bytes = m_source->readBlock((char*)(&(buffer[0])), len);
+
+ if (!*bytes) return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
+diff -u plugins/codec_flac/FlacDecoder.h /usr/src/packages/multimedia/sound/kwave-svn/trunk/plugins/codec_flac/FlacDecoder.h
+--- /tmp/kwave-0.7.9.orig/plugins/codec_flac/FlacDecoder.h 2007-07-01 09:49:39.000000000 +0200
++++ plugins/codec_flac/FlacDecoder.h 2007-06-17 10:28:45.000000000 +0200
+@@ -101,7 +101,7 @@
+ * @return read state
+ */
+ virtual ::FLAC__StreamDecoderReadStatus read_callback(
+- FLAC__byte buffer[], unsigned int *bytes);
++ FLAC__byte buffer[], size_t *bytes);
+
+ /**
+ * FLAC decoder interface: write callback.
+diff -u plugins/codec_flac/FlacEncoder.cpp /usr/src/packages/multimedia/sound/kwave-svn/trunk/plugins/codec_flac/FlacEncoder.cpp
+--- /tmp/kwave-0.7.9.orig/plugins/codec_flac/FlacEncoder.cpp 2007-07-01 09:50:18.000000000 +0200
++++ plugins/codec_flac/FlacEncoder.cpp 2007-06-17 10:28:45.000000000 +0200
+@@ -73,8 +73,8 @@
+
+ /***************************************************************************/
+ ::FLAC__StreamEncoderWriteStatus FlacEncoder::write_callback(
+- const FLAC__byte buffer[], unsigned int bytes,
+- unsigned int /* samples */, unsigned int /* current_frame */)
++ const FLAC__byte buffer[], size_t bytes,
++ unsigned /* samples */, unsigned /* current_frame */)
+ {
+ // qDebug("FlacEncoder::write_callback(%u)", samples); // ###
+ Q_ASSERT(m_dst);
+diff -u plugins/codec_flac/FlacEncoder.h /usr/src/packages/multimedia/sound/kwave-svn/trunk/plugins/codec_flac/FlacEncoder.h
+--- /tmp/kwave-0.7.9.orig/plugins/codec_flac/FlacEncoder.h 2007-07-01 09:49:39.000000000 +0200
++++ plugins/codec_flac/FlacEncoder.h 2007-06-17 10:28:45.000000000 +0200
+@@ -70,8 +70,8 @@
+ * @return FLAC stream encoder write status
+ */
+ virtual ::FLAC__StreamEncoderWriteStatus write_callback(
+- const FLAC__byte buffer[], unsigned int bytes,
+- unsigned int samples, unsigned int current_frame);
++ const FLAC__byte buffer[], size_t bytes,
++ unsigned samples, unsigned current_frame);
+
+ /**
+ * Callback for encoding meta data
diff --git a/media-sound/kwave/files/kwave-0.7.9_flac-v1.1.3_and_v1.1.4-support.diff b/media-sound/kwave/files/kwave-0.7.9_flac-v1.1.3_and_v1.1.4-support.diff
new file mode 100644
index 000000000000..92b92540c2f0
--- /dev/null
+++ b/media-sound/kwave/files/kwave-0.7.9_flac-v1.1.3_and_v1.1.4-support.diff
@@ -0,0 +1,175 @@
+Index: plugins/codec_flac/FlacEncoder.cpp
+===================================================================
+--- plugins/codec_flac/FlacEncoder.cpp (Revision 1972)
++++ plugins/codec_flac/FlacEncoder.cpp (Arbeitskopie)
+@@ -208,15 +208,27 @@
+ }
+
+ // initialize the FLAC stream, this already writes some meta info
+- FLAC::Encoder::Stream::State state = init();
+- if (state != FLAC__STREAM_ENCODER_OK) {
+- qWarning("state = %s", state.as_cstring());
+- KMessageBox::error(widget,
+- i18n("Unable to open the FLAC encoder!"));
+- m_info = 0;
+- result = false;
+- break;
+- }
++#if defined(FLAC_API_VERSION_1_1_3)
++ FLAC__StreamEncoderInitStatus init_state = init();
++ if (init_state != FLAC__STREAM_ENCODER_INIT_STATUS_OK) {
++ qWarning("state = %d", (int)init_state);
++ KMessageBox::error(widget,
++ i18n("Unable to open the FLAC encoder!"));
++ m_info = 0;
++ result = false;
++ break;
++ }
++#else
++ FLAC::Encoder::Stream::State init_state = init();
++ if (init_state != FLAC__STREAM_ENCODER_OK) {
++ qWarning("state = %s", init_state.as_cstring());
++ KMessageBox::error(widget,
++ i18n("Unable to open the FLAC encoder!"));
++ m_info = 0;
++ result = false;
++ break;
++ }
++#endif
+
+ // allocate output buffers, with FLAC 32 bit format
+ unsigned int len = 8192; // samples
+Index: plugins/codec_flac/FlacDecoder.cpp
+===================================================================
+--- plugins/codec_flac/FlacDecoder.cpp (Revision 1972)
++++ plugins/codec_flac/FlacDecoder.cpp (Arbeitskopie)
+@@ -158,7 +158,7 @@
+ const FLAC::Metadata::VorbisComment &vorbis_comments)
+ {
+ // first of all: the vendor string, specifying the software
+-#ifdef FLAC_API_VERSION_1_1_1_OR_OLDER
++#if defined(FLAC_API_VERSION_1_1_1_OR_OLDER)
+ if (vorbis_comments.get_vendor_string().is_valid()) {
+ const FLAC::Metadata::VorbisComment::Entry &entry =
+ vorbis_comments.get_vendor_string();
+@@ -169,13 +169,15 @@
+ m_info.set(INF_SOFTWARE, s);
+ qDebug("Encoded by: '%s'\n\n", s.local8Bit().data());
+ }
+-#else
++#elif defined(FLAC_API_VERSION_1_1_2) || defined(FLAC_API_VERSION_1_1_3)
+ QString vendor = QString::fromUtf8(reinterpret_cast<const char *>(
+ vorbis_comments.get_vendor_string()));
+ if (vendor.length()) {
+ m_info.set(INF_SOFTWARE, vendor);
+ qDebug("Encoded by: '%s'\n\n", vendor.local8Bit().data());
+ }
++#else
++ #error "no usable FLAC API found"
+ #endif
+
+ // parse all vorbis comments into Kwave file properties
+@@ -275,17 +277,26 @@
+ set_metadata_respond_all();
+
+ // initialize the stream
+- FLAC::Decoder::Stream::State state = init();
+- if (state >= FLAC__STREAM_DECODER_END_OF_STREAM) {
+- KMessageBox::error(widget, i18n(
+- "opening the FLAC bitstream failed."));
+- return false;
++#if defined(FLAC_API_VERSION_1_1_3)
++ FLAC__StreamDecoderInitStatus init_state = init();
++ if (init_state > FLAC__STREAM_DECODER_INIT_STATUS_OK) {
++ KMessageBox::error(widget, i18n(
++ "opening the FLAC bitstream failed."));
++ return false;
+ }
++#else /* API v1.1.2 and older */
++ FLAC::Decoder::Stream::State init_state = init();
++ if (init_state >= FLAC__STREAM_DECODER_END_OF_STREAM) {
++ KMessageBox::error(widget, i18n(
++ "opening the FLAC bitstream failed."));
++ return false;
++ }
++#endif
+
+ // read in all metadata
+ process_until_end_of_metadata();
+
+- state = get_state();
++ FLAC::Decoder::Stream::State state = get_state();
+ if (state >= FLAC__STREAM_DECODER_END_OF_STREAM) {
+ KMessageBox::error(widget, i18n(
+ "error while parsing FLAC metadata. (%s)"),
+Index: configure.in
+===================================================================
+--- configure.in (Revision 1972)
++++ configure.in (Arbeitskopie)
+@@ -449,6 +449,7 @@
+ AC_LINK_IFELSE([
+ #include <FLAC/format.h>
+ #include <FLAC++/decoder.h>
++ #include <FLAC++/encoder.h>
+ #include <FLAC++/metadata.h>
+
+ int main(int, char **)
+@@ -456,16 +457,54 @@
+ const FLAC::Metadata::VorbisComment vorbis_comments;
+ const FLAC__byte *vendor = vorbis_comments.get_vendor_string();
+ if (!vendor) return -1;
++
++ FLAC::Decoder::Stream *decoder = 0;
++ FLAC::Encoder::Stream *encoder = 0;
++ FLAC::Decoder::Stream::State init_state_d = decoder->init();
++ FLAC::Encoder::Stream::State init_state_e = encoder->init();
++
+ return 0;
+ }
+ ],
+ AC_MSG_RESULT([ok. use v1.1.2 API])
+- AC_DEFINE(FLAC_API_VERSION_1_1_2_OR_NEWER, 1, [new API from v1.1.2 and newer])
++ AC_DEFINE(FLAC_API_VERSION_1_1_2, 1, [API from v1.1.2])
+ ,
+ [
+- AC_MSG_ERROR([unable to figure out a valid API])
+- ]
+- )
++ AC_LINK_IFELSE([
++ #include <FLAC/export.h>
++ #include <FLAC/format.h>
++ #include <FLAC++/decoder.h>
++ #include <FLAC++/encoder.h>
++ #include <FLAC++/metadata.h>
++
++ /* FLAC-1.1.3 has cur=8, rev=0 */
++ /* FLAC-1.1.4 has cur=8, rev=1 */
++ #if !defined(FLAC_API_VERSION_CURRENT) || \
++ !defined(FLAC_API_VERSION_REVISION)
++ #error "FLAC API is much too old"
++ #endif
++
++ #if (FLAC_API_VERSION_CURRENT < 8)
++ #error "FLAC API is too old"
++ #endif
++
++ int main(int, char **)
++ {
++ FLAC__StreamEncoderInitStatus init_state_d =
++ FLAC__STREAM_ENCODER_INIT_STATUS_OK;
++ FLAC__StreamDecoderInitStatus init_state_e =
++ FLAC__STREAM_DECODER_INIT_STATUS_OK;
++ return 0;
++ }
++ ],
++ AC_MSG_RESULT([ok. use v1.1.3 API])
++ AC_DEFINE(FLAC_API_VERSION_1_1_3, 1, [new API from v1.1.3])
++ ,
++ [
++ AC_MSG_ERROR([unable to figure out a valid API])
++ ]
++ )
++ ])
+ ]
+ )
+ AC_LANG_POP(C++)
diff --git a/media-sound/kwave/kwave-0.7.9.ebuild b/media-sound/kwave/kwave-0.7.9.ebuild
index 0986e649805d..31e5f59d5bf9 100644
--- a/media-sound/kwave/kwave-0.7.9.ebuild
+++ b/media-sound/kwave/kwave-0.7.9.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-sound/kwave/kwave-0.7.9.ebuild,v 1.2 2007/07/17 11:54:42 swegener Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-sound/kwave/kwave-0.7.9.ebuild,v 1.3 2007/07/21 20:11:55 philantrop Exp $
inherit kde flag-o-matic
@@ -38,6 +38,13 @@ pkg_setup() {
fi
}
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}/${P}_flac-v1.1.3_and_v1.1.4-support.diff"
+ epatch "${FILESDIR}/${P}-debian-431199.diff"
+}
+
src_compile() {
eautoreconf
local myconf="--without-builtin-libaudiofile"