public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: media-sound/xmms2/files/, media-sound/xmms2/
@ 2015-11-27 23:15 Sergei Trofimovich
  0 siblings, 0 replies; 12+ messages in thread
From: Sergei Trofimovich @ 2015-11-27 23:15 UTC (permalink / raw
  To: gentoo-commits

commit:     1a9735ddd22e0658540b17f7f6b87b1e85857765
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 27 23:15:13 2015 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Fri Nov 27 23:15:45 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1a9735dd

media-sound/xmms2: fix build failure against stable libmodplug, bug #536046

Reported-by: Anthony Parsons
Bug: https://bugs.gentoo.org/536046

Package-Manager: portage-2.2.25

 media-sound/xmms2/files/xmms2-0.8-cpython.patch |  9 +++++++++
 media-sound/xmms2/files/xmms2-0.8-modpug.patch  | 11 +++++++++++
 media-sound/xmms2/xmms2-0.8-r2.ebuild           |  2 ++
 3 files changed, 22 insertions(+)

diff --git a/media-sound/xmms2/files/xmms2-0.8-cpython.patch b/media-sound/xmms2/files/xmms2-0.8-cpython.patch
new file mode 100644
index 0000000..58227ba
--- /dev/null
+++ b/media-sound/xmms2/files/xmms2-0.8-cpython.patch
@@ -0,0 +1,9 @@
+diff --git a/src/clients/lib/python/cython_include/cxmmsclient.pxd b/src/clients/lib/python/cython_include/cxmmsclient.pxd
+index 66390a7..629bc7f 100644
+--- a/src/clients/lib/python/cython_include/cxmmsclient.pxd
++++ b/src/clients/lib/python/cython_include/cxmmsclient.pxd
+@@ -30,3 +30,3 @@ cdef extern from "xmmsc/xmmsc_idnumbers.h":
+ 
+-	ctypedef enum xmmsc_collection_changed_actions_t:
++	ctypedef enum xmms_collection_changed_actions_t:
+ 		XMMS_COLLECTION_CHANGED_ADD

diff --git a/media-sound/xmms2/files/xmms2-0.8-modpug.patch b/media-sound/xmms2/files/xmms2-0.8-modpug.patch
new file mode 100644
index 0000000..ce40127
--- /dev/null
+++ b/media-sound/xmms2/files/xmms2-0.8-modpug.patch
@@ -0,0 +1,11 @@
+--- a/src/plugins/modplug/modplug.c       2011-10-20 20:26:08.000000000 +0000
++++ b/src/plugins/modplug/modplug.c       2015-01-08 19:52:43.889787624 +0000
+@@ -9,7 +9,7 @@
+ #include "xmms/xmms_sample.h"
+ #include "xmms/xmms_medialib.h"
+ #include "xmms/xmms_log.h"
+-#include <modplug.h>
++#include <libmodplug/modplug.h>
+ 
+ #include <glib.h>
+ #include <string.h>

diff --git a/media-sound/xmms2/xmms2-0.8-r2.ebuild b/media-sound/xmms2/xmms2-0.8-r2.ebuild
index 18e8dec..f424d49 100644
--- a/media-sound/xmms2/xmms2-0.8-r2.ebuild
+++ b/media-sound/xmms2/xmms2-0.8-r2.ebuild
@@ -113,6 +113,8 @@ src_prepare() {
 	epatch "${FILESDIR}/${P}"-cython-0.19.1.patch
 	epatch "${FILESDIR}/${P}"-memset.patch
 	epatch "${FILESDIR}/${P}"-ffmpeg2.patch #536232
+	epatch "${FILESDIR}/${P}"-cpython.patch
+	epatch "${FILESDIR}/${P}"-modpug.patch #536046
 
 	if has_version dev-libs/libcdio-paranoia; then
 		sed -i -e 's:cdio/cdda.h:cdio/paranoia/cdda.h:' src/plugins/cdda/cdda.c || die


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-sound/xmms2/files/, media-sound/xmms2/
@ 2016-04-02  9:06 Sergei Trofimovich
  0 siblings, 0 replies; 12+ messages in thread
From: Sergei Trofimovich @ 2016-04-02  9:06 UTC (permalink / raw
  To: gentoo-commits

commit:     54c5cda4372004c31c5b91cb3f5cbc77da776512
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sat Apr  2 09:04:11 2016 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sat Apr  2 09:06:31 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=54c5cda4

media-sound/xmms2: tweak ExtUtils detection against perl-5.22, bug #578778

Reported-by: Scott McClung
Bug: https://bugs.gentoo.org/578778

Package-Manager: portage-2.2.28

 media-sound/xmms2/files/xmms2-0.8DrO_o-waflib-fix-perl.patch | 5 +++--
 media-sound/xmms2/xmms2-0.8-r2.ebuild                        | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/media-sound/xmms2/files/xmms2-0.8DrO_o-waflib-fix-perl.patch b/media-sound/xmms2/files/xmms2-0.8DrO_o-waflib-fix-perl.patch
index d4c10b9..220e91e 100644
--- a/media-sound/xmms2/files/xmms2-0.8DrO_o-waflib-fix-perl.patch
+++ b/media-sound/xmms2/files/xmms2-0.8DrO_o-waflib-fix-perl.patch
@@ -9,6 +9,7 @@ Use xsubpp from @INC instead of bundled one with perl.
 
 Original bug: https://bugs.gentoo.org/380469
 Related: https://bugs.gentoo.org/378783
+Updated for perl-5.20.2: https://bugs.gentoo.org/578778
 diff --git a/waflib/Tools/perl.py b/waflib/Tools/perl.py
 index 2c69fe5..a75b069 100644
 --- a/waflib/Tools/perl.py
@@ -19,8 +20,8 @@ index 2c69fe5..a75b069 100644
  	env['CFLAGS_PERLEXT']=read_out(" -MConfig -e'print \"$Config{ccflags} $Config{cccdlflags}\"'")
 -	env['XSUBPP']=read_out(" -MConfig -e'print \"$Config{privlib}/ExtUtils/xsubpp$Config{exe_ext}\"'")
 -	env['EXTUTILS_TYPEMAP']=read_out(" -MConfig -e'print \"$Config{privlib}/ExtUtils/typemap\"'")
-+	env["XSUBPP"]           = read_out(" -MModule::Build -e'print Module::Build::ModuleInfo->find_module_by_name(\"ExtUtils::xsubpp\")'")
-+	env["EXTUTILS_TYPEMAP"] = read_out(" -MModule::Build -e'print Module::Build::ModuleInfo->find_module_by_name(\"ExtUtils::typemap\")'")
++	env["XSUBPP"]           = read_out(" -MModule::Metadata -e'print Module::Metadata->find_module_by_name(\"ExtUtils::xsubpp\")'")
++	env["EXTUTILS_TYPEMAP"] = read_out(" -MModule::Metadata -e'print Module::Metadata->find_module_by_name(\"ExtUtils::typemap\")'")
  	if not getattr(Options.options,'perlarchdir',None):
  		env['ARCHDIR_PERL']=self.cmd_and_log(perl+" -MConfig -e'print $Config{sitearch}'")
  	else:

diff --git a/media-sound/xmms2/xmms2-0.8-r2.ebuild b/media-sound/xmms2/xmms2-0.8-r2.ebuild
index f424d49..4db6118 100644
--- a/media-sound/xmms2/xmms2-0.8-r2.ebuild
+++ b/media-sound/xmms2/xmms2-0.8-r2.ebuild
@@ -70,7 +70,8 @@ RDEPEND="server? (
 DEPEND="${RDEPEND}
 	dev-lang/python
 	python? ( dev-python/pyrex )
-	perl? ( dev-perl/Module-Build )
+	perl? ( dev-perl/Module-Build
+		virtual/perl-Module-Metadata )
 	virtual/pkgconfig
 	test? ( dev-util/cunit )
 	"
@@ -105,7 +106,7 @@ pkg_setup() {
 src_prepare() {
 	./waf # inflate waf
 	cd .waf* || die
-	epatch "${FILESDIR}/${PN}"-0.8DrO_o-waflib-fix-perl.patch
+	epatch "${FILESDIR}/${PN}"-0.8DrO_o-waflib-fix-perl.patch #578778
 	cd "${S}"
 	epatch "${FILESDIR}/${P}"-ffmpeg-0.11.patch #443256
 	epatch "${FILESDIR}/${P}"-libav-9-p2.patch #443256


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-sound/xmms2/files/, media-sound/xmms2/
@ 2016-04-02 10:43 Sergei Trofimovich
  0 siblings, 0 replies; 12+ messages in thread
From: Sergei Trofimovich @ 2016-04-02 10:43 UTC (permalink / raw
  To: gentoo-commits

commit:     45fc303a416aa252542c49b9383ad148f9022974
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sat Apr  2 10:43:39 2016 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sat Apr  2 10:43:47 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=45fc303a

media-sound/xmms2: support stable API for libav, bug #540890

Latest stable media-video/ffmpeg-2.8.6 provides both functions:
  avcodec_decode_audio3
  avcodec_decode_audio4

While latest stable media-video/libav-11.3 provides only
  avcodec_decode_audio4

Pulled large patchset from upstream to support audio4 API.

Builds fine on both stable virtual/ffmpeg implementations
and unstable libav.

Reported-by: Toralf Förster
Bug: https://bugs.gentoo.org/540890

Package-Manager: portage-2.2.28

 media-sound/xmms2/files/xmms2-0.8-audio4-p1.patch | 123 +++++++
 media-sound/xmms2/files/xmms2-0.8-audio4-p2.patch | 171 ++++++++++
 media-sound/xmms2/files/xmms2-0.8-audio4-p3.patch | 388 ++++++++++++++++++++++
 media-sound/xmms2/files/xmms2-0.8-audio4-p4.patch | 296 +++++++++++++++++
 media-sound/xmms2/files/xmms2-0.8-audio4-p5.patch | 154 +++++++++
 media-sound/xmms2/files/xmms2-0.8-audio4-p6.patch | 106 ++++++
 media-sound/xmms2/files/xmms2-0.8-audio4-p7.patch | 147 ++++++++
 media-sound/xmms2/xmms2-0.8-r2.ebuild             |   7 +
 8 files changed, 1392 insertions(+)

diff --git a/media-sound/xmms2/files/xmms2-0.8-audio4-p1.patch b/media-sound/xmms2/files/xmms2-0.8-audio4-p1.patch
new file mode 100644
index 0000000..21ed649
--- /dev/null
+++ b/media-sound/xmms2/files/xmms2-0.8-audio4-p1.patch
@@ -0,0 +1,123 @@
+commit 8831bc77d705c03b3f8081de0520dd10afa85c69
+Author: Uli Franke <cls@nebadje.org>
+Date:   Tue Jan 17 23:23:46 2012 +0100
+
+    BUG(2509): Avoid unaligned reads in avcodec xform.
+
+diff --git a/src/plugins/avcodec/avcodec.c b/src/plugins/avcodec/avcodec.c
+index fe58fc5..1b4a659 100644
+--- a/src/plugins/avcodec/avcodec.c
++++ b/src/plugins/avcodec/avcodec.c
+@@ -36,6 +36,9 @@ typedef struct {
+ 	guint buffer_size;
+ 	gboolean no_demuxer;
+ 
++	gchar *read_out_buffer;
++	gint read_out_buffer_size;
++
+ 	guint channels;
+ 	guint samplerate;
+ 	xmms_sample_format_t sampleformat;
+@@ -107,6 +110,7 @@ xmms_avcodec_destroy (xmms_xform_t *xform)
+ 
+ 	avcodec_close (data->codecctx);
+ 	av_free (data->codecctx);
++	av_free (data->read_out_buffer);
+ 
+ 	g_string_free (data->outbuf, TRUE);
+ 	g_free (data->buffer);
+@@ -132,6 +136,9 @@ xmms_avcodec_init (xmms_xform_t *xform)
+ 	data->buffer_size = AVCODEC_BUFFER_SIZE;
+ 	data->codecctx = NULL;
+ 
++	data->read_out_buffer = av_malloc (AVCODEC_MAX_AUDIO_FRAME_SIZE);
++	data->read_out_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
++
+ 	xmms_xform_private_data_set (xform, data);
+ 
+ 	avcodec_init ();
+@@ -196,7 +203,7 @@ xmms_avcodec_init (xmms_xform_t *xform)
+ 		} else {
+ 			/* A demuxer plugin forgot to give decoder config? */
+ 			xmms_log_error ("Decoder config data not found!");
+-			return FALSE;
++			goto err;
+ 		}
+ 	}
+ 
+@@ -220,7 +227,7 @@ xmms_avcodec_init (xmms_xform_t *xform)
+ 
+ 		/* some codecs need to have something read before they set
+ 		 * the samplerate and channels correctly, unfortunately... */
+-		if ((ret = xmms_avcodec_read (xform, buf, 42, &error)) > 0) {
++		if ((ret = xmms_avcodec_read (xform, buf, sizeof (buf), &error)) > 0) {
+ 			g_string_insert_len (data->outbuf, 0, buf, ret);
+ 		} else {
+ 			XMMS_DBG ("First read failed, codec is not working...");
+@@ -251,6 +258,9 @@ err:
+ 	if (data->codecctx) {
+ 		av_free (data->codecctx);
+ 	}
++	if (data->read_out_buffer) {
++		av_free (data->read_out_buffer);
++	}
+ 	g_string_free (data->outbuf, TRUE);
+ 	g_free (data->extradata);
+ 	g_free (data);
+@@ -263,8 +273,7 @@ xmms_avcodec_read (xmms_xform_t *xform, xmms_sample_t *buf, gint len,
+                    xmms_error_t *error)
+ {
+ 	xmms_avcodec_data_t *data;
+-	char outbuf[AVCODEC_MAX_AUDIO_FRAME_SIZE];
+-	gint outbufsize, bytes_read = 0;
++	gint bytes_read = 0;
+ 	guint size;
+ 
+ 	data = xmms_xform_private_data_get (xform);
+@@ -330,9 +339,9 @@ xmms_avcodec_read (xmms_xform_t *xform, xmms_sample_t *buf, gint len,
+ 		packet.data = data->buffer;
+ 		packet.size = data->buffer_length;
+ 
+-		outbufsize = sizeof (outbuf);
+-		bytes_read = avcodec_decode_audio3 (data->codecctx, (short *) outbuf,
+-		                                    &outbufsize, &packet);
++		data->read_out_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
++		bytes_read = avcodec_decode_audio3 (data->codecctx, (short *) data->read_out_buffer,
++		                                    &data->read_out_buffer_size, &packet);
+ 
+ 		/* The DTS decoder of ffmpeg is buggy and always returns
+ 		 * the input buffer length, get frame length from header */
+@@ -354,8 +363,8 @@ xmms_avcodec_read (xmms_xform_t *xform, xmms_sample_t *buf, gint len,
+ 
+ 		data->buffer_length -= bytes_read;
+ 
+-		if (outbufsize > 0) {
+-			g_string_append_len (data->outbuf, outbuf, outbufsize);
++		if (data->read_out_buffer_size > 0) {
++			g_string_append_len (data->outbuf, data->read_out_buffer, data->read_out_buffer_size);
+ 		}
+ 
+ 		size = MIN (data->outbuf->len, len);
+@@ -371,8 +380,7 @@ static gint64
+ xmms_avcodec_seek (xmms_xform_t *xform, gint64 samples, xmms_xform_seek_mode_t whence, xmms_error_t *err)
+ {
+ 	xmms_avcodec_data_t *data;
+-	char outbuf[AVCODEC_MAX_AUDIO_FRAME_SIZE];
+-	gint outbufsize, bytes_read = 0;
++	gint bytes_read = 0;
+ 	gint64 ret = -1;
+ 
+ 	g_return_val_if_fail (xform, -1);
+@@ -396,9 +404,9 @@ xmms_avcodec_seek (xmms_xform_t *xform, gint64 samples, xmms_xform_seek_mode_t w
+ 		packet.data = data->buffer;
+ 		packet.size = data->buffer_length;
+ 
+-		outbufsize = sizeof (outbuf);
+-		bytes_read = avcodec_decode_audio3 (data->codecctx, (short *) outbuf,
+-		                                    &outbufsize, &packet);
++		data->read_out_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
++		bytes_read = avcodec_decode_audio3 (data->codecctx, (short *) data->read_out_buffer,
++		                                    &data->read_out_buffer_size, &packet);
+ 
+ 		if (bytes_read < 0 || bytes_read > data->buffer_length) {
+ 			XMMS_DBG ("Error decoding data!");

diff --git a/media-sound/xmms2/files/xmms2-0.8-audio4-p2.patch b/media-sound/xmms2/files/xmms2-0.8-audio4-p2.patch
new file mode 100644
index 0000000..46b5b1d
--- /dev/null
+++ b/media-sound/xmms2/files/xmms2-0.8-audio4-p2.patch
@@ -0,0 +1,171 @@
+commit b614459dc1ea353d6c24b4a77c7f92a5577d5bc3
+Author: Uli Franke <cls@nebadje.org>
+Date:   Thu Jan 19 11:53:57 2012 +0100
+
+    BUG(2510): Add more bitrates/samplerates to AAC/ALAC.
+
+diff --git a/src/plugins/avcodec/avcodec.c b/src/plugins/avcodec/avcodec.c
+index 1b4a659..b32de4d 100644
+--- a/src/plugins/avcodec/avcodec.c
++++ b/src/plugins/avcodec/avcodec.c
+@@ -60,6 +60,7 @@ static gint xmms_avcodec_read (xmms_xform_t *xform, xmms_sample_t *buf, gint len
+                                xmms_error_t *error);
+ static gint64 xmms_avcodec_seek (xmms_xform_t *xform, gint64 samples,
+                                  xmms_xform_seek_mode_t whence, xmms_error_t *err);
++static xmms_sample_format_t xmms_avcodec_translate_sample_format (enum AVSampleFormat av_sample_format);
+ 
+ /*
+  * Plugin header
+@@ -168,12 +169,12 @@ xmms_avcodec_init (xmms_xform_t *xform)
+ 		data->channels = ret;
+ 	}
+ 
+-	/* bitrate required for WMA files */
++	/* Required by WMA xform. */
+ 	xmms_xform_auxdata_get_int (xform,
+ 	                            "bitrate",
+ 	                            &data->bitrate);
+ 
+-	/* ALAC and MAC require bits per sample field to be 16 */
++	/* Required by tta and apefile xforms. */
+ 	xmms_xform_auxdata_get_int (xform,
+ 	                            "samplebits",
+ 	                            &data->samplebits);
+@@ -238,12 +239,17 @@ xmms_avcodec_init (xmms_xform_t *xform)
+ 
+ 	data->samplerate = data->codecctx->sample_rate;
+ 	data->channels = data->codecctx->channels;
++	data->sampleformat = xmms_avcodec_translate_sample_format (data->codecctx->sample_fmt);
++	if (data->sampleformat == XMMS_SAMPLE_FORMAT_UNKNOWN) {
++		avcodec_close (data->codecctx);
++		goto err;
++	}
+ 
+ 	xmms_xform_outdata_type_add (xform,
+ 	                             XMMS_STREAM_TYPE_MIMETYPE,
+ 	                             "audio/pcm",
+ 	                             XMMS_STREAM_TYPE_FMT_FORMAT,
+-	                             XMMS_SAMPLE_FORMAT_S16,
++	                             data->sampleformat,
+ 	                             XMMS_STREAM_TYPE_FMT_CHANNELS,
+ 	                             data->channels,
+ 	                             XMMS_STREAM_TYPE_FMT_SAMPLERATE,
+@@ -428,3 +434,23 @@ xmms_avcodec_seek (xmms_xform_t *xform, gint64 samples, xmms_xform_seek_mode_t w
+ 
+ 	return ret;
+ }
++
++static xmms_sample_format_t
++xmms_avcodec_translate_sample_format (enum AVSampleFormat av_sample_format)
++{
++	switch (av_sample_format) {
++	case AV_SAMPLE_FMT_U8:
++		return XMMS_SAMPLE_FORMAT_U8;
++	case AV_SAMPLE_FMT_S16:
++		return XMMS_SAMPLE_FORMAT_S16;
++	case AV_SAMPLE_FMT_S32:
++		return XMMS_SAMPLE_FORMAT_S32;
++	case AV_SAMPLE_FMT_FLT:
++		return XMMS_SAMPLE_FORMAT_FLOAT;
++	case AV_SAMPLE_FMT_DBL:
++		return XMMS_SAMPLE_FORMAT_DOUBLE;
++	default:
++		XMMS_DBG ("AVSampleFormat (%i) not supported.", av_sample_format);
++		return XMMS_SAMPLE_FORMAT_UNKNOWN;
++	}
++}
+diff --git a/src/plugins/mp4/mp4.c b/src/plugins/mp4/mp4.c
+index 7c915c4..3ee9357 100644
+--- a/src/plugins/mp4/mp4.c
++++ b/src/plugins/mp4/mp4.c
+@@ -186,9 +186,6 @@ xmms_mp4_init (xmms_xform_t *xform)
+ 	xmms_xform_auxdata_set_bin (xform, "decoder_config", tmpbuf, tmpbuflen);
+ 	g_free (tmpbuf);
+ 
+-	/* This is only for ALAC to set 16-bit samples, ignored for AAC */
+-	xmms_xform_auxdata_set_int (xform, "samplebits", 16);
+-
+ 	xmms_mp4_get_mediainfo (xform);
+ 
+ 	XMMS_DBG ("MP4 demuxer inited successfully!");
+@@ -288,7 +285,7 @@ xmms_mp4_get_mediainfo (xmms_xform_t *xform)
+ 	data = xmms_xform_private_data_get (xform);
+ 	g_return_if_fail (data);
+ 
+-	if ((temp = mp4ff_get_sample_rate (data->mp4ff, data->track)) >= 0) {
++	if ((temp = mp4ff_get_sample_rate (data->mp4ff, data->track)) > 0) {
+ 		glong srate = temp;
+ 
+ 		if ((temp = mp4ff_get_track_duration_use_offsets (data->mp4ff,
+@@ -492,7 +489,7 @@ xmms_mp4_get_track (xmms_xform_t *xform, mp4ff_t *infile)
+ 		case 0x69: /* MPEG-2 audio */
+ 		case 0x6B: /* MPEG-1 audio */
+ 			continue;
+-		case 0xff:
++		case 0xff: /* ALAC */
+ 			chans = mp4ff_get_channel_count (infile, i);
+ 			rate = mp4ff_get_sample_rate (infile, i);
+ 			if (chans <= 0 || rate <= 0) {
+diff --git a/src/plugins/mp4/mp4ff/README.xmms2 b/src/plugins/mp4/mp4ff/README.xmms2
+index c2737c5..8021618 100644
+--- a/src/plugins/mp4/mp4ff/README.xmms2
++++ b/src/plugins/mp4/mp4ff/README.xmms2
+@@ -12,3 +12,4 @@ Changes:
+  * Add value_length variable to tag type and use it when adding new item-value pairs,
+    necessary for cover art since it's binary data and can't be handled as a string
+  * Add support for Apple Lossless audio files
++ * Add a workaround for supporting higher samplerates.
+diff --git a/src/plugins/mp4/mp4ff/mp4ff.c b/src/plugins/mp4/mp4ff/mp4ff.c
+index ee7f7fb..b6f0a37 100644
+--- a/src/plugins/mp4/mp4ff/mp4ff.c
++++ b/src/plugins/mp4/mp4ff/mp4ff.c
+@@ -32,6 +32,8 @@
+ #include <string.h>
+ #include "mp4ffint.h"
+ 
++static uint32_t mp4ff_normalize_flawed_sample_rate (uint16_t samplerate);
++
+ mp4ff_t *mp4ff_open_read(mp4ff_callback_t *f)
+ {
+     mp4ff_t *ff = malloc(sizeof(mp4ff_t));
+@@ -304,12 +306,39 @@ int32_t mp4ff_num_samples(const mp4ff_t *f, const int32_t track)
+     return total;
+ }
+ 
++static uint32_t
++mp4ff_normalize_flawed_sample_rate (uint16_t samplerate)
++{
++	/* A list of common rates can be found at
++	 * http://en.wikipedia.org/wiki/Sampling_rate */
++	uint32_t rates[] = {8000, 11025, 16000, 22050, 32000, 44056, 44100,
++	                  47250, 48000, 50000, 50400, 88200, 96000, 176400,
++	                  192000, 352800, 384000, 0};
++	uint32_t* rate;
++
++	/* First check standard rates. */
++	for (rate = rates; *rate; rate++) {
++		if (*rate == samplerate) {
++			return *rate;
++		}
++	}
++
++	/* No standard rates matching - check if sample rate got truncated when
++	 * added to MP4 container */
++	for (rate = rates; *rate; rate++) {
++		if ((*rate & 0x0000FFFF) == samplerate) {
++			return *rate;
++		}
++	}
+ 
++	/* Failed to find a standard rate - we give up returning the original rate */
++	return samplerate;
++}
+ 
+ 
+ uint32_t mp4ff_get_sample_rate(const mp4ff_t *f, const int32_t track)
+ {
+-	return f->track[track]->sampleRate;
++	return mp4ff_normalize_flawed_sample_rate (f->track[track]->sampleRate);
+ }
+ 
+ uint32_t mp4ff_get_channel_count(const mp4ff_t * f,const int32_t track)

diff --git a/media-sound/xmms2/files/xmms2-0.8-audio4-p3.patch b/media-sound/xmms2/files/xmms2-0.8-audio4-p3.patch
new file mode 100644
index 0000000..a9145c0
--- /dev/null
+++ b/media-sound/xmms2/files/xmms2-0.8-audio4-p3.patch
@@ -0,0 +1,388 @@
+commit 4d0682030e20a8ed218f4ff924554f93d276d9ee
+Author: Anthony Garcia <lagg@lavabit.com>
+Date:   Thu Apr 22 16:59:37 2010 -0700
+
+    OTHER: Cleanup
+    
+    Re-enabled nellymoser (ffmpeg appears to be okay with it now)
+    
+    Fixed possible infinite loop in the code that handles the data (if any)
+    between the header and tag data.
+
+diff --git a/src/plugins/avcodec/avcodec.c b/src/plugins/avcodec/avcodec.c
+index 6c9fea8..5554056 100644
+--- a/src/plugins/avcodec/avcodec.c
++++ b/src/plugins/avcodec/avcodec.c
+@@ -90,7 +90,7 @@ xmms_avcodec_plugin_setup (xmms_xform_plugin_t *xform_plugin)
+ 	xmms_magic_add ("A/52 (AC-3) header", "audio/x-ffmpeg-ac3",
+ 	                "0 beshort 0x0b77", NULL);
+ 	xmms_magic_add ("DTS header", "audio/x-ffmpeg-dca",
+-	                "0 belong 0x7ffe8001", NULL); 
++	                "0 belong 0x7ffe8001", NULL);
+ 
+ 	xmms_xform_plugin_indata_add (xform_plugin,
+ 	                              XMMS_STREAM_TYPE_MIMETYPE,
+@@ -197,7 +197,8 @@ xmms_avcodec_init (xmms_xform_t *xform)
+ 		    !strcmp (data->codec_id, "adpcm_swf") ||
+ 		    !strcmp (data->codec_id, "pcm_s16le") ||
+ 		    !strcmp (data->codec_id, "ac3") ||
+-		    !strcmp (data->codec_id, "dca")) {
++		    !strcmp (data->codec_id, "dca") ||
++		    !strcmp (data->codec_id, "nellymoser")) {
+ 			/* number 1024 taken from libavformat raw.c RAW_PACKET_SIZE */
+ 			data->extradata = g_malloc0 (1024);
+ 			data->extradata_size = 1024;
+diff --git a/src/plugins/flv/flv.c b/src/plugins/flv/flv.c
+index 440010c..266fea6 100644
+--- a/src/plugins/flv/flv.c
++++ b/src/plugins/flv/flv.c
+@@ -25,29 +25,41 @@
+  * and other info, then data
+  */
+ #define FLV_TAG_SIZE 11
+-/* random constant */
+ #define FLV_CHUNK_SIZE 4096
+ 
+-/* let libavcodec take care of swapping sample bytes */
+-static const gchar *mime_pcm_s16le = "audio/x-ffmpeg-pcm_s16le";
+-static const gchar *fmt_mime[11] = {
+-	/* Supported when samples are 8 bit
+-	 * (otherwise there's no way of knowing endianness)
+-	 */
+-	"audio/pcm",
+-	"audio/x-ffmpeg-adpcm_swf",
+-	"audio/mpeg",
+-	/* if bps is 8 bit u8
+-	 * if bps is 16 bit sle16
+-	 */
+-	"audio/pcm",
+-	/* libavcodec can't handle nelly without dying yet */
+-	/*"audio/x-ffmpeg-nellymoser",
+-	"audio/x-ffmpeg-nellymoser",
+-	"audio/x-ffmpeg-nellymoser",*/
+-	"", "", "",
+-	"", "", "",
+-	"audio/aac"
++typedef enum {
++	/* Only u8 bit samples since
++	   there's no way to determine endianness
++	*/
++	CODEC_PCM_HOST,
++	CODEC_ADPCM,
++	CODEC_MP3,
++	/* 8 bps: unsigned
++	   16 bps: signed
++	*/
++	CODEC_PCM_LE,
++	CODEC_NELLYMOSER_16K,
++	CODEC_NELLYMOSER_8K,
++	/* Uses the sample rate in
++	   the tag as normal
++	*/
++	CODEC_NELLYMOSER,
++	CODEC_AAC = 10
++} xmms_flv_codec_id;
++
++struct xmms_flv_codec_table {
++	xmms_flv_codec_id id;
++	const gchar *mime;
++} static flv_codecs[] = {
++	{CODEC_PCM_HOST, "audio/pcm"},
++	{CODEC_ADPCM, "audio/x-ffmpeg-adpcm_swf"},
++	{CODEC_MP3, "audio/mpeg"},
++	/* Will be audio/x-ffmpeg-pcm_s16le if bps is 16 */
++	{CODEC_PCM_LE, "audio/pcm"},
++	{CODEC_NELLYMOSER_16K, "audio/x-ffmpeg-nellymoser"},
++	{CODEC_NELLYMOSER_8K, "audio/x-ffmpeg-nellymoser"},
++	{CODEC_NELLYMOSER, "audio/x-ffmpeg-nellymoser"},
++	{CODEC_AAC, "audio/aac"}
+ };
+ 
+ typedef struct {
+@@ -111,23 +123,26 @@ static gboolean
+ xmms_flv_init (xmms_xform_t *xform)
+ {
+ 	xmms_sample_format_t bps;
+-	gint readret;
++	gint readret, i;
+ 	guint8 channels, flags, format;
+-	guint8 header[FLV_TAG_SIZE + 5];
+-	const gchar *mime;
++	guint8 header[FLV_TAG_SIZE + 1];
+ 	guint32 dataoffset, samplerate;
+ 	xmms_error_t err;
+ 	xmms_flv_data_t *flvdata;
++	struct xmms_flv_codec_table *codec = NULL;
++
++	flvdata = g_new0 (xmms_flv_data_t, 1);
++	xmms_xform_private_data_set (xform, flvdata);
+ 
+ 	readret = xmms_xform_read (xform, header, FLV_HDR_SIZE, &err);
+ 	if (readret != FLV_HDR_SIZE) {
+ 		xmms_log_error ("Header read error");
+-		return FALSE;
++		goto init_err;
+ 	}
+ 
+ 	if ((header[4] & HAS_AUDIO) != HAS_AUDIO) {
+ 		xmms_log_error ("FLV has no audio stream");
+-		return FALSE;
++		goto init_err;
+ 	}
+ 
+ 	dataoffset = get_be32 (&header[5]) - FLV_HDR_SIZE;
+@@ -140,7 +155,7 @@ xmms_flv_init (xmms_xform_t *xform)
+ 		                           dataoffset : FLV_HDR_SIZE, &err);
+ 		if (readret <= 0) {
+ 			xmms_log_error ("Error reading header:tag body gap");
+-			return FALSE;
++			goto init_err;
+ 		}
+ 
+ 		dataoffset -= readret;
+@@ -148,86 +163,99 @@ xmms_flv_init (xmms_xform_t *xform)
+ 
+ 	if (next_audio_tag (xform) <= 0) {
+ 		xmms_log_error ("Can't find first audio tag");
+-		return FALSE;
++		goto init_err;
+ 	}
+ 
+-	if (xmms_xform_peek (xform, header, FLV_TAG_SIZE + 5, &err) < FLV_TAG_SIZE + 5) {
++	if (xmms_xform_read (xform, header, FLV_TAG_SIZE + 1, &err) < FLV_TAG_SIZE + 1) {
+ 		xmms_log_error ("Can't read first audio tag");
+-		return FALSE;
++		goto init_err;
+ 	}
+ 
+-	flags = header[FLV_TAG_SIZE + 4];
++	flags = header[11];
+ 	XMMS_DBG ("Audio flags: %X", flags);
+ 
+-	switch (flags&12) {
+-		case 0: samplerate = 5512; break;
+-		case 4: samplerate = 11025; break;
+-		case 8: samplerate = 22050; break;
+-		case 12: samplerate = 44100; break;
+-		default: samplerate = 8000; break;
++	format = flags >> 4;
++	for (i = 0; i < G_N_ELEMENTS (flv_codecs); i++) {
++		if (flv_codecs[i].id == format) {
++			codec = &flv_codecs[i];
++			break;
++		}
+ 	}
+ 
+-	if (flags&2) {
+-		bps = XMMS_SAMPLE_FORMAT_S16;
++	if (flags & 1) {
++		channels = 2;
+ 	} else {
+-		bps = XMMS_SAMPLE_FORMAT_U8;
++		channels = 1;
+ 	}
+ 
+-	if (flags&1) {
+-		channels = 2;
++	if (flags & 2) {
++		bps = XMMS_SAMPLE_FORMAT_S16;
+ 	} else {
+-		channels = 1;
++		bps = XMMS_SAMPLE_FORMAT_U8;
+ 	}
+ 
+-	format = flags >> 4;
+-	mime = (format <= 10)? fmt_mime[format] : NULL;
+-	switch (format) {
+-		case 0:
+-			/* If the flv has an HE PCM audio stream, the
+-			 * samples must be unsigned and 8 bits long
+-			 */
+-			if (bps != XMMS_SAMPLE_FORMAT_U8) {
+-				xmms_log_error ("Only u8 HE PCM is supported");
+-				return FALSE;
+-			}
+-			break;
+-		case 3:
+-			if (bps == XMMS_SAMPLE_FORMAT_S16) {
+-				mime = mime_pcm_s16le;
+-			}
+-			break;
++	switch ((flags & 12) >> 2) {
++		case 0: samplerate = 5512; break;
++		case 1: samplerate = 11025; break;
++		case 2: samplerate = 22050; break;
++		case 3: samplerate = 44100; break;
++		default: samplerate = 8000; break;
+ 	}
+ 
+-	if (mime && *mime) {
+-		flvdata = g_new0 (xmms_flv_data_t, 1);
++	if (codec) {
++		switch (codec->id) {
++			case CODEC_PCM_HOST:
++				if (bps != XMMS_SAMPLE_FORMAT_U8) {
++					xmms_log_error ("Only u8 HE PCM is supported");
++					goto init_err;
++				}
++				break;
++			case CODEC_PCM_LE:
++				if (bps == XMMS_SAMPLE_FORMAT_S16) {
++					codec->mime = "audio/x-ffmpeg-pcm_s16le";
++				}
++				break;
++			case CODEC_NELLYMOSER_16K:
++				samplerate = 16000;
++				break;
++			case CODEC_NELLYMOSER_8K:
++				samplerate = 8000;
++				break;
++			default:
++				break;
++		}
++
+ 		flvdata->format = format;
++		flvdata->last_datasize = get_be24 (&header[1]) - 1;
+ 
+ 		XMMS_DBG ("Rate: %d, bps: %d, channels: %d", samplerate,
+ 		          bps, channels);
+ 
+-		xmms_xform_private_data_set (xform, flvdata);
+ 		xmms_xform_outdata_type_add (xform,
+ 		                             XMMS_STREAM_TYPE_MIMETYPE,
+-					     mime,
+-					     XMMS_STREAM_TYPE_FMT_SAMPLERATE,
+-					     samplerate,
+-					     XMMS_STREAM_TYPE_FMT_FORMAT,
+-					     bps,
+-					     XMMS_STREAM_TYPE_FMT_CHANNELS,
+-					     channels,
+-					     XMMS_STREAM_TYPE_END);
++		                             codec->mime,
++		                             XMMS_STREAM_TYPE_FMT_SAMPLERATE,
++		                             samplerate,
++		                             XMMS_STREAM_TYPE_FMT_FORMAT,
++		                             bps,
++		                             XMMS_STREAM_TYPE_FMT_CHANNELS,
++		                             channels,
++		                             XMMS_STREAM_TYPE_END);
+ 		return TRUE;
+ 	} else {
+ 		xmms_log_error ("Unsupported audio format");
+-		return FALSE;
+ 	}
++
++init_err:
++	g_free (flvdata);
++	return FALSE;
+ }
+ 
+ static gint
+ xmms_flv_read (xmms_xform_t *xform, xmms_sample_t *buf, gint len, xmms_error_t *err)
+ {
+-	gint ret = 0, thismuch = FLV_TAG_SIZE + 5;
+-	guint8 header[FLV_TAG_SIZE + 6], gap = 1;
++	gint ret = 0, thismuch = FLV_TAG_SIZE + 1;
++	guint8 header[FLV_TAG_SIZE + 1];
+ 	xmms_flv_data_t *data = NULL;
+ 
+ 	data = xmms_xform_private_data_get (xform);
+@@ -236,12 +264,8 @@ xmms_flv_read (xmms_xform_t *xform, xmms_sample_t *buf, gint len, xmms_error_t *
+ 		xmms_xform_auxdata_barrier (xform);
+ 		ret = next_audio_tag (xform);
+ 		if (ret > 0) {
+-			if (data->format == 10) {
+-				thismuch++;
+-				gap++;
+-			}
+ 			if (xmms_xform_read (xform, header, thismuch, err) == thismuch) {
+-				data->last_datasize = get_be24 (&header[5]) - gap;
++				data->last_datasize = get_be24 (&header[1]) - 1;
+ 			} else {
+ 				xmms_log_error ("Need %d bytes", thismuch);
+ 				return -1;
+@@ -280,40 +304,51 @@ xmms_flv_destroy (xmms_xform_t *xform)
+ static gint
+ next_audio_tag (xmms_xform_t *xform)
+ {
+-	guint8 header[FLV_TAG_SIZE + 4];
++	guint8 header[FLV_TAG_SIZE];
+ 	guint8 dumb[FLV_CHUNK_SIZE];
+ 	gint ret = 0;
+ 	xmms_error_t err;
+-	guint32 datasize = 0;
++	xmms_flv_data_t *data;
++
++	data = xmms_xform_private_data_get (xform);
+ 
+ 	do {
+-		/* there's a last 4 bytes at the end of an FLV giving the final
+-		 * tag's size, this isn't an error
+-		 */
+-		ret = xmms_xform_peek (xform, header, FLV_TAG_SIZE + 4, &err);
+-		if ((ret < FLV_TAG_SIZE) && (ret > -1)) {
+-			ret = 0;
+-			break;
+-		} else if (ret == -1) {
+-			xmms_log_error ("%s", xmms_error_message_get (&err));
+-			break;
+-		}
++		/* If > 0 assume we're in the middle of a tag's data */
++		if (!data->last_datasize) {
++			/* There are 4 bytes before an actual tag giving
++			   the previous tag's size. The first size in an
++			   flv is always 0.
++			*/
++			if (xmms_xform_read (xform, header, 4, &err) != 4) {
++				xmms_log_error ("Couldn't read last tag size");
++				return -1;
++			}
+ 
+-		if (header[4] == 8) {
+-			/* woo audio tag! */
+-			break;
+-		}
++			ret = xmms_xform_peek (xform, header, FLV_TAG_SIZE, &err);
++			if ((ret < FLV_TAG_SIZE) && (ret > -1)) {
++				return 0;
++			} else if (ret == -1) {
++				xmms_log_error ("%s", xmms_error_message_get (&err));
++				return ret;
++			}
++
++			if (header[0] == 8) {
++				/* woo audio tag! */
++				break;
++			}
+ 
+-		ret = xmms_xform_read (xform, header, FLV_TAG_SIZE + 4, &err);
+-		if (ret <= 0) { return ret; }
++			if ((ret = xmms_xform_read (xform, header, FLV_TAG_SIZE, &err)) <= 0) {
++				return ret;
++			}
+ 
+-		datasize = get_be24 (&header[5]);
++			data->last_datasize = get_be24 (&header[1]);
++		}
+ 
+-		while (datasize) {
++		while (data->last_datasize) {
+ 			ret = xmms_xform_read (xform, dumb,
+-			                         (datasize < FLV_CHUNK_SIZE) ?
+-			                         datasize : FLV_CHUNK_SIZE,
+-			                         &err);
++			                       (data->last_datasize < FLV_CHUNK_SIZE) ?
++			                       data->last_datasize : FLV_CHUNK_SIZE,
++			                       &err);
+ 			if (ret == 0) {
+ 				xmms_log_error ("Data field short!");
+ 				break;
+@@ -323,7 +358,7 @@ next_audio_tag (xmms_xform_t *xform)
+ 				break;
+ 			}
+ 
+-			datasize -= ret;
++			data->last_datasize -= ret;
+ 		}
+ 
+ 	} while (ret);

diff --git a/media-sound/xmms2/files/xmms2-0.8-audio4-p4.patch b/media-sound/xmms2/files/xmms2-0.8-audio4-p4.patch
new file mode 100644
index 0000000..552f202
--- /dev/null
+++ b/media-sound/xmms2/files/xmms2-0.8-audio4-p4.patch
@@ -0,0 +1,296 @@
+commit 4198d9bf5dff517740ed51b22313367f156107e1
+Author: Erik Massop <e.massop@hccnet.nl>
+Date:   Sun Dec 22 17:19:30 2013 +0100
+
+    OTHER: Split xmms_avcodec_read, remove some duplicate code
+
+diff --git a/src/plugins/avcodec/avcodec.c b/src/plugins/avcodec/avcodec.c
+index 5b9b606..eed7964 100644
+--- a/src/plugins/avcodec/avcodec.c
++++ b/src/plugins/avcodec/avcodec.c
+@@ -57,6 +57,9 @@ typedef struct {
+ static gboolean xmms_avcodec_plugin_setup (xmms_xform_plugin_t *xform_plugin);
+ static gboolean xmms_avcodec_init (xmms_xform_t *xform);
+ static void xmms_avcodec_destroy (xmms_xform_t *xform);
++static gint xmms_avcodec_internal_read_some (xmms_xform_t *xform, xmms_avcodec_data_t *data, xmms_error_t *error);
++static gint xmms_avcodec_internal_decode_some (xmms_avcodec_data_t *data);
++static void xmms_avcodec_internal_append (xmms_avcodec_data_t *data);
+ static gint xmms_avcodec_read (xmms_xform_t *xform, xmms_sample_t *buf, gint len,
+                                xmms_error_t *error);
+ static gint64 xmms_avcodec_seek (xmms_xform_t *xform, gint64 samples,
+@@ -281,101 +284,24 @@ xmms_avcodec_read (xmms_xform_t *xform, xmms_sample_t *buf, gint len,
+                    xmms_error_t *error)
+ {
+ 	xmms_avcodec_data_t *data;
+-	gint bytes_read = 0;
+ 	guint size;
+ 
+ 	data = xmms_xform_private_data_get (xform);
+ 	g_return_val_if_fail (data, -1);
+ 
+-	size = MIN (data->outbuf->len, len);
+-	while (size == 0) {
+-		AVPacket packet;
+-		av_init_packet (&packet);
++	while (0 == (size = MIN (data->outbuf->len, len))) {
++		gint res;
+ 
+ 		if (data->no_demuxer || data->buffer_length == 0) {
+-			gint read_total;
+-
+-			bytes_read = xmms_xform_read (xform,
+-			                              (gchar *) (data->buffer + data->buffer_length),
+-			                              data->buffer_size - data->buffer_length,
+-			                              error);
+-
+-			if (bytes_read < 0) {
+-				XMMS_DBG ("Error while reading data");
+-				return bytes_read;
+-			} else if (bytes_read == 0) {
+-				XMMS_DBG ("EOF");
+-				return 0;
+-			}
+-
+-			read_total = bytes_read;
+-
+-			/* If we have a demuxer plugin, make sure we read the whole packet */
+-			while (read_total == data->buffer_size && !data->no_demuxer) {
+-				/* multiply the buffer size and try to read again */
+-				data->buffer = g_realloc (data->buffer, data->buffer_size * 2);
+-				bytes_read = xmms_xform_read (xform,
+-				                              (gchar *) data->buffer +
+-				                                data->buffer_size,
+-				                              data->buffer_size,
+-				                              error);
+-				data->buffer_size *= 2;
+-
+-				if (bytes_read < 0) {
+-					XMMS_DBG ("Error while reading data");
+-					return bytes_read;
+-				}
+-
+-				read_total += bytes_read;
+-
+-				if (read_total < data->buffer_size) {
+-					/* finally double the buffer size for performance reasons, the
+-					 * hotspot handling likes to fit two frames in the buffer */
+-					data->buffer = g_realloc (data->buffer, data->buffer_size * 2);
+-					data->buffer_size *= 2;
+-					XMMS_DBG ("Reallocated avcodec internal buffer to be %d bytes",
+-					          data->buffer_size);
+-
+-					break;
+-				}
+-			}
+-
+-			/* Update the buffer length */
+-			data->buffer_length += read_total;
+-		}
+-
+-		packet.data = data->buffer;
+-		packet.size = data->buffer_length;
+-
+-		data->read_out_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
+-		bytes_read = avcodec_decode_audio3 (data->codecctx, (short *) data->read_out_buffer,
+-		                                    &data->read_out_buffer_size, &packet);
++			gint bytes_read;
+ 
+-		/* The DTS decoder of ffmpeg is buggy and always returns
+-		 * the input buffer length, get frame length from header */
+-		if (!strcmp (data->codec_id, "dca") && bytes_read > 0) {
+-			bytes_read = ((int)data->buffer[5] << 12) |
+-			             ((int)data->buffer[6] << 4) |
+-			             ((int)data->buffer[7] >> 4);
+-			bytes_read = (bytes_read & 0x3fff) + 1;
++			bytes_read = xmms_avcodec_internal_read_some (xform, data, error);
++			if (bytes_read <= 0) { return bytes_read; }
+ 		}
+ 
+-		if (bytes_read < 0 || bytes_read > data->buffer_length) {
+-			XMMS_DBG ("Error decoding data!");
+-			return -1;
+-		} else if (bytes_read != data->buffer_length) {
+-			g_memmove (data->buffer,
+-			           data->buffer + bytes_read,
+-			           data->buffer_length - bytes_read);
+-		}
+-
+-		data->buffer_length -= bytes_read;
+-
+-		if (data->read_out_buffer_size > 0) {
+-			g_string_append_len (data->outbuf, data->read_out_buffer, data->read_out_buffer_size);
+-		}
+-
+-		size = MIN (data->outbuf->len, len);
++		res = xmms_avcodec_internal_decode_some (data);
++		if (res < 0) { return res; }
++		if (res > 0) { xmms_avcodec_internal_append (data); }
+ 	}
+ 
+ 	memcpy (buf, data->outbuf->str, size);
+@@ -388,7 +314,6 @@ static gint64
+ xmms_avcodec_seek (xmms_xform_t *xform, gint64 samples, xmms_xform_seek_mode_t whence, xmms_error_t *err)
+ {
+ 	xmms_avcodec_data_t *data;
+-	gint bytes_read = 0;
+ 	gint64 ret = -1;
+ 
+ 	g_return_val_if_fail (xform, -1);
+@@ -406,23 +331,11 @@ xmms_avcodec_seek (xmms_xform_t *xform, gint64 samples, xmms_xform_seek_mode_t w
+ 
+ 	/* The buggy ape decoder doesn't flush buffers, so we need to finish decoding
+ 	 * the frame before seeking to avoid segfaults... this hack sucks */
++	/* FIXME: Is ^^^ still true? */
+ 	while (data->buffer_length > 0) {
+-		AVPacket packet;
+-		av_init_packet (&packet);
+-		packet.data = data->buffer;
+-		packet.size = data->buffer_length;
+-
+-		data->read_out_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
+-		bytes_read = avcodec_decode_audio3 (data->codecctx, (short *) data->read_out_buffer,
+-		                                    &data->read_out_buffer_size, &packet);
+-
+-		if (bytes_read < 0 || bytes_read > data->buffer_length) {
+-			XMMS_DBG ("Error decoding data!");
++		if (xmms_avcodec_internal_decode_some (data) < 0) {
+ 			return -1;
+ 		}
+-
+-		data->buffer_length -= bytes_read;
+-		g_memmove (data->buffer, data->buffer + bytes_read, data->buffer_length);
+ 	}
+ 
+ 	ret = xmms_xform_seek (xform, samples, whence, err);
+@@ -456,3 +369,131 @@ xmms_avcodec_translate_sample_format (enum AVSampleFormat av_sample_format)
+ 		return XMMS_SAMPLE_FORMAT_UNKNOWN;
+ 	}
+ }
++
++/*
++Read some data from our source of data to data->buffer, updating buffer_length
++and buffer_size as needed.
++
++Returns: on error: negative
++         on EOF: zero
++         otherwise: number of bytes read.
++*/
++static gint
++xmms_avcodec_internal_read_some (xmms_xform_t *xform,
++                                 xmms_avcodec_data_t *data,
++                                 xmms_error_t *error)
++{
++	gint bytes_read, read_total;
++
++	bytes_read = xmms_xform_read (xform,
++	                              (gchar *) (data->buffer + data->buffer_length),
++	                              data->buffer_size - data->buffer_length,
++	                              error);
++
++	if (bytes_read < 0) {
++		XMMS_DBG ("Error while reading data");
++		return bytes_read;
++	} else if (bytes_read == 0) {
++		XMMS_DBG ("EOF");
++		return 0;
++	}
++
++	read_total = bytes_read;
++
++	/* If we have a demuxer plugin, make sure we read the whole packet */
++	while (read_total == data->buffer_size && !data->no_demuxer) {
++		/* multiply the buffer size and try to read again */
++		data->buffer = g_realloc (data->buffer, data->buffer_size * 2);
++		bytes_read = xmms_xform_read (xform,
++		                              (gchar *) data->buffer +
++		                                data->buffer_size,
++		                              data->buffer_size,
++		                              error);
++		data->buffer_size *= 2;
++
++		if (bytes_read < 0) {
++			XMMS_DBG ("Error while reading data");
++			return bytes_read;
++		}
++
++		read_total += bytes_read;
++
++		if (read_total < data->buffer_size) {
++			/* finally double the buffer size for performance reasons, the
++			 * hotspot handling likes to fit two frames in the buffer */
++			data->buffer = g_realloc (data->buffer, data->buffer_size * 2);
++			data->buffer_size *= 2;
++			XMMS_DBG ("Reallocated avcodec internal buffer to be %d bytes",
++			          data->buffer_size);
++
++			break;
++		}
++	}
++
++	/* Update the buffer length */
++	data->buffer_length += read_total;
++
++	return read_total;
++}
++
++/*
++Decode some data from data->buffer[0..data->buffer_length-1] to
++data->read_out_buffer. Number of bytes in data->read_out_buffer
++is stored in data->read_out_buffer_size.
++
++Returns: on error: negative
++         on no new data produced: zero
++         otherwise: positive
++
++FIXME: data->buffer should be at least data->buffer_length +
++FF_INPUT_BUFFER_PADDING_SIZE long.
++*/
++static gint
++xmms_avcodec_internal_decode_some (xmms_avcodec_data_t *data)
++{
++	gint bytes_read = 0;
++	AVPacket packet;
++
++	av_init_packet (&packet);
++	packet.data = data->buffer;
++	packet.size = data->buffer_length;
++
++	data->read_out_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
++	bytes_read = avcodec_decode_audio3 (data->codecctx,
++	                                    (short *) data->read_out_buffer,
++	                                    &data->read_out_buffer_size, &packet);
++
++	/* The DTS decoder of ffmpeg is buggy and always returns
++	 * the input buffer length, get frame length from header */
++	/* FIXME: Is ^^^^ still true? */
++	if (!strcmp (data->codec_id, "dca") && bytes_read > 0) {
++		bytes_read = ((int)data->buffer[5] << 12) |
++		             ((int)data->buffer[6] << 4) |
++		             ((int)data->buffer[7] >> 4);
++		bytes_read = (bytes_read & 0x3fff) + 1;
++	}
++
++	if (bytes_read < 0 || bytes_read > data->buffer_length) {
++		XMMS_DBG ("Error decoding data!");
++		return -1;
++	}
++
++	if (bytes_read < data->buffer_length) {
++		data->buffer_length -= bytes_read;
++		g_memmove (data->buffer,
++		           data->buffer + bytes_read,
++		           data->buffer_length);
++	} else {
++		data->buffer_length = 0;
++	}
++
++	return data->read_out_buffer_size;
++}
++
++static void
++xmms_avcodec_internal_append (xmms_avcodec_data_t *data)
++{
++	g_string_append_len (data->outbuf,
++	                     (gchar *) data->read_out_buffer,
++	                     data->read_out_buffer_size);
++}

diff --git a/media-sound/xmms2/files/xmms2-0.8-audio4-p5.patch b/media-sound/xmms2/files/xmms2-0.8-audio4-p5.patch
new file mode 100644
index 0000000..8ed5bb4
--- /dev/null
+++ b/media-sound/xmms2/files/xmms2-0.8-audio4-p5.patch
@@ -0,0 +1,154 @@
+commit d44312fb14bde0ab47ee6de1b3fe7435d4a97c99
+Author: Erik Massop <e.massop@hccnet.nl>
+Date:   Sun Dec 22 20:01:18 2013 +0100
+
+    BUG(2572): Use avcodec_decode_audio4
+
+diff --git a/src/plugins/avcodec/avcodec.c b/src/plugins/avcodec/avcodec.c
+index 266a607..a41a675 100644
+--- a/src/plugins/avcodec/avcodec.c
++++ b/src/plugins/avcodec/avcodec.c
+@@ -37,8 +37,7 @@ typedef struct {
+ 	guint buffer_size;
+ 	gboolean no_demuxer;
+ 
+-	gchar *read_out_buffer;
+-	gint read_out_buffer_size;
++	AVFrame *read_out_frame;
+ 
+ 	guint channels;
+ 	guint samplerate;
+@@ -125,7 +124,7 @@ xmms_avcodec_destroy (xmms_xform_t *xform)
+ 
+ 	avcodec_close (data->codecctx);
+ 	av_free (data->codecctx);
+-	av_free (data->read_out_buffer);
++	avcodec_free_frame (&data->read_out_frame);
+ 
+ 	g_string_free (data->outbuf, TRUE);
+ 	g_free (data->buffer);
+@@ -151,8 +150,7 @@ xmms_avcodec_init (xmms_xform_t *xform)
+ 	data->buffer_size = AVCODEC_BUFFER_SIZE;
+ 	data->codecctx = NULL;
+ 
+-	data->read_out_buffer = av_malloc (AVCODEC_MAX_AUDIO_FRAME_SIZE);
+-	data->read_out_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
++	data->read_out_frame = avcodec_alloc_frame ();
+ 
+ 	xmms_xform_private_data_set (xform, data);
+ 
+@@ -233,6 +231,7 @@ xmms_avcodec_init (xmms_xform_t *xform)
+ 	data->codecctx->extradata_size = data->extradata_size;
+ 	data->codecctx->codec_id = codec->id;
+ 	data->codecctx->codec_type = codec->type;
++	data->codecctx->refcounted_frames = 0;
+ 
+ 	if (avcodec_open2 (data->codecctx, codec, NULL) < 0) {
+ 		XMMS_DBG ("Opening decoder '%s' failed", codec->name);
+@@ -279,8 +278,8 @@ err:
+ 	if (data->codecctx) {
+ 		av_free (data->codecctx);
+ 	}
+-	if (data->read_out_buffer) {
+-		av_free (data->read_out_buffer);
++	if (data->read_out_frame) {
++		avcodec_free_frame (&data->read_out_frame);
+ 	}
+ 	g_string_free (data->outbuf, TRUE);
+ 	g_free (data->extradata);
+@@ -365,17 +364,23 @@ xmms_avcodec_translate_sample_format (enum AVSampleFormat av_sample_format)
+ {
+ 	switch (av_sample_format) {
+ 	case AV_SAMPLE_FMT_U8:
++	case AV_SAMPLE_FMT_U8P:
+ 		return XMMS_SAMPLE_FORMAT_U8;
+ 	case AV_SAMPLE_FMT_S16:
++	case AV_SAMPLE_FMT_S16P:
+ 		return XMMS_SAMPLE_FORMAT_S16;
+ 	case AV_SAMPLE_FMT_S32:
++	case AV_SAMPLE_FMT_S32P:
+ 		return XMMS_SAMPLE_FORMAT_S32;
+ 	case AV_SAMPLE_FMT_FLT:
++	case AV_SAMPLE_FMT_FLTP:
+ 		return XMMS_SAMPLE_FORMAT_FLOAT;
+ 	case AV_SAMPLE_FMT_DBL:
++	case AV_SAMPLE_FMT_DBLP:
+ 		return XMMS_SAMPLE_FORMAT_DOUBLE;
+ 	default:
+-		XMMS_DBG ("AVSampleFormat (%i) not supported.", av_sample_format);
++		XMMS_DBG ("AVSampleFormat (%i: %s) not supported.", av_sample_format,
++		          av_get_sample_fmt_name (av_sample_format));
+ 		return XMMS_SAMPLE_FORMAT_UNKNOWN;
+ 	}
+ }
+@@ -448,8 +453,7 @@ xmms_avcodec_internal_read_some (xmms_xform_t *xform,
+ 
+ /*
+ Decode some data from data->buffer[0..data->buffer_length-1] to
+-data->read_out_buffer. Number of bytes in data->read_out_buffer
+-is stored in data->read_out_buffer_size.
++data->read_out_frame
+ 
+ Returns: on error: negative
+          on no new data produced: zero
+@@ -461,6 +465,7 @@ FF_INPUT_BUFFER_PADDING_SIZE long.
+ static gint
+ xmms_avcodec_internal_decode_some (xmms_avcodec_data_t *data)
+ {
++	int got_frame = 0;
+ 	gint bytes_read = 0;
+ 	AVPacket packet;
+ 
+@@ -468,10 +473,10 @@ xmms_avcodec_internal_decode_some (xmms_avcodec_data_t *data)
+ 	packet.data = data->buffer;
+ 	packet.size = data->buffer_length;
+ 
+-	data->read_out_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
+-	bytes_read = avcodec_decode_audio3 (data->codecctx,
+-	                                    (short *) data->read_out_buffer,
+-	                                    &data->read_out_buffer_size, &packet);
++	avcodec_get_frame_defaults (data->read_out_frame);
++
++	bytes_read = avcodec_decode_audio4 (
++		data->codecctx, data->read_out_frame, &got_frame, &packet);
+ 
+ 	/* The DTS decoder of ffmpeg is buggy and always returns
+ 	 * the input buffer length, get frame length from header */
+@@ -497,13 +502,33 @@ xmms_avcodec_internal_decode_some (xmms_avcodec_data_t *data)
+ 		data->buffer_length = 0;
+ 	}
+ 
+-	return data->read_out_buffer_size;
++	return got_frame ? 1 : 0;
+ }
+ 
+ static void
+ xmms_avcodec_internal_append (xmms_avcodec_data_t *data)
+ {
+-	g_string_append_len (data->outbuf,
+-	                     (gchar *) data->read_out_buffer,
+-	                     data->read_out_buffer_size);
++	enum AVSampleFormat fmt = (enum AVSampleFormat) data->read_out_frame->format;
++	int samples = data->read_out_frame->nb_samples;
++	int channels = data->codecctx->channels;
++	int bps = av_get_bytes_per_sample (fmt);
++
++	if (av_sample_fmt_is_planar (fmt)) {
++		/* Convert from planar to packed format */
++		gint i, j;
++
++		for (i = 0; i < samples; i++) {
++			for (j = 0; j < channels; j++) {
++				g_string_append_len (
++					data->outbuf,
++					(gchar *) (data->read_out_frame->extended_data[j] + i*bps),
++					bps
++				);
++			}
++		}
++	} else {
++		g_string_append_len (data->outbuf,
++		                     (gchar *) data->read_out_frame->extended_data[0],
++		                     samples * channels * bps);
++	}
+ }

diff --git a/media-sound/xmms2/files/xmms2-0.8-audio4-p6.patch b/media-sound/xmms2/files/xmms2-0.8-audio4-p6.patch
new file mode 100644
index 0000000..b1bc1c5
--- /dev/null
+++ b/media-sound/xmms2/files/xmms2-0.8-audio4-p6.patch
@@ -0,0 +1,106 @@
+commit fc66249e69f53eef709c5210546fdd92e1c89554
+Author: Erik Massop <e.massop@hccnet.nl>
+Date:   Sun Dec 22 23:04:08 2013 +0100
+
+    OTHER: Some compatibility with different avcodec versions
+
+diff --git a/src/plugins/avcodec/avcodec.c b/src/plugins/avcodec/avcodec.c
+index a41a675..023833d 100644
+--- a/src/plugins/avcodec/avcodec.c
++++ b/src/plugins/avcodec/avcodec.c
+@@ -124,7 +124,7 @@ xmms_avcodec_destroy (xmms_xform_t *xform)
+ 
+ 	avcodec_close (data->codecctx);
+ 	av_free (data->codecctx);
+-	avcodec_free_frame (&data->read_out_frame);
++	av_frame_free (&data->read_out_frame);
+ 
+ 	g_string_free (data->outbuf, TRUE);
+ 	g_free (data->buffer);
+@@ -150,7 +150,7 @@ xmms_avcodec_init (xmms_xform_t *xform)
+ 	data->buffer_size = AVCODEC_BUFFER_SIZE;
+ 	data->codecctx = NULL;
+ 
+-	data->read_out_frame = avcodec_alloc_frame ();
++	data->read_out_frame = av_frame_alloc ();
+ 
+ 	xmms_xform_private_data_set (xform, data);
+ 
+@@ -231,7 +231,6 @@ xmms_avcodec_init (xmms_xform_t *xform)
+ 	data->codecctx->extradata_size = data->extradata_size;
+ 	data->codecctx->codec_id = codec->id;
+ 	data->codecctx->codec_type = codec->type;
+-	data->codecctx->refcounted_frames = 0;
+ 
+ 	if (avcodec_open2 (data->codecctx, codec, NULL) < 0) {
+ 		XMMS_DBG ("Opening decoder '%s' failed", codec->name);
+@@ -473,7 +472,8 @@ xmms_avcodec_internal_decode_some (xmms_avcodec_data_t *data)
+ 	packet.data = data->buffer;
+ 	packet.size = data->buffer_length;
+ 
+-	avcodec_get_frame_defaults (data->read_out_frame);
++	/* clear buffers and reset fields to defaults */
++	av_frame_unref (data->read_out_frame);
+ 
+ 	bytes_read = avcodec_decode_audio4 (
+ 		data->codecctx, data->read_out_frame, &got_frame, &packet);
+diff --git a/src/plugins/avcodec/avcodec_compat.h b/src/plugins/avcodec/avcodec_compat.h
+index 73ac2ab..e74b3f8 100644
+--- a/src/plugins/avcodec/avcodec_compat.h
++++ b/src/plugins/avcodec/avcodec_compat.h
+@@ -83,3 +83,17 @@ typedef struct AVPacket {
+ # define avcodec_open2(avctx, codec, options) \
+     avcodec_open(avctx, codec)
+ #endif
++
++/* Map avcodec_free_frame to av_freep if the former doesn't exist.
++ * (This is in versions earlier than 54.28.0 (libav) or 54.59.100 (ffmpeg)) */
++#if ! HAVE_AVCODEC_FREE_FRAME
++# define avcodec_free_frame av_freep
++#endif
++
++/* Map av_frame_alloc, av_frame_unref, av_frame_free into their
++ * deprecated versions in versions earlier than 55.28.1 */
++#if LIBAVCODEC_VERSION_INT < 0x371c01
++# define av_frame_alloc avcodec_alloc_frame
++# define av_frame_unref avcodec_get_frame_defaults
++# define av_frame_free avcodec_free_frame
++#endif
+diff --git a/src/plugins/avcodec/wscript b/src/plugins/avcodec/wscript
+index 03ba7d8..d367816 100644
+--- a/src/plugins/avcodec/wscript
++++ b/src/plugins/avcodec/wscript
+@@ -1,10 +1,33 @@
+ from waftools.plugin import plugin
+ 
++## Code fragments for configuration
++avcodec_free_frame_fragment = """
++#ifdef HAVE_LIBAVCODEC_AVCODEC_H
++# include "libavcodec/avcodec.h"
++#else
++# include "avcodec.h"
++#endif
++int main(void) {
++    AVFrame *frame;
++
++    avcodec_free_frame (&frame);
++
++    return 0;
++}
++"""
++
+ def plugin_configure(conf):
+     conf.check_cfg(package="libavcodec", uselib_store="avcodec",
+             args="--cflags --libs")
+     conf.check_cc(header_name="avcodec.h", uselib="avcodec", type="cshlib", mandatory=False)
+     conf.check_cc(header_name="libavcodec/avcodec.h", uselib="avcodec", type="cshlib", mandatory=False)
+ 
++    # non-mandatory function avcodec_free_frame since
++    # * ffmpeg: commit 46a3595, lavc 54.59.100, release 1.0
++    # * libav: commit a42aada, lavc 54.28.0, release 9
++    conf.check_cc(fragment=avcodec_free_frame_fragment, uselib="avcodec",
++                  uselib_store="avcodec_free_frame",
++                  msg="Checking for function avcodec_free_frame", mandatory=False)
++
+ configure, build = plugin('avcodec', configure=plugin_configure,
+                           libs=["avcodec"])

diff --git a/media-sound/xmms2/files/xmms2-0.8-audio4-p7.patch b/media-sound/xmms2/files/xmms2-0.8-audio4-p7.patch
new file mode 100644
index 0000000..2d4bafd
--- /dev/null
+++ b/media-sound/xmms2/files/xmms2-0.8-audio4-p7.patch
@@ -0,0 +1,147 @@
+commit f460440b3f2a9db1a9deef3faf7dae6e626dd7b5
+Author: Erik Massop <e.massop@hccnet.nl>
+Date:   Sun Dec 22 23:34:12 2013 +0100
+
+    OTHER: Require avcodec_decode_audio4
+    
+    This was introduced in versions 53.40.0 (ffmpeg) and 53.25.0 (libav) of
+    avcodec. Hence we drop compatibility for earlier versions.
+
+diff --git a/src/plugins/avcodec/avcodec.c b/src/plugins/avcodec/avcodec.c
+index 023833d..6d0b667 100644
+--- a/src/plugins/avcodec/avcodec.c
++++ b/src/plugins/avcodec/avcodec.c
+@@ -154,7 +154,6 @@ xmms_avcodec_init (xmms_xform_t *xform)
+ 
+ 	xmms_xform_private_data_set (xform, data);
+ 
+-	avcodec_init ();
+ 	avcodec_register_all ();
+ 
+ 	mimetype = xmms_xform_indata_get_str (xform,
+@@ -225,7 +224,7 @@ xmms_avcodec_init (xmms_xform_t *xform)
+ 	data->codecctx->sample_rate = data->samplerate;
+ 	data->codecctx->channels = data->channels;
+ 	data->codecctx->bit_rate = data->bitrate;
+-	CONTEXT_BPS (data->codecctx) = data->samplebits;
++	data->codecctx->bits_per_coded_sample = data->samplebits;
+ 	data->codecctx->block_align = data->block_align;
+ 	data->codecctx->extradata = data->extradata;
+ 	data->codecctx->extradata_size = data->extradata_size;
+diff --git a/src/plugins/avcodec/avcodec_compat.h b/src/plugins/avcodec/avcodec_compat.h
+index e74b3f8..b50fa4b 100644
+--- a/src/plugins/avcodec/avcodec_compat.h
++++ b/src/plugins/avcodec/avcodec_compat.h
+@@ -21,69 +21,6 @@
+ # include "avcodec.h"
+ #endif
+ 
+-/* Map avcodec_decode_audio2 into the deprecated version
+- * avcodec_decode_audio in versions earlier than 51.28 */
+-#if LIBAVCODEC_VERSION_INT < 0x331c00
+-# define avcodec_decode_audio2 avcodec_decode_audio
+-#endif
+-
+-/* Handle API change that happened in libavcodec 52.00 */
+-#if LIBAVCODEC_VERSION_INT < 0x340000
+-# define CONTEXT_BPS(codecctx) (codecctx)->bits_per_sample
+-#else
+-# define CONTEXT_BPS(codecctx) (codecctx)->bits_per_coded_sample
+-#endif
+-
+-/* Before 52.23 AVPacket was defined in avformat.h which we
+- * do not want to depend on, so we define part of it manually
+- * on versions smaller than 52.23 (this makes me cry) */
+-#if LIBAVCODEC_VERSION_INT < 0x341700
+-typedef struct AVPacket {
+-        uint8_t *data;
+-        int size;
+-} AVPacket;
+-#endif
+-
+-/* Same thing as above for av_init_packet and version 52.25 */
+-#if LIBAVCODEC_VERSION_INT < 0x341900
+-# define av_init_packet(pkt) do { \
+-    (pkt)->data = NULL; \
+-    (pkt)->size = 0; \
+-  } while(0)
+-#endif
+-
+-/* Map avcodec_decode_audio3 into the deprecated version
+- * avcodec_decode_audio2 in versions earlier than 52.26 */
+-#if LIBAVCODEC_VERSION_INT < 0x341a00
+-# define avcodec_decode_audio3(avctx, samples, frame_size_ptr, avpkt) \
+-    avcodec_decode_audio2(avctx, samples, frame_size_ptr, \
+-                          (avpkt)->data, (avpkt)->size)
+-#endif
+-
+-/* Handle API change that happened in libavcodec 52.64 */
+-#if LIBAVCODEC_VERSION_INT < 0x344000
+-# define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO
+-#endif
+-
+-/* Calling avcodec_init is not necessary after 53.04 (ffmpeg 0.9) */
+-#if LIBAVCODEC_VERSION_INT >= 0x350400
+-# define avcodec_init()
+-#endif
+-
+-/* Map avcodec_alloc_context3 into the deprecated version
+- * avcodec_alloc_context in versions earlier than 53.04 (ffmpeg 0.9) */
+-#if LIBAVCODEC_VERSION_INT < 0x350400
+-# define avcodec_alloc_context3(codec) \
+-    avcodec_alloc_context()
+-#endif
+-
+-/* Map avcodec_open2 into the deprecated version
+- * avcodec_open in versions earlier than 53.04 (ffmpeg 0.9) */
+-#if LIBAVCODEC_VERSION_INT < 0x350400
+-# define avcodec_open2(avctx, codec, options) \
+-    avcodec_open(avctx, codec)
+-#endif
+-
+ /* Map avcodec_free_frame to av_freep if the former doesn't exist.
+  * (This is in versions earlier than 54.28.0 (libav) or 54.59.100 (ffmpeg)) */
+ #if ! HAVE_AVCODEC_FREE_FRAME
+diff --git a/src/plugins/avcodec/wscript b/src/plugins/avcodec/wscript
+index d367816..00b182b 100644
+--- a/src/plugins/avcodec/wscript
++++ b/src/plugins/avcodec/wscript
+@@ -1,6 +1,24 @@
+ from waftools.plugin import plugin
+ 
+ ## Code fragments for configuration
++avcodec_decode_audio4_fragment = """
++#ifdef HAVE_LIBAVCODEC_AVCODEC_H
++# include "libavcodec/avcodec.h"
++#else
++# include "avcodec.h"
++#endif
++int main(void) {
++    AVCodecContext *ctx;
++    AVFrame *frame;
++    int got_frame;
++    AVPacket *pkt;
++
++    avcodec_decode_audio4 (ctx, frame, &got_frame, pkt);
++
++    return 0;
++}
++"""
++
+ avcodec_free_frame_fragment = """
+ #ifdef HAVE_LIBAVCODEC_AVCODEC_H
+ # include "libavcodec/avcodec.h"
+@@ -22,6 +40,13 @@ def plugin_configure(conf):
+     conf.check_cc(header_name="avcodec.h", uselib="avcodec", type="cshlib", mandatory=False)
+     conf.check_cc(header_name="libavcodec/avcodec.h", uselib="avcodec", type="cshlib", mandatory=False)
+ 
++    # mandatory function avcodec_decode_audio4 available since
++    # * ffmpeg: commit e4de716, lavc 53.40.0, release 0.9
++    # * libav: commit 0eea212, lavc 53.25.0, release 0.8
++    conf.check_cc(fragment=avcodec_decode_audio4_fragment, uselib="avcodec",
++                  uselib_store="avcodec_decode_audio4",
++                  msg="Checking for function avcodec_decode_audio4", mandatory=True)
++
+     # non-mandatory function avcodec_free_frame since
+     # * ffmpeg: commit 46a3595, lavc 54.59.100, release 1.0
+     # * libav: commit a42aada, lavc 54.28.0, release 9

diff --git a/media-sound/xmms2/xmms2-0.8-r2.ebuild b/media-sound/xmms2/xmms2-0.8-r2.ebuild
index 4661d2d4..4500c37 100644
--- a/media-sound/xmms2/xmms2-0.8-r2.ebuild
+++ b/media-sound/xmms2/xmms2-0.8-r2.ebuild
@@ -116,6 +116,13 @@ src_prepare() {
 	epatch "${FILESDIR}/${P}"-ffmpeg2.patch #536232
 	epatch "${FILESDIR}/${P}"-cpython.patch
 	epatch "${FILESDIR}/${P}"-modpug.patch #536046
+	epatch "${FILESDIR}/${P}"-audio4-p1.patch
+	epatch "${FILESDIR}/${P}"-audio4-p2.patch
+	epatch "${FILESDIR}/${P}"-audio4-p3.patch
+	epatch "${FILESDIR}/${P}"-audio4-p4.patch
+	epatch "${FILESDIR}/${P}"-audio4-p5.patch
+	epatch "${FILESDIR}/${P}"-audio4-p6.patch
+	epatch "${FILESDIR}/${P}"-audio4-p7.patch
 
 	if has_version dev-libs/libcdio-paranoia; then
 		sed -i -e 's:cdio/cdda.h:cdio/paranoia/cdda.h:' src/plugins/cdda/cdda.c || die


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-sound/xmms2/files/, media-sound/xmms2/
@ 2016-04-02 14:45 Sergei Trofimovich
  0 siblings, 0 replies; 12+ messages in thread
From: Sergei Trofimovich @ 2016-04-02 14:45 UTC (permalink / raw
  To: gentoo-commits

commit:     998de2831a15b5d8635babc38ed57292bee6d491
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sat Apr  2 14:45:16 2016 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sat Apr  2 14:45:24 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=998de283

media-sound/xmms2: backported samba detection fix

While at it updated to non-deprecated python and ruby eclasses.

Package-Manager: portage-2.2.28

 media-sound/xmms2/files/xmms2-0.8-samba-4.patch    | 30 +++++++++++++++
 media-sound/xmms2/xmms2-0.8-r2.ebuild              |  1 +
 .../{xmms2-0.8-r2.ebuild => xmms2-0.8-r3.ebuild}   | 45 ++++++++++------------
 3 files changed, 51 insertions(+), 25 deletions(-)

diff --git a/media-sound/xmms2/files/xmms2-0.8-samba-4.patch b/media-sound/xmms2/files/xmms2-0.8-samba-4.patch
new file mode 100644
index 0000000..937f3d7
--- /dev/null
+++ b/media-sound/xmms2/files/xmms2-0.8-samba-4.patch
@@ -0,0 +1,30 @@
+commit 86ea5e2d2ac2d8c8c1aee484e8c264440fafcb6a
+Author: Daniel P. Chokola <dan.chokola@gmail.com>
+Date:   Wed Jan 1 14:57:35 2014 -0500
+
+    BUG(2573): Samba 4.0 uses pkg-config. Find libsmbclient.h properly.
+
+diff --git a/src/plugins/samba/wscript b/src/plugins/samba/wscript
+index 8398169..77d7cda 100644
+--- a/src/plugins/samba/wscript
++++ b/src/plugins/samba/wscript
+@@ -1,8 +1,17 @@
+ from waftools.plugin import plugin
++from waflib import Errors
+ 
+ def plugin_configure(conf):
+-    conf.check_cc(header_name="libsmbclient.h")
+-    conf.check(lib="smbclient", uselib_store="smbclient")
++    try:
++        conf.check_cfg(package="smbclient", uselib_store="smbclient",
++                       args="--cflags --libs")
++    except Errors.ConfigurationError:
++        conf.check_cc(header_name="libsmbclient.h",
++                      uselib="smbclient",
++                      type="cshlib")
++        conf.check(lib="smbclient", uselib_store="smbclient",
++                   uselib="smbclient",
++                   type="cshlib")
+ 
+ configure, build = plugin("samba", configure=plugin_configure,
+         libs=["smbclient"])

diff --git a/media-sound/xmms2/xmms2-0.8-r2.ebuild b/media-sound/xmms2/xmms2-0.8-r2.ebuild
index 515550e..c0a1811 100644
--- a/media-sound/xmms2/xmms2-0.8-r2.ebuild
+++ b/media-sound/xmms2/xmms2-0.8-r2.ebuild
@@ -125,6 +125,7 @@ src_prepare() {
 	epatch "${FILESDIR}/${P}"-audio4-p6.patch
 	epatch "${FILESDIR}/${P}"-audio4-p7.patch
 	epatch "${FILESDIR}/${P}"-rtvg.patch #424377
+	epatch "${FILESDIR}/${P}"-samba-4.patch
 
 	if has_version dev-libs/libcdio-paranoia; then
 		sed -i -e 's:cdio/cdda.h:cdio/paranoia/cdda.h:' src/plugins/cdda/cdda.c || die

diff --git a/media-sound/xmms2/xmms2-0.8-r2.ebuild b/media-sound/xmms2/xmms2-0.8-r3.ebuild
similarity index 92%
copy from media-sound/xmms2/xmms2-0.8-r2.ebuild
copy to media-sound/xmms2/xmms2-0.8-r3.ebuild
index 515550e..c910ef3 100644
--- a/media-sound/xmms2/xmms2-0.8-r2.ebuild
+++ b/media-sound/xmms2/xmms2-0.8-r3.ebuild
@@ -1,10 +1,13 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-EAPI=3
+EAPI=5
 
-inherit eutils python toolchain-funcs
+PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} )
+USE_RUBY="ruby20 ruby21 ruby22"
+
+inherit eutils multiprocessing python-any-r1 ruby-single toolchain-funcs
 
 MY_P="${P}DrO_o"
 
@@ -14,7 +17,7 @@ SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2"
 LICENSE="GPL-2 LGPL-2.1"
 
 SLOT="0"
-KEYWORDS="alpha amd64 ppc x86"
+KEYWORDS="~alpha ~amd64 ~ppc ~x86"
 
 IUSE="aac airplay +alsa ao asf avahi cdda curl cxx ffmpeg flac gvfs ices
 jack mac mlib-update mms +mad modplug mp3 mp4 musepack ofa oss
@@ -25,7 +28,7 @@ RDEPEND="server? (
 		>=dev-db/sqlite-3.3.4
 
 		aac? ( >=media-libs/faad2-2.0 )
-		airplay? ( dev-libs/openssl )
+		airplay? ( dev-libs/openssl:0= )
 		alsa? ( media-libs/alsa-lib )
 		ao? ( media-libs/libao )
 		avahi? ( net-dns/avahi[mdnsresponder-compat] )
@@ -49,14 +52,14 @@ RDEPEND="server? (
 		musepack? ( media-sound/musepack-tools )
 		ofa? ( media-libs/libofa )
 		pulseaudio? ( media-sound/pulseaudio )
-		samba? ( net-fs/samba[smbclient] )
+		samba? ( net-fs/samba[smbclient(+)] )
 		sid? ( media-sound/sidplay
 			media-libs/resid )
 		sndfile? ( media-libs/libsndfile )
 		speex? ( media-libs/speex
 			media-libs/libogg )
 		vorbis? ( media-libs/libvorbis )
-		vocoder? ( sci-libs/fftw media-libs/libsamplerate )
+		vocoder? ( sci-libs/fftw:3.0= media-libs/libsamplerate )
 		wavpack? ( media-sound/wavpack )
 		xml? ( dev-libs/libxml2 )
 	)
@@ -64,18 +67,20 @@ RDEPEND="server? (
 	>=dev-libs/glib-2.12.9
 	cxx? ( >=dev-libs/boost-1.32 )
 	perl? ( >=dev-lang/perl-5.8.8 )
-	python? ( dev-lang/python )
-	ruby? ( >=dev-lang/ruby-1.8.5 ) "
+	python? ( ${PYTHON_DEPS} )
+	ruby? ( ${RUBY_DEPS} )
+"
 
 DEPEND="${RDEPEND}
 	dev-lang/python
-	python? ( dev-python/pyrex )
+	virtual/pkgconfig
 	perl? ( dev-perl/Module-Build
 		virtual/perl-Module-Metadata )
-	virtual/pkgconfig
+	python? ( >=dev-python/cython-0.15.1
+		dev-python/pyrex )
 	test? ( dev-util/cunit
 		valgrind? ( dev-util/valgrind ) )
-	"
+"
 
 S="${WORKDIR}/${MY_P}"
 
@@ -100,10 +105,6 @@ xmms2_flag() {
 	esac
 }
 
-pkg_setup() {
-	python_pkg_setup
-}
-
 src_prepare() {
 	./waf # inflate waf
 	cd .waf* || die
@@ -125,10 +126,12 @@ src_prepare() {
 	epatch "${FILESDIR}/${P}"-audio4-p6.patch
 	epatch "${FILESDIR}/${P}"-audio4-p7.patch
 	epatch "${FILESDIR}/${P}"-rtvg.patch #424377
+	epatch "${FILESDIR}/${P}"-samba-4.patch
 
 	if has_version dev-libs/libcdio-paranoia; then
 		sed -i -e 's:cdio/cdda.h:cdio/paranoia/cdda.h:' src/plugins/cdda/cdda.c || die
 	fi
+	epatch_user
 }
 
 src_configure() {
@@ -267,9 +270,7 @@ src_test() {
 
 src_install() {
 	./waf --without-ldconfig --destdir="${D}" install || die "'waf install' failed"
-	dodoc AUTHORS TODO README
-
-	use python && python_need_rebuild
+	dodoc AUTHORS TODO
 }
 
 pkg_postinst() {
@@ -283,10 +284,4 @@ pkg_postinst() {
 		einfo "developers which may help finding bugs"
 		einfo "Disable the phonehome useflag if you don't like that"
 	fi
-
-	use python && python_mod_optimize xmmsclient
-}
-
-pkg_postrm() {
-	use python && python_mod_cleanup xmmsclient
 }


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-sound/xmms2/files/, media-sound/xmms2/
@ 2017-05-20 10:21 Sergei Trofimovich
  0 siblings, 0 replies; 12+ messages in thread
From: Sergei Trofimovich @ 2017-05-20 10:21 UTC (permalink / raw
  To: gentoo-commits

commit:     88e32c614265db1783bc02782cdae880d786d227
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sat May 20 10:21:13 2017 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sat May 20 10:21:36 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=88e32c61

media-sound/xmms2: bump up to 0.8_p20161122, latest snapshot

This bump is a snapshot of a xmms2-devel/master git branch.
Devel tree has fixes like:
- waf bump (ruby-2.1 support)
- ffmpeg/libav upstream patches
- new plugins
- new s4 storage as a database (instead of sqlite)
- many other things

It's a a bit hard to backport patches to 6 years old release.

Reported-by: Toralf Förster
Bug: https://bugs.gentoo.org/618850
Package-Manager: Portage-2.3.6, Repoman-2.3.2

 media-sound/xmms2/Manifest                         |  1 +
 .../xmms2/files/xmms2-0.8_p20161122-tarball.patch  | 78 ++++++++++++++++++++++
 media-sound/xmms2/metadata.xml                     |  2 +
 media-sound/xmms2/xmms2-0.8-r4.ebuild              |  2 +-
 ...s2-0.8-r4.ebuild => xmms2-0.8_p20161122.ebuild} | 56 ++++++++--------
 5 files changed, 108 insertions(+), 31 deletions(-)

diff --git a/media-sound/xmms2/Manifest b/media-sound/xmms2/Manifest
index be39c6eeee9..442ad25250d 100644
--- a/media-sound/xmms2/Manifest
+++ b/media-sound/xmms2/Manifest
@@ -1 +1,2 @@
+DIST xmms2-0.8DrO_o-949-gca15e830.tar.bz2 1928653 SHA256 58bd62f1e3ca83d4d82ad6854ee769b97238fc1c89967262c0e9e9e20e35092e SHA512 affd7fdd259cdb952e972b62f24ab8eb6afd2c87786254a7ae81adffdcfe1454dcf2fb95811a8b90db74dba84918526fd8c920e11582b36aa48725f293c73edb WHIRLPOOL 438d33793b808dd151b27ac51af9998b819ffc03cbc0ce789d693192f8aa5cab3c48402ef83f2b8fe1442dd9130248f561b1fe466168c0569c2e017ee1a0ede3
 DIST xmms2-0.8DrO_o.tar.bz2 1670726 SHA256 c77e41e7bd5788889d5a2f78331ca8c748b8721bd2e59f36c36ad4c7cae8694a SHA512 478103d80264c0cb32912e828f74d0f5b2f10fe310f530a87ebecda7ca547a69e238cd572788f90bda29494494160d459fa6d1356b4fb87c7a8f0bf02e3b75f8 WHIRLPOOL 741dd85b8c065eea799675588a8d4c389c47fa3dcf129a9fd799bb5da0ffcb1eeffa45cfaca40af7c505908818b5e7960c1a54e947f53358edeb43841f2eaa5c

diff --git a/media-sound/xmms2/files/xmms2-0.8_p20161122-tarball.patch b/media-sound/xmms2/files/xmms2-0.8_p20161122-tarball.patch
new file mode 100644
index 00000000000..eef49b13f16
--- /dev/null
+++ b/media-sound/xmms2/files/xmms2-0.8_p20161122-tarball.patch
@@ -0,0 +1,78 @@
+diff --git a/utils/gen-changelog.py b/utils/gen-changelog.py
+index b539088a..301c0461 100755
+--- a/utils/gen-changelog.py
++++ b/utils/gen-changelog.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python2
+ from subprocess import check_output
+ import os
+ 
+diff --git a/utils/gen-tarball.py b/utils/gen-tarball.py
+index 2ae2a4d1..09ed5074 100755
+--- a/utils/gen-tarball.py
++++ b/utils/gen-tarball.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ from subprocess import check_output, call
+ import tarfile
+ import os
+@@ -40,15 +40,19 @@ def add_files(ball, prefix, template, files):
+ 
+ VERSION = check_output(["git", "describe"]).strip()
+ 
++# TODO: derive paths from submodule configuration
+ TUTORIAL_DIR="doc/tutorial"
++S4_DIR="src/lib/s4"
+ 
+ PREFIX="xmms2-%s" % VERSION
+ PREFIX_TUTORIAL="%s/%s" % (PREFIX, TUTORIAL_DIR)
++PREFIX_S4="%s/%s" % (PREFIX, S4_DIR)
+ 
+ DIST_DIR="dist"
+ DIST_XMMS2="%s/xmms2-%s.tar" % (DIST_DIR, VERSION)
+ DIST_XMMS2_BZ2="%s/xmms2-%s.tar.bz2" % (DIST_DIR, VERSION)
+ DIST_TUTORIAL="%s/xmms2-tutorial-%s.tar" % (DIST_DIR, VERSION)
++DIST_S4="%s/xmms2-tutorial-%s.tar" % (DIST_DIR, VERSION)
+ 
+ if not os.path.exists(DIST_DIR):
+     os.mkdir(DIST_DIR)
+@@ -62,6 +66,9 @@ if os.path.exists(DIST_XMMS2_BZ2):
+ if os.path.exists(DIST_TUTORIAL):
+     os.unlink(DIST_TUTORIAL)
+ 
++if os.path.exists(DIST_S4):
++    os.unlink(DIST_S4)
++
+ # Tar up XMMS2
+ call("git archive --format=tar --prefix=%s/ HEAD > %s" % (PREFIX, DIST_XMMS2), shell=True)
+ 
+@@ -69,9 +76,11 @@ call("git archive --format=tar --prefix=%s/ HEAD > %s" % (PREFIX, DIST_XMMS2), s
+ call("git submodule init", shell=True)
+ call("git submodule update", shell=True)
+ call("git --git-dir=%s/.git archive --format=tar --prefix=%s/ HEAD > %s" % (TUTORIAL_DIR, PREFIX_TUTORIAL, DIST_TUTORIAL), shell=True)
++call("git --git-dir=%s/.git archive --format=tar --prefix=%s/ HEAD > %s" % (S4_DIR, PREFIX_S4, DIST_S4), shell=True)
+ 
+-# Append the tutorials to the XMMS2 archive
++# Append the tutorials and s4 to the XMMS2 archive
+ call("tar -Af %s %s" % (DIST_XMMS2, DIST_TUTORIAL), shell=True)
++call("tar -Af %s %s" % (DIST_XMMS2, DIST_S4), shell=True)
+ 
+ # Append ChangeLog and a summary of all file hashes."
+ add_files(DIST_XMMS2, PREFIX, get_template(DIST_XMMS2, os.path.join(PREFIX, "wscript")), [
+diff --git a/utils/gen-tree-hashes.py b/utils/gen-tree-hashes.py
+index 7f8b9e4f..9d27adb0 100755
+--- a/utils/gen-tree-hashes.py
++++ b/utils/gen-tree-hashes.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python2
+ from subprocess import check_output
+ from operator import itemgetter
+ import os
+@@ -21,3 +21,4 @@ def collect_hashes(*paths):
+ 
+ print check_output("git describe", shell=True)
+ print collect_hashes(".", "doc/tutorial")
++print collect_hashes(".", "src/lib/s4")

diff --git a/media-sound/xmms2/metadata.xml b/media-sound/xmms2/metadata.xml
index acb83130968..26ce4e0e0a6 100644
--- a/media-sound/xmms2/metadata.xml
+++ b/media-sound/xmms2/metadata.xml
@@ -33,10 +33,12 @@
 	<use>
 		<flag name="airplay">Support for airplay format</flag>
 		<flag name="asf">Support for Monkey's Audio (APE) format with help of bundled libasf</flag>
+		<flag name="fluidsynth">Enable fluidsynth support (MIDI)</flag>
 		<flag name="gvfs">Transport for glibs virtual filesystem</flag>
 		<flag name="ices">Icecast source output plugin</flag>
 		<flag name="mac">Support for Monkey's Audio (APE) format with help of <pkg>media-sound/mac</pkg></flag>
 		<flag name="ofa">Support for Open Fingerprint Architecture (OFA)</flag>
+		<flag name="opus">Enable Opus audio codec support</flag>
 		<flag name="phonehome">This client sends anonymous usage-statistics to the xmms2</flag>
 		<flag name="server">Build xmms2 player daemon (otherwise only clients are built)</flag>
 		<flag name="sid">Support for C64 SID</flag>

diff --git a/media-sound/xmms2/xmms2-0.8-r4.ebuild b/media-sound/xmms2/xmms2-0.8-r4.ebuild
index ae57af19d22..b01887b80b1 100644
--- a/media-sound/xmms2/xmms2-0.8-r4.ebuild
+++ b/media-sound/xmms2/xmms2-0.8-r4.ebuild
@@ -51,7 +51,7 @@ RDEPEND="server? (
 		musepack? ( media-sound/musepack-tools )
 		ofa? ( media-libs/libofa )
 		pulseaudio? ( media-sound/pulseaudio )
-		samba? ( >=net-fs/samba-4.2[client] )
+		samba? ( >=net-fs/samba-4.2 )
 		sid? ( media-sound/sidplay
 			media-libs/resid )
 		sndfile? ( media-libs/libsndfile )

diff --git a/media-sound/xmms2/xmms2-0.8-r4.ebuild b/media-sound/xmms2/xmms2-0.8_p20161122.ebuild
similarity index 83%
copy from media-sound/xmms2/xmms2-0.8-r4.ebuild
copy to media-sound/xmms2/xmms2-0.8_p20161122.ebuild
index ae57af19d22..f9e24892bd0 100644
--- a/media-sound/xmms2/xmms2-0.8-r4.ebuild
+++ b/media-sound/xmms2/xmms2-0.8_p20161122.ebuild
@@ -1,7 +1,7 @@
 # Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
+EAPI=6
 
 # waf fails on python3_5: AttributeError: Can't pickle local object 'Context.__init__.<locals>.node_class'
 PYTHON_COMPAT=( python{2_7,3_4} )
@@ -9,18 +9,20 @@ USE_RUBY="ruby20 ruby21 ruby22"
 
 inherit eutils multiprocessing python-single-r1 ruby-single toolchain-funcs
 
-MY_P="${P}DrO_o"
+# generated as 'python2 ./utils/gen-tarball.py' from clean git tree
+MY_P="${P%_p*}DrO_o-949-gca15e830"
 
 DESCRIPTION="X(cross)platform Music Multiplexing System. Next generation of the XMMS player"
 HOMEPAGE="http://xmms2.org/wiki/Main_Page"
-SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2"
+#SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2"
+SRC_URI="https://dev.gentoo.org/~slyfox/distfiles/${MY_P}.tar.bz2"
 LICENSE="GPL-2 LGPL-2.1"
 
 SLOT="0"
-KEYWORDS="alpha amd64 ppc x86"
+KEYWORDS="~alpha ~amd64 ~ppc ~x86"
 
-IUSE="aac airplay +alsa ao asf cdda curl cxx ffmpeg flac gvfs ices
-jack mac mlib-update mms +mad modplug mp3 mp4 musepack ofa oss
+IUSE="aac airplay +alsa ao asf cdda curl cxx ffmpeg flac fluidsynth gvfs ices
+jack mac mlib-update mms +mad modplug mp3 mp4 musepack ofa opus oss
 perl phonehome pulseaudio python ruby samba +server sid sndfile speex
 test valgrind +vorbis vocoder wavpack xml zeroconf"
 
@@ -37,6 +39,7 @@ RDEPEND="server? (
 		curl? ( >=net-misc/curl-7.15.1 )
 		ffmpeg? ( virtual/ffmpeg )
 		flac? ( media-libs/flac )
+		fluidsynth? ( media-sound/fluidsynth )
 		gvfs? ( gnome-base/gnome-vfs )
 		ices? ( media-libs/libogg
 			media-libs/libshout
@@ -50,8 +53,10 @@ RDEPEND="server? (
 		mp3? ( >=media-sound/mpg123-1.5.1 )
 		musepack? ( media-sound/musepack-tools )
 		ofa? ( media-libs/libofa )
+		opus? ( media-libs/opus
+			media-libs/opusfile )
 		pulseaudio? ( media-sound/pulseaudio )
-		samba? ( >=net-fs/samba-4.2[client] )
+		samba? ( >=net-fs/samba-4.2 )
 		sid? ( media-sound/sidplay
 			media-libs/resid )
 		sndfile? ( media-libs/libsndfile )
@@ -117,30 +122,18 @@ xmms2_flag() {
 src_prepare() {
 	./waf # inflate waf
 	cd .waf* || die
-	epatch "${FILESDIR}/${PN}"-0.8DrO_o-waflib-fix-perl.patch #578778
+	# needs port
+	#epatch "${FILESDIR}/${PN}"-0.8DrO_o-waflib-fix-perl.patch #578778
 	cd "${S}"
-	epatch "${FILESDIR}/${P}"-ffmpeg-0.11.patch #443256
-	epatch "${FILESDIR}/${P}"-libav-9-p2.patch #443256
-	epatch "${FILESDIR}/${P}"-libav-9.patch #443256
-	epatch "${FILESDIR}/${P}"-cython-0.19.1.patch
-	epatch "${FILESDIR}/${P}"-memset.patch
-	epatch "${FILESDIR}/${P}"-ffmpeg2.patch #536232
-	epatch "${FILESDIR}/${P}"-cpython.patch
-	epatch "${FILESDIR}/${P}"-modpug.patch #536046
-	epatch "${FILESDIR}/${P}"-audio4-p1.patch #540890
-	epatch "${FILESDIR}/${P}"-audio4-p2.patch
-	epatch "${FILESDIR}/${P}"-audio4-p3.patch
-	epatch "${FILESDIR}/${P}"-audio4-p4.patch
-	epatch "${FILESDIR}/${P}"-audio4-p5.patch
-	epatch "${FILESDIR}/${P}"-audio4-p6.patch
-	epatch "${FILESDIR}/${P}"-audio4-p7.patch
-	epatch "${FILESDIR}/${P}"-rtvg.patch #424377
-	epatch "${FILESDIR}/${P}"-samba-4.patch
-
-	if has_version dev-libs/libcdio-paranoia; then
-		sed -i -e 's:cdio/cdda.h:cdio/paranoia/cdda.h:' src/plugins/cdda/cdda.c || die
-	fi
-	epatch_user
+
+	eapply "${FILESDIR}/${PN}"-0.8-ffmpeg2.patch #536232
+
+	eapply "${FILESDIR}/${PN}"-0.8-rtvg.patch #424377
+
+	# required to build tarball from git tree
+	eapply "${FILESDIR}/${P}"-tarball.patch
+
+	eapply_user
 }
 
 src_configure() {
@@ -197,6 +190,7 @@ src_configure() {
 					"aac		faad"
 					"ENABLED	file"
 					"		flac"
+					"		fluidsynth"
 					"ffmpeg		flv"
 					"ffmpeg		tta"
 					"DISABLED	gme" # not in tree
@@ -211,6 +205,7 @@ src_configure() {
 					"		mac"
 					"		mms"
 					"		mad"
+					"ENABLED	midsquash"
 					"		mp4" # bug #387961 (aac, mp3, ape can sit there)
 					"mp3		mpg123"
 					"		modplug"
@@ -220,6 +215,7 @@ src_configure() {
 					"ENABLED	null"
 					"ENABLED	nulstripper"
 					"		ofa"
+					"		opus"
 					"		oss"
 					"ENABLED	pls"
 					"pulseaudio	pulse"


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-sound/xmms2/files/, media-sound/xmms2/
@ 2017-07-30 22:16 Sergei Trofimovich
  0 siblings, 0 replies; 12+ messages in thread
From: Sergei Trofimovich @ 2017-07-30 22:16 UTC (permalink / raw
  To: gentoo-commits

commit:     fef415c56f13404c0ec5501d26012eaf9ca34292
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 30 22:15:45 2017 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sun Jul 30 22:15:55 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fef415c5

media-sound/xmms2: fix hash computation on big-endian platforms

Was manifested as a single test failure in xmms2.

Package-Manager: Portage-2.3.6, Repoman-2.3.3

 .../xmms2/files/xmms2-0.8_p20161122-be-hash.patch  |  39 +++
 media-sound/xmms2/xmms2-0.8_p20161122-r1.ebuild    | 294 +++++++++++++++++++++
 2 files changed, 333 insertions(+)

diff --git a/media-sound/xmms2/files/xmms2-0.8_p20161122-be-hash.patch b/media-sound/xmms2/files/xmms2-0.8_p20161122-be-hash.patch
new file mode 100644
index 00000000000..5fa43298cf7
--- /dev/null
+++ b/media-sound/xmms2/files/xmms2-0.8_p20161122-be-hash.patch
@@ -0,0 +1,39 @@
+From d97c8b8239e8b3c5ddb951d427b7d78ea7faad25 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Sun, 30 Jul 2017 23:08:02 +0100
+Subject: [PATCH] OTHER: _xmmsv_dict_hash: make hash function
+ endianness-agnostic
+
+The following code:
+    uint32_t k;
+    memcpy (&k, data, sizeof (k));
+computes different data depending on platform endianness.
+
+That causes test_xmmsv_serialize_coll_match test to fail
+as collection order is serialized in wrong order.
+
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+---
+ src/lib/xmmstypes/xmmsv_dict.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/lib/xmmstypes/xmmsv_dict.c b/src/lib/xmmstypes/xmmsv_dict.c
+index 5ebe4eb3..32533285 100644
+--- a/src/lib/xmmstypes/xmmsv_dict.c
++++ b/src/lib/xmmstypes/xmmsv_dict.c
+@@ -66,8 +66,10 @@ _xmmsv_dict_hash (const void *key, int len)
+ 
+ 	while (len >= 4)
+ 	{
+-		uint32_t k;
+-		memcpy (&k, data, sizeof (k));
++		uint32_t k = data [0]
++			| data [1] << 8
++			| data [2] << 16
++			| data [3] << 24;
+ 
+ 		k *= m;
+ 		k ^= k >> r;
+-- 
+2.13.3
+

diff --git a/media-sound/xmms2/xmms2-0.8_p20161122-r1.ebuild b/media-sound/xmms2/xmms2-0.8_p20161122-r1.ebuild
new file mode 100644
index 00000000000..68cca7d5b76
--- /dev/null
+++ b/media-sound/xmms2/xmms2-0.8_p20161122-r1.ebuild
@@ -0,0 +1,294 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+USE_RUBY="ruby20 ruby21 ruby22"
+
+inherit eutils multiprocessing python-single-r1 ruby-single toolchain-funcs
+
+# generated as 'python2 ./utils/gen-tarball.py' from clean git tree
+MY_P="${P%_p*}DrO_o-949-gca15e830"
+
+DESCRIPTION="X(cross)platform Music Multiplexing System. Next generation of the XMMS player"
+HOMEPAGE="https://xmms2.org/wiki/Main_Page"
+#SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2"
+SRC_URI="https://dev.gentoo.org/~slyfox/distfiles/${MY_P}.tar.bz2"
+LICENSE="GPL-2 LGPL-2.1"
+
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ppc ~x86"
+
+IUSE="aac airplay +alsa ao asf cdda curl cxx ffmpeg flac fluidsynth gvfs ices
+jack mac mlib-update mms +mad modplug mp3 mp4 musepack ofa opus oss
+perl phonehome pulseaudio python ruby samba +server sid sndfile speex
+test valgrind +vorbis vocoder wavpack xml zeroconf"
+
+RDEPEND="server? (
+		>=dev-db/sqlite-3.3.4
+
+		aac? ( >=media-libs/faad2-2.0 )
+		airplay? ( dev-libs/openssl:0= )
+		alsa? ( media-libs/alsa-lib )
+		ao? ( media-libs/libao )
+		cdda? ( dev-libs/libcdio-paranoia
+			>=media-libs/libdiscid-0.1.1
+			>=media-sound/cdparanoia-3.9.8 )
+		curl? ( >=net-misc/curl-7.15.1 )
+		ffmpeg? ( virtual/ffmpeg )
+		flac? ( media-libs/flac )
+		fluidsynth? ( media-sound/fluidsynth )
+		gvfs? ( gnome-base/gnome-vfs )
+		ices? ( media-libs/libogg
+			media-libs/libshout
+			media-libs/libvorbis )
+		jack? ( >=media-sound/jack-audio-connection-kit-0.101.1 )
+		mac? ( media-sound/mac )
+		mms? ( virtual/ffmpeg
+			>=media-libs/libmms-0.3 )
+		modplug? ( media-libs/libmodplug )
+		mad? ( media-libs/libmad )
+		mp3? ( >=media-sound/mpg123-1.5.1 )
+		musepack? ( media-sound/musepack-tools )
+		ofa? ( media-libs/libofa )
+		opus? ( media-libs/opus
+			media-libs/opusfile )
+		pulseaudio? ( media-sound/pulseaudio )
+		samba? ( >=net-fs/samba-4.2 )
+		sid? ( media-sound/sidplay
+			media-libs/resid )
+		sndfile? ( media-libs/libsndfile )
+		speex? ( media-libs/speex
+			media-libs/libogg )
+		vorbis? ( media-libs/libvorbis )
+		vocoder? ( sci-libs/fftw:3.0= media-libs/libsamplerate )
+		wavpack? ( media-sound/wavpack )
+		xml? ( dev-libs/libxml2 )
+		zeroconf? ( net-dns/avahi[mdnsresponder-compat] )
+	)
+
+	>=dev-libs/glib-2.12.9
+	cxx? ( >=dev-libs/boost-1.32 )
+	perl? ( >=dev-lang/perl-5.8.8 )
+	python? ( ${PYTHON_DEPS} )
+	ruby? ( ${RUBY_DEPS} )
+"
+
+DEPEND="${RDEPEND}
+	dev-lang/python
+	virtual/pkgconfig
+	perl? ( dev-perl/Module-Build
+		virtual/perl-Module-Metadata )
+	python? ( >=dev-python/cython-0.15.1
+		dev-python/pyrex )
+	test? ( dev-util/cunit
+		valgrind? ( dev-util/valgrind ) )
+"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+	# used both for building xmms2 and
+	# optionally linking client library
+	# against python
+	python-single-r1_pkg_setup
+}
+
+# use_enable() is taken as proto
+# $1 - useflag
+# $2 - xmms2 option/plugin name (equals to $1 if not set)
+
+xmms2_flag() {
+	[[ -z $1 ]] && eerror "!!! empty arg. usage: xmms2_flag <USEFLAG> [<xmms2_flagname>]."
+
+	local UWORD=${2:-$1}
+
+	case $1 in
+		ENABLED)
+			echo ",${UWORD}"
+			;;
+		DISABLED)
+			;;
+		*)
+			use $1 && echo ",${UWORD}"
+			;;
+	esac
+}
+
+src_prepare() {
+	./waf # inflate waf
+	cd .waf* || die
+	# needs port
+	#epatch "${FILESDIR}/${PN}"-0.8DrO_o-waflib-fix-perl.patch #578778
+	cd "${S}"
+
+	eapply "${FILESDIR}/${PN}"-0.8-ffmpeg2.patch #536232
+
+	eapply "${FILESDIR}/${PN}"-0.8-rtvg.patch #424377
+
+	# required to build tarball from git tree
+	eapply "${FILESDIR}/${P}"-tarball.patch
+
+	# fix hash to be the same on LE/BE platforms
+	eapply "${FILESDIR}/${P}"-be-hash.patch
+
+	eapply_user
+}
+
+src_configure() {
+	# ./configure alike options.
+	local waf_params="--prefix=/usr \
+			--libdir=/usr/$(get_libdir) \
+			--with-target-platform=${CHOST} \
+			--mandir=/usr/share/man \
+			--infodir=/usr/share/info \
+			--datadir=/usr/share \
+			--sysconfdir=/etc \
+			--localstatedir=/var/lib"
+
+	local optionals=""
+	local plugins=""
+	if ! use server ; then
+		waf_params+=" --without-xmms2d"
+	else
+		# some fun static mappings:
+		local option_map=(	# USE		# sorted xmms2 option flag (same, as USE if empty)
+					"phonehome	et"
+					"ENABLED	launcher"
+					"mlib-update	medialib-updater"
+					"ENABLED	nycli"
+					"		perl"
+					"ENABLED	pixmaps"
+					"		python"
+					"		ruby"
+					"DISABLED	tests"
+					"DISABLED	vistest"
+					"cxx		xmmsclient++"
+					"cxx		xmmsclient++-glib"
+					"DISABLED	xmmsclient-cf"
+					"DISABLED	xmmsclient-ecore" # not in tree
+
+					"test		tests"
+				)
+
+		local plugin_map=(	# USE		# sorted xmms2 plugin flag (same, as USE if empty)
+					"		alsa"
+					"		airplay"
+					"		ao"
+					"ffmpeg		apefile"
+					"ffmpeg		avcodec"
+					"		asf"
+					"ENABLED	asx"
+					"		cdda"
+					"DISABLED	coreaudio" # MacOS only?
+					"		curl"
+					"ENABLED	cue"
+					"zeroconf	daap"
+					"ENABLED	diskwrite"
+					"ENABLED	equalizer"
+					"aac		faad"
+					"ENABLED	file"
+					"		flac"
+					"		fluidsynth"
+					"ffmpeg		flv"
+					"ffmpeg		tta"
+					"DISABLED	gme" # not in tree
+					"		gvfs"
+					"ENABLED	html"
+					"		ices"
+					"ENABLED	icymetaint"
+					"ENABLED	id3v2"
+					"		jack"
+					"ENABLED	karaoke"
+					"ENABLED	m3u"
+					"		mac"
+					"		mms"
+					"		mad"
+					"ENABLED	midsquash"
+					"		mp4" # bug #387961 (aac, mp3, ape can sit there)
+					"mp3		mpg123"
+					"		modplug"
+					"		musepack"
+					"DISABLED	nms" # not in tree
+					"ENABLED	normalize"
+					"ENABLED	null"
+					"ENABLED	nulstripper"
+					"		ofa"
+					"		opus"
+					"		oss"
+					"ENABLED	pls"
+					"pulseaudio	pulse"
+					"ENABLED	replaygain"
+					"xml		rss"
+					"		samba"
+					"DISABLED	sc68" #not in tree
+					"		sid"
+					"		sndfile"
+					"		speex"
+					"DISABLED	sun" # {Open,Net}BSD only
+					"DISABLED	tremor" # not in tree
+					"		vorbis"
+					"		vocoder"
+					"ffmpeg		tta"
+					"ENABLED	wave"
+					"DISABLED	waveout" # windows only
+					"		wavpack"
+					"xml		xspf"
+					"ENABLED	xml"
+				)
+
+		local option
+		for option in "${option_map[@]}"; do
+			optionals+=$(xmms2_flag $option)
+		done
+
+		local plugin
+		for plugin in "${plugin_map[@]}"; do
+			plugins+=$(xmms2_flag $plugin)
+		done
+	fi # ! server
+
+	# pass them explicitely even if empty as we try to avoid magic deps
+	waf_params+=" --with-optionals=${optionals:1}" # skip first ',' if yet
+	waf_params+=" --with-plugins=${plugins:1}"
+	waf_params+=" $(use_with valgrind)"
+
+	CC="$(tc-getCC)"         \
+	CPP="$(tc-getCPP)"       \
+	AR="$(tc-getAR)"         \
+	RANLIB="$(tc-getRANLIB)" \
+	CXX="$(tc-getCXX)"       \
+	    ./waf configure ${waf_params} || die "'waf configure' failed"
+}
+
+src_compile() {
+	# waf is very keen to run tests in build phase (bug #424377) but
+	# it does not bother running tests twice, so the hack below works:
+	./waf --verbose build || ./waf --verbose build || die "waf build failed"
+}
+
+src_test() {
+	# rerun tests
+	./waf --alltests || die "waf --alltests failed"
+}
+
+src_install() {
+	./waf --without-ldconfig --destdir="${D}" install || die "'waf install' failed"
+	dodoc AUTHORS TODO
+}
+
+pkg_postinst() {
+	elog "This version is built on experimental development code"
+	elog "If you encounter any errors report them at http://bugs.xmms2.org"
+	elog "and visit #xmms2 at irc://irc.freenode.net"
+	if use phonehome ; then
+		einfo ""
+		einfo "The phone-home client xmms2-et was activated"
+		einfo "This client sends anonymous usage-statistics to the xmms2"
+		einfo "developers which may help finding bugs"
+		einfo "Disable the phonehome useflag if you don't like that"
+	fi
+}


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-sound/xmms2/files/, media-sound/xmms2/
@ 2018-12-06 19:35 Sergei Trofimovich
  0 siblings, 0 replies; 12+ messages in thread
From: Sergei Trofimovich @ 2018-12-06 19:35 UTC (permalink / raw
  To: gentoo-commits

commit:     19469ee08b4e50d056384139750a488db8276cfa
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Thu Dec  6 08:11:50 2018 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Thu Dec  6 19:35:34 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=19469ee0

media-sound/xmms2: fix c++ client dangling reference

Picked patch from https://github.com/xmms2/xmms2-devel/pull/5

Reported-by: James Le Cuirot
Package-Manager: Portage-2.3.52, Repoman-2.3.12
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 .../files/xmms2-0.8_p20161122-cpp-client.patch     |  68 +++++
 media-sound/xmms2/xmms2-0.8_p20161122-r5.ebuild    | 300 +++++++++++++++++++++
 2 files changed, 368 insertions(+)

diff --git a/media-sound/xmms2/files/xmms2-0.8_p20161122-cpp-client.patch b/media-sound/xmms2/files/xmms2-0.8_p20161122-cpp-client.patch
new file mode 100644
index 00000000000..cedc87fcc46
--- /dev/null
+++ b/media-sound/xmms2/files/xmms2-0.8_p20161122-cpp-client.patch
@@ -0,0 +1,68 @@
+https://github.com/xmms2/xmms2-devel/pull/5
+
+From 82741bf3094c8e0bca8eb1b7f3bc147eeb51ea06 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Thu, 6 Dec 2018 07:19:08 +0000
+Subject: [PATCH] OTHER: fix c++ client dangling reference
+
+On #xmm2 Chewi reported c++/tut7 to be broken at start:
+
+```
+GLib-WARNING **: glib-2.56.2/glib/giounix.c:410
+Error while getting flags for FD: Bad file descriptor (9)
+```
+
+valgrind shows the problem as read of uninitialized data:
+
+```
+$ valgrind ./tut7
+
+==32268== Conditional jump or move depends on uninitialised value(s)
+==32268==    at 0x49DC36B: xmmsc_mainloop_gmain_init (xmmsclient-glib.c:80)
+==32268==    by 0x49E11BE: Xmms::GMainloop::GMainloop(xmmsc_connection_St*) (xmmsclient++-glib.cpp:11)
+==32268==    by 0x10C64D: main (in /home/slyfox/dev/git/xmms2-devel/doc/tutorial/c++/tut7)
+==32268==  Uninitialised value was created by a stack allocation
+==32268==    at 0x49E119A: Xmms::GMainloop::GMainloop(xmmsc_connection_St*) (xmmsclient++-glib.cpp:8)
+```
+
+This happens due to use of dangling C++ reference to stack variable:
+
+```
+// somewhere in src/include/xmmsclient/xmmsclient++/mainloop.h
+class MainloopInterface {
+    MainloopInterface( xmmsc_connection_t* conn ) :
+        running_( false ), conn_( conn ) { }
+  protected:
+    bool running_;
+    xmmsc_connection_t*& conn_;
+}
+```
+
+Note: `conn_` refers to dangling local variable of
+`MainloopInterface::MainloopInterface` constructor.
+
+The fix is to pass through pointer reference.
+`MainLoop::MainLoop()` already does it.
+
+Reported-by: James Le Cuirot
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+---
+ src/include/xmmsclient/xmmsclient++/mainloop.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/include/xmmsclient/xmmsclient++/mainloop.h b/src/include/xmmsclient/xmmsclient++/mainloop.h
+index de97e20d..268ca6f7 100644
+--- a/src/include/xmmsclient/xmmsclient++/mainloop.h
++++ b/src/include/xmmsclient/xmmsclient++/mainloop.h
+@@ -41,7 +41,7 @@ namespace Xmms
+ 			 *  @note The constructor should only initialize the
+ 			 *        mainloop, not start it!
+ 			 */
+-			MainloopInterface( xmmsc_connection_t* conn ) :
++			MainloopInterface( xmmsc_connection_t*& conn ) :
+ 				running_( false ), conn_( conn ) { }
+ 
+ 			/** Destructor.  Should also stop the loop.
+-- 
+2.19.2
+

diff --git a/media-sound/xmms2/xmms2-0.8_p20161122-r5.ebuild b/media-sound/xmms2/xmms2-0.8_p20161122-r5.ebuild
new file mode 100644
index 00000000000..d6d2392bada
--- /dev/null
+++ b/media-sound/xmms2/xmms2-0.8_p20161122-r5.ebuild
@@ -0,0 +1,300 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+USE_RUBY="ruby23 ruby24 ruby25"
+
+inherit eutils multiprocessing python-single-r1 ruby-single toolchain-funcs
+
+# generated as 'python2 ./utils/gen-tarball.py' from clean git tree
+MY_P="${P%_p*}DrO_o-949-gca15e830"
+
+DESCRIPTION="X(cross)platform Music Multiplexing System. Next generation of the XMMS player"
+HOMEPAGE="https://xmms2.org/wiki/Main_Page"
+#SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2"
+SRC_URI="https://dev.gentoo.org/~slyfox/distfiles/${MY_P}.tar.bz2"
+LICENSE="GPL-2 LGPL-2.1"
+
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ppc ~x86"
+
+IUSE="aac airplay +alsa ao asf cdda curl cxx ffmpeg flac fluidsynth ices
+jack mac mlib-update mms +mad modplug mp3 mp4 musepack ofa opus oss
+perl phonehome pulseaudio python ruby samba +server sid sndfile speex
+test valgrind +vorbis vocoder wavpack xml zeroconf"
+
+RDEPEND="server? (
+		>=dev-db/sqlite-3.3.4
+
+		aac? ( >=media-libs/faad2-2.0 )
+		airplay? ( dev-libs/openssl:0= )
+		alsa? ( media-libs/alsa-lib )
+		ao? ( media-libs/libao )
+		cdda? ( dev-libs/libcdio-paranoia
+			>=media-libs/libdiscid-0.1.1
+			>=media-sound/cdparanoia-3.9.8 )
+		curl? ( >=net-misc/curl-7.15.1 )
+		ffmpeg? ( virtual/ffmpeg )
+		flac? ( media-libs/flac )
+		fluidsynth? ( media-sound/fluidsynth )
+		ices? ( media-libs/libogg
+			media-libs/libshout
+			media-libs/libvorbis )
+		jack? ( virtual/jack )
+		mac? ( media-sound/mac )
+		mms? ( virtual/ffmpeg
+			>=media-libs/libmms-0.3 )
+		modplug? ( media-libs/libmodplug )
+		mad? ( media-libs/libmad )
+		mp3? ( >=media-sound/mpg123-1.5.1 )
+		musepack? ( media-sound/musepack-tools )
+		ofa? ( media-libs/libofa )
+		opus? ( media-libs/opus
+			media-libs/opusfile )
+		pulseaudio? ( media-sound/pulseaudio )
+		samba? ( >=net-fs/samba-4.2 )
+		sid? ( media-sound/sidplay
+			media-libs/resid )
+		sndfile? ( media-libs/libsndfile )
+		speex? ( media-libs/speex
+			media-libs/libogg )
+		vorbis? ( media-libs/libvorbis )
+		vocoder? ( sci-libs/fftw:3.0= media-libs/libsamplerate )
+		wavpack? ( media-sound/wavpack )
+		xml? ( dev-libs/libxml2 )
+		zeroconf? ( net-dns/avahi[mdnsresponder-compat] )
+	)
+
+	>=dev-libs/glib-2.12.9
+	cxx? ( >=dev-libs/boost-1.32 )
+	perl? ( >=dev-lang/perl-5.8.8 )
+	python? ( ${PYTHON_DEPS} )
+	ruby? ( ${RUBY_DEPS} )
+"
+
+DEPEND="${RDEPEND}
+	dev-lang/python
+	virtual/pkgconfig
+	perl? ( dev-perl/Module-Build
+		virtual/perl-Module-Metadata )
+	python? ( >=dev-python/cython-0.15.1
+		dev-python/pyrex )
+	test? ( dev-util/cunit
+		valgrind? ( dev-util/valgrind ) )
+"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+	# used both for building xmms2 and
+	# optionally linking client library
+	# against python
+	python-single-r1_pkg_setup
+}
+
+# use_enable() is taken as proto
+# $1 - useflag
+# $2 - xmms2 option/plugin name (equals to $1 if not set)
+
+xmms2_flag() {
+	[[ -z $1 ]] && eerror "!!! empty arg. usage: xmms2_flag <USEFLAG> [<xmms2_flagname>]."
+
+	local UWORD=${2:-$1}
+
+	case $1 in
+		ENABLED)
+			echo ",${UWORD}"
+			;;
+		DISABLED)
+			;;
+		*)
+			use $1 && echo ",${UWORD}"
+			;;
+	esac
+}
+
+src_prepare() {
+	./waf # inflate waf
+	cd .waf* || die
+	# needs port
+	#epatch "${FILESDIR}/${PN}"-0.8DrO_o-waflib-fix-perl.patch #578778
+	eapply "${FILESDIR}/${PN}"-0.8_p20161122-perl-no-local.patch
+	cd "${S}"
+
+	eapply "${FILESDIR}/${PN}"-0.8-ffmpeg2.patch #536232
+
+	eapply "${FILESDIR}/${PN}"-0.8-rtvg.patch #424377
+
+	# required to build tarball from git tree
+	eapply "${FILESDIR}/${P}"-tarball.patch
+
+	# fix hash to be the same on LE/BE platforms
+	eapply "${FILESDIR}/${P}"-be-hash.patch
+
+	# handle mac-3 -> -4 API change
+	eapply "${FILESDIR}/${P}"-mac-4.patch
+
+	# C++ client dangling reference: https://github.com/xmms2/xmms2-devel/pull/5
+	eapply "${FILESDIR}/${P}"-cpp-client.patch
+
+	eapply_user
+}
+
+src_configure() {
+	# ./configure alike options.
+	local waf_params="--prefix=/usr \
+			--libdir=/usr/$(get_libdir) \
+			--with-target-platform=${CHOST} \
+			--mandir=/usr/share/man \
+			--infodir=/usr/share/info \
+			--datadir=/usr/share \
+			--sysconfdir=/etc \
+			--localstatedir=/var/lib"
+
+	local optionals=""
+	local plugins=""
+	if ! use server ; then
+		waf_params+=" --without-xmms2d"
+	else
+		# some fun static mappings:
+		local option_map=(	# USE		# sorted xmms2 option flag (same, as USE if empty)
+					"phonehome	et"
+					"ENABLED	launcher"
+					"mlib-update	medialib-updater"
+					"ENABLED	nycli"
+					"		perl"
+					"ENABLED	pixmaps"
+					"		python"
+					"		ruby"
+					"DISABLED	tests"
+					"DISABLED	vistest"
+					"cxx		xmmsclient++"
+					"cxx		xmmsclient++-glib"
+					"DISABLED	xmmsclient-cf"
+					"DISABLED	xmmsclient-ecore" # not in tree
+
+					"test		tests"
+				)
+
+		local plugin_map=(	# USE		# sorted xmms2 plugin flag (same, as USE if empty)
+					"		alsa"
+					"		airplay"
+					"		ao"
+					"ffmpeg		apefile"
+					"ffmpeg		avcodec"
+					"		asf"
+					"ENABLED	asx"
+					"		cdda"
+					"DISABLED	coreaudio" # MacOS only?
+					"		curl"
+					"ENABLED	cue"
+					"zeroconf	daap"
+					"ENABLED	diskwrite"
+					"ENABLED	equalizer"
+					"aac		faad"
+					"ENABLED	file"
+					"		flac"
+					"		fluidsynth"
+					"ffmpeg		flv"
+					"ffmpeg		tta"
+					"DISABLED	gme" # not in tree
+					"DISABLED	gvfs" # obsolete #647604
+					"ENABLED	html"
+					"		ices"
+					"ENABLED	icymetaint"
+					"ENABLED	id3v2"
+					"		jack"
+					"ENABLED	karaoke"
+					"ENABLED	m3u"
+					"		mac"
+					"		mms"
+					"		mad"
+					"ENABLED	midsquash"
+					"		mp4" # bug #387961 (aac, mp3, ape can sit there)
+					"mp3		mpg123"
+					"		modplug"
+					"		musepack"
+					"DISABLED	nms" # not in tree
+					"ENABLED	normalize"
+					"ENABLED	null"
+					"ENABLED	nulstripper"
+					"		ofa"
+					"		opus"
+					"		oss"
+					"ENABLED	pls"
+					"pulseaudio	pulse"
+					"ENABLED	replaygain"
+					"xml		rss"
+					"		samba"
+					"DISABLED	sc68" #not in tree
+					"		sid"
+					"		sndfile"
+					"		speex"
+					"DISABLED	sun" # {Open,Net}BSD only
+					"DISABLED	tremor" # not in tree
+					"		vorbis"
+					"		vocoder"
+					"ffmpeg		tta"
+					"ENABLED	wave"
+					"DISABLED	waveout" # windows only
+					"		wavpack"
+					"xml		xspf"
+					"ENABLED	xml"
+				)
+
+		local option
+		for option in "${option_map[@]}"; do
+			optionals+=$(xmms2_flag $option)
+		done
+
+		local plugin
+		for plugin in "${plugin_map[@]}"; do
+			plugins+=$(xmms2_flag $plugin)
+		done
+	fi # ! server
+
+	# pass them explicitely even if empty as we try to avoid magic deps
+	waf_params+=" --with-optionals=${optionals:1}" # skip first ',' if yet
+	waf_params+=" --with-plugins=${plugins:1}"
+	waf_params+=" $(use_with valgrind)"
+
+	CC="$(tc-getCC)"         \
+	CPP="$(tc-getCPP)"       \
+	AR="$(tc-getAR)"         \
+	RANLIB="$(tc-getRANLIB)" \
+	CXX="$(tc-getCXX)"       \
+	    ./waf configure ${waf_params} || die "'waf configure' failed"
+}
+
+src_compile() {
+	# waf is very keen to run tests in build phase (bug #424377) but
+	# it does not bother running tests twice, so the hack below works:
+	./waf --verbose build || ./waf --verbose build || die "waf build failed"
+}
+
+src_test() {
+	# rerun tests
+	./waf --alltests || die "waf --alltests failed"
+}
+
+src_install() {
+	./waf --without-ldconfig --destdir="${D}" install || die "'waf install' failed"
+	dodoc AUTHORS TODO
+}
+
+pkg_postinst() {
+	elog "This version is built on experimental development code"
+	elog "If you encounter any errors report them at https://bugs.xmms2.org"
+	elog "and visit #xmms2 at irc://irc.freenode.net"
+	if use phonehome ; then
+		einfo ""
+		einfo "The phone-home client xmms2-et was activated"
+		einfo "This client sends anonymous usage-statistics to the xmms2"
+		einfo "developers which may help finding bugs"
+		einfo "Disable the phonehome useflag if you don't like that"
+	fi
+}


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-sound/xmms2/files/, media-sound/xmms2/
@ 2021-09-22 22:26 Ionen Wolkens
  0 siblings, 0 replies; 12+ messages in thread
From: Ionen Wolkens @ 2021-09-22 22:26 UTC (permalink / raw
  To: gentoo-commits

commit:     e1518299472358d02997f641a51b00accb95a955
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 22 21:45:55 2021 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Wed Sep 22 22:25:36 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e1518299

media-sound/xmms2: drop 0.8_p20161122-r8

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 media-sound/xmms2/Manifest                         |   2 -
 media-sound/xmms2/files/xmms2-0.8-ffmpeg2.patch    |  15 -
 .../xmms2/files/xmms2-0.8_p20161122-be-hash.patch  |  39 ---
 .../xmms2/files/xmms2-0.8_p20161122-gcc-10.patch   |  11 -
 .../xmms2/files/xmms2-0.8_p20161122-tarball.patch  |  78 -----
 media-sound/xmms2/metadata.xml                     |   1 -
 media-sound/xmms2/xmms2-0.8_p20161122-r8.ebuild    | 327 ---------------------
 7 files changed, 473 deletions(-)

diff --git a/media-sound/xmms2/Manifest b/media-sound/xmms2/Manifest
index 0ae44e63d98..38569c9908a 100644
--- a/media-sound/xmms2/Manifest
+++ b/media-sound/xmms2/Manifest
@@ -1,5 +1,3 @@
-DIST waf-2.0.19.tar.bz2 682213 BLAKE2B 0bd2e31827ac65e0565abc09df37a42193ff37b50b6d0244f8b10ba7f308b4ba31ba864742d8c8d4005b86e611223dc4315cf70c0dbbf6b7db8f02e4f551fbb2 SHA512 ae7f3973c79e44313b4894c75763ad43ccd2be88e0d351d7f606ce495c5a464a379c85c076ebd8ba577fc88918af2bbb39bbec1049f25f02c14d98388e012c59
 DIST waf-2.0.22.tar.bz2 687244 BLAKE2B feea82e7e6aaba1187f368aa00025f206a7217196de9be7a97ca6aa8882823decd79db38dda4f1f25e81541eaa44edf029eea8d57e28f7d31b94d9ee93201ea9 SHA512 a3a275fd4c81c7b7385c2da001f3924d272105b8f33839265ebbb38708051b7cb13b9b9019e84325707d04513de0c13b032b1ad21458aec6586d10df4ed8d5f5
-DIST xmms2-0.8DrO_o-949-gca15e830.tar.bz2 1928653 BLAKE2B f34abf0c68f4574593eb706744cc4354bc9b679d005bcaf4a9f03ef90fcb14935428c73d3d74565c41a70efcfa6541af15a455d091b6d17e7ca613229c1c1390 SHA512 affd7fdd259cdb952e972b62f24ab8eb6afd2c87786254a7ae81adffdcfe1454dcf2fb95811a8b90db74dba84918526fd8c920e11582b36aa48725f293c73edb
 DIST xmms2-0.8_p20201016.tar.gz 1720185 BLAKE2B e1cad8ed2ece9d8ce905ffe86de53bb4010639d83fd15700eefccf190034577ff8666f3557bfb23741ed8400eba1e6246ef28ff21c4dbbe499239da945befc74 SHA512 0e73771f56c341e5dea15451457426958217de3ac19cad1924c11740f96feb69e385242a27a9cf9258841ed4e6538c12e135492f715bfae6976b31fb358508bf
 DIST xmms2-s4-0.8_p20201016.tar.gz 184231 BLAKE2B 0676f89b743e265af01593c215c609ae48ea368d861fd28b022b4124a00852182686a46ebf90ac44a10343f86ba5c398c47fd85e2688971b2b4445f3c3843af5 SHA512 f510141ca792893feba2c00d9bc437f492fdce7c29b12c9a8432792ca5a1703cc7068e1a9f4641abd50b320fefb5867fb5bc58a58b0b0272cf75828c764f94ed

diff --git a/media-sound/xmms2/files/xmms2-0.8-ffmpeg2.patch b/media-sound/xmms2/files/xmms2-0.8-ffmpeg2.patch
deleted file mode 100644
index 2e9fac380ea..00000000000
--- a/media-sound/xmms2/files/xmms2-0.8-ffmpeg2.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-Index: xmms2-0.8DrO_o/src/plugins/avcodec/avcodec.c
-===================================================================
---- xmms2-0.8DrO_o.orig/src/plugins/avcodec/avcodec.c
-+++ xmms2-0.8DrO_o/src/plugins/avcodec/avcodec.c
-@@ -29,6 +29,10 @@
- 
- #define AVCODEC_BUFFER_SIZE 16384
- 
-+#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE
-+#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
-+#endif
-+
- typedef struct {
- 	AVCodecContext *codecctx;
- 

diff --git a/media-sound/xmms2/files/xmms2-0.8_p20161122-be-hash.patch b/media-sound/xmms2/files/xmms2-0.8_p20161122-be-hash.patch
deleted file mode 100644
index 5fa43298cf7..00000000000
--- a/media-sound/xmms2/files/xmms2-0.8_p20161122-be-hash.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From d97c8b8239e8b3c5ddb951d427b7d78ea7faad25 Mon Sep 17 00:00:00 2001
-From: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Sun, 30 Jul 2017 23:08:02 +0100
-Subject: [PATCH] OTHER: _xmmsv_dict_hash: make hash function
- endianness-agnostic
-
-The following code:
-    uint32_t k;
-    memcpy (&k, data, sizeof (k));
-computes different data depending on platform endianness.
-
-That causes test_xmmsv_serialize_coll_match test to fail
-as collection order is serialized in wrong order.
-
-Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
----
- src/lib/xmmstypes/xmmsv_dict.c | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/src/lib/xmmstypes/xmmsv_dict.c b/src/lib/xmmstypes/xmmsv_dict.c
-index 5ebe4eb3..32533285 100644
---- a/src/lib/xmmstypes/xmmsv_dict.c
-+++ b/src/lib/xmmstypes/xmmsv_dict.c
-@@ -66,8 +66,10 @@ _xmmsv_dict_hash (const void *key, int len)
- 
- 	while (len >= 4)
- 	{
--		uint32_t k;
--		memcpy (&k, data, sizeof (k));
-+		uint32_t k = data [0]
-+			| data [1] << 8
-+			| data [2] << 16
-+			| data [3] << 24;
- 
- 		k *= m;
- 		k ^= k >> r;
--- 
-2.13.3
-

diff --git a/media-sound/xmms2/files/xmms2-0.8_p20161122-gcc-10.patch b/media-sound/xmms2/files/xmms2-0.8_p20161122-gcc-10.patch
deleted file mode 100644
index 29a8311d219..00000000000
--- a/media-sound/xmms2/files/xmms2-0.8_p20161122-gcc-10.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/src/lib/s4/tests/s4/t_transactions.c
-+++ b/src/lib/s4/tests/s4/t_transactions.c
-@@ -19,7 +19,7 @@
- #include <glib.h>
- #include <glib/gstdio.h>
- 
--s4_t *s4;
-+extern s4_t *s4;
- s4_val_t *val;
- 
- SETUP (Transactions) {

diff --git a/media-sound/xmms2/files/xmms2-0.8_p20161122-tarball.patch b/media-sound/xmms2/files/xmms2-0.8_p20161122-tarball.patch
deleted file mode 100644
index eef49b13f16..00000000000
--- a/media-sound/xmms2/files/xmms2-0.8_p20161122-tarball.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-diff --git a/utils/gen-changelog.py b/utils/gen-changelog.py
-index b539088a..301c0461 100755
---- a/utils/gen-changelog.py
-+++ b/utils/gen-changelog.py
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!/usr/bin/python2
- from subprocess import check_output
- import os
- 
-diff --git a/utils/gen-tarball.py b/utils/gen-tarball.py
-index 2ae2a4d1..09ed5074 100755
---- a/utils/gen-tarball.py
-+++ b/utils/gen-tarball.py
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/env python2
- from subprocess import check_output, call
- import tarfile
- import os
-@@ -40,15 +40,19 @@ def add_files(ball, prefix, template, files):
- 
- VERSION = check_output(["git", "describe"]).strip()
- 
-+# TODO: derive paths from submodule configuration
- TUTORIAL_DIR="doc/tutorial"
-+S4_DIR="src/lib/s4"
- 
- PREFIX="xmms2-%s" % VERSION
- PREFIX_TUTORIAL="%s/%s" % (PREFIX, TUTORIAL_DIR)
-+PREFIX_S4="%s/%s" % (PREFIX, S4_DIR)
- 
- DIST_DIR="dist"
- DIST_XMMS2="%s/xmms2-%s.tar" % (DIST_DIR, VERSION)
- DIST_XMMS2_BZ2="%s/xmms2-%s.tar.bz2" % (DIST_DIR, VERSION)
- DIST_TUTORIAL="%s/xmms2-tutorial-%s.tar" % (DIST_DIR, VERSION)
-+DIST_S4="%s/xmms2-tutorial-%s.tar" % (DIST_DIR, VERSION)
- 
- if not os.path.exists(DIST_DIR):
-     os.mkdir(DIST_DIR)
-@@ -62,6 +66,9 @@ if os.path.exists(DIST_XMMS2_BZ2):
- if os.path.exists(DIST_TUTORIAL):
-     os.unlink(DIST_TUTORIAL)
- 
-+if os.path.exists(DIST_S4):
-+    os.unlink(DIST_S4)
-+
- # Tar up XMMS2
- call("git archive --format=tar --prefix=%s/ HEAD > %s" % (PREFIX, DIST_XMMS2), shell=True)
- 
-@@ -69,9 +76,11 @@ call("git archive --format=tar --prefix=%s/ HEAD > %s" % (PREFIX, DIST_XMMS2), s
- call("git submodule init", shell=True)
- call("git submodule update", shell=True)
- call("git --git-dir=%s/.git archive --format=tar --prefix=%s/ HEAD > %s" % (TUTORIAL_DIR, PREFIX_TUTORIAL, DIST_TUTORIAL), shell=True)
-+call("git --git-dir=%s/.git archive --format=tar --prefix=%s/ HEAD > %s" % (S4_DIR, PREFIX_S4, DIST_S4), shell=True)
- 
--# Append the tutorials to the XMMS2 archive
-+# Append the tutorials and s4 to the XMMS2 archive
- call("tar -Af %s %s" % (DIST_XMMS2, DIST_TUTORIAL), shell=True)
-+call("tar -Af %s %s" % (DIST_XMMS2, DIST_S4), shell=True)
- 
- # Append ChangeLog and a summary of all file hashes."
- add_files(DIST_XMMS2, PREFIX, get_template(DIST_XMMS2, os.path.join(PREFIX, "wscript")), [
-diff --git a/utils/gen-tree-hashes.py b/utils/gen-tree-hashes.py
-index 7f8b9e4f..9d27adb0 100755
---- a/utils/gen-tree-hashes.py
-+++ b/utils/gen-tree-hashes.py
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/env python2
- from subprocess import check_output
- from operator import itemgetter
- import os
-@@ -21,3 +21,4 @@ def collect_hashes(*paths):
- 
- print check_output("git describe", shell=True)
- print collect_hashes(".", "doc/tutorial")
-+print collect_hashes(".", "src/lib/s4")

diff --git a/media-sound/xmms2/metadata.xml b/media-sound/xmms2/metadata.xml
index 34034fc9473..7f08040bab7 100644
--- a/media-sound/xmms2/metadata.xml
+++ b/media-sound/xmms2/metadata.xml
@@ -14,7 +14,6 @@
 		<flag name="mac">Support for Monkey's Audio (APE) format using <pkg>media-sound/mac</pkg></flag>
 		<flag name="mlib-update">Enable building of xmms2-mlib-updater client</flag>
 		<flag name="ofa">Support for Open Fingerprint Architecture (OFA)</flag>
-		<flag name="phonehome">This client sends anonymous usage-statistics to the xmms2</flag>
 		<flag name="server">Build xmms2 player daemon (otherwise only clients are built)</flag>
 		<flag name="sid">Support for C64 SID using <pkg>media-libs/libsidplay</pkg></flag>
 		<flag name="tremor">Support Vorbis using an alternate fixed-point decoder with <pkg>media-libs/tremor</pkg></flag>

diff --git a/media-sound/xmms2/xmms2-0.8_p20161122-r8.ebuild b/media-sound/xmms2/xmms2-0.8_p20161122-r8.ebuild
deleted file mode 100644
index bf8cb66ac17..00000000000
--- a/media-sound/xmms2/xmms2-0.8_p20161122-r8.ebuild
+++ /dev/null
@@ -1,327 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{7,8,9,10} )
-USE_RUBY="ruby24 ruby25 ruby26"
-
-inherit multiprocessing perl-functions python-single-r1 ruby-single toolchain-funcs
-
-# generated as 'python2 ./utils/gen-tarball.py' from clean git tree
-MY_P="${P%_p*}DrO_o-949-gca15e830"
-WAF_VER="2.0.19"
-
-DESCRIPTION="X(cross)platform Music Multiplexing System. Next generation of the XMMS player"
-HOMEPAGE="https://github.com/XMMS2"
-#SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2"
-SRC_URI="https://dev.gentoo.org/~slyfox/distfiles/${MY_P}.tar.bz2
-	https://waf.io/waf-${WAF_VER}.tar.bz2"
-LICENSE="GPL-2 LGPL-2.1"
-
-SLOT="0"
-KEYWORDS="~alpha amd64 ~arm ppc x86"
-
-IUSE="aac airplay +alsa ao asf cdda curl cxx ffmpeg flac fluidsynth ices
-jack mac mlib-update mms +mad modplug mp3 mp4 musepack ofa opus oss
-perl phonehome pulseaudio python ruby samba +server sid sndfile speex
-test valgrind +vorbis vocoder wavpack xml zeroconf"
-
-RDEPEND="server? (
-		>=dev-db/sqlite-3.3.4
-
-		aac? ( >=media-libs/faad2-2.0 )
-		airplay? ( dev-libs/openssl:0= )
-		alsa? ( media-libs/alsa-lib )
-		ao? ( media-libs/libao )
-		cdda? ( dev-libs/libcdio-paranoia
-			>=media-libs/libdiscid-0.1.1
-			>=media-sound/cdparanoia-3.9.8 )
-		curl? ( >=net-misc/curl-7.15.1 )
-		ffmpeg? ( media-video/ffmpeg )
-		flac? ( media-libs/flac )
-		fluidsynth? ( media-sound/fluidsynth )
-		ices? ( media-libs/libogg
-			media-libs/libshout
-			media-libs/libvorbis )
-		jack? ( virtual/jack )
-		mac? ( media-sound/mac )
-		mms? ( media-video/ffmpeg
-			>=media-libs/libmms-0.3 )
-		modplug? ( media-libs/libmodplug )
-		mad? ( media-libs/libmad )
-		mp3? ( >=media-sound/mpg123-1.5.1 )
-		musepack? ( media-sound/musepack-tools )
-		ofa? ( media-libs/libofa )
-		opus? ( media-libs/opus
-			media-libs/opusfile )
-		pulseaudio? ( media-sound/pulseaudio )
-		samba? ( >=net-fs/samba-4.2 )
-		sid? ( media-sound/sidplay
-			media-libs/resid )
-		sndfile? ( media-libs/libsndfile )
-		speex? ( media-libs/speex
-			media-libs/libogg )
-		vorbis? ( media-libs/libvorbis )
-		vocoder? ( sci-libs/fftw:3.0= media-libs/libsamplerate )
-		wavpack? ( media-sound/wavpack )
-		xml? ( dev-libs/libxml2 )
-		zeroconf? ( net-dns/avahi[mdnsresponder-compat] )
-	)
-
-	>=dev-libs/glib-2.12.9
-	cxx? ( >=dev-libs/boost-1.32 )
-	perl? ( >=dev-lang/perl-5.8.8 )
-	python? ( ${PYTHON_DEPS} )
-	ruby? ( ${RUBY_DEPS} )
-"
-
-DEPEND="${RDEPEND}
-	dev-lang/python
-	virtual/pkgconfig
-	perl? ( dev-perl/Module-Build
-		virtual/perl-Module-Metadata )
-	python? ( >=dev-python/cython-0.15.1 )
-	test? ( dev-util/cunit
-		valgrind? ( dev-util/valgrind ) )
-"
-
-RESTRICT="!test? ( test )"
-
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-S="${WORKDIR}/${MY_P}"
-
-PATCHES=(
-	# needs port
-	#epatch "${FILESDIR}/${PN}"-0.8DrO_o-waflib-fix-perl.patch #578778
-
-	"${FILESDIR}/${PN}"-0.8-ffmpeg2.patch #536232
-
-	"${FILESDIR}/${PN}"-0.8-rtvg.patch #424377
-
-	# required to build tarball from git tree
-	"${FILESDIR}/${P}"-tarball.patch
-
-	# fix hash to be the same on LE/BE platforms
-	"${FILESDIR}/${P}"-be-hash.patch
-
-	# handle mac-3 -> -4 API change
-	"${FILESDIR}/${P}"-mac-4.patch
-
-	# C++ client dangling reference: https://github.com/xmms2/xmms2-devel/pull/5
-	"${FILESDIR}/${P}"-cpp-client.patch
-
-	# gcc-10 stopped putting globals into common section
-	"${FILESDIR}/${P}"-gcc-10.patch
-
-	# fix required since faad 2.9.0
-	"${FILESDIR}/${P}"-faad.patch
-)
-
-pkg_setup() {
-	# used both for building xmms2 and
-	# optionally linking client library
-	# against python
-	python-single-r1_pkg_setup
-}
-
-# use_enable() is taken as proto
-# ${1} - useflag
-# ${2} - xmms2 option/plugin name (equals to ${1} if not set)
-
-xmms2_flag() {
-	[[ -z ${1} ]] && eerror "!!! empty arg. usage: xmms2_flag <USEFLAG> [<xmms2_flagname>]."
-
-	local UWORD=${2:-${1}}
-
-	case ${1} in
-		ENABLED)
-			echo ",${UWORD}"
-			;;
-		DISABLED)
-			;;
-		*)
-			use ${1} && echo ",${UWORD}"
-			;;
-	esac
-}
-
-src_prepare() {
-	mv "${WORKDIR}/waf-${WAF_VER}"/{waf,waflib/} . || die
-	default
-}
-
-src_configure() {
-	# ./configure alike options.
-	local waf_params=(
-		--prefix=/usr
-		--libdir=/usr/$(get_libdir)
-		--with-target-platform="${CHOST}"
-		--mandir=/usr/share/man
-		--infodir=/usr/share/info
-		--datadir=/usr/share
-		--sysconfdir=/etc
-		--localstatedir=/var/lib
-	)
-
-	local optionals=""
-	local plugins=""
-	if ! use server ; then
-		waf_params+=( --without-xmms2d )
-	else
-		# some fun static mappings:
-		local option_map=(	# USE		# sorted xmms2 option flag (same, as USE if empty)
-					"phonehome	et"
-					"ENABLED	launcher"
-					"mlib-update	medialib-updater"
-					"ENABLED	nycli"
-					"		perl"
-					"ENABLED	pixmaps"
-					"		python"
-					"		ruby"
-					"DISABLED	tests"
-					"DISABLED	vistest"
-					"cxx		xmmsclient++"
-					"cxx		xmmsclient++-glib"
-					"DISABLED	xmmsclient-cf"
-					"DISABLED	xmmsclient-ecore" # not in tree
-
-					"test		tests"
-				)
-
-		local plugin_map=(	# USE		# sorted xmms2 plugin flag (same, as USE if empty)
-					"		alsa"
-					"		airplay"
-					"		ao"
-					"ffmpeg		apefile"
-					"ffmpeg		avcodec"
-					"		asf"
-					"ENABLED	asx"
-					"		cdda"
-					"DISABLED	coreaudio" # MacOS only?
-					"		curl"
-					"ENABLED	cue"
-					"zeroconf	daap"
-					"ENABLED	diskwrite"
-					"ENABLED	equalizer"
-					"aac		faad"
-					"ENABLED	file"
-					"		flac"
-					"		fluidsynth"
-					"ffmpeg		flv"
-					"ffmpeg		tta"
-					"DISABLED	gme" # not in tree
-					"DISABLED	gvfs" # obsolete #647604
-					"ENABLED	html"
-					"		ices"
-					"ENABLED	icymetaint"
-					"ENABLED	id3v2"
-					"		jack"
-					"ENABLED	karaoke"
-					"ENABLED	m3u"
-					"		mac"
-					"		mms"
-					"		mad"
-					"ENABLED	midsquash"
-					"		mp4" # bug #387961 (aac, mp3, ape can sit there)
-					"mp3		mpg123"
-					"		modplug"
-					"		musepack"
-					"DISABLED	nms" # not in tree
-					"ENABLED	normalize"
-					"ENABLED	null"
-					"ENABLED	nulstripper"
-					"		ofa"
-					"		opus"
-					"		oss"
-					"ENABLED	pls"
-					"pulseaudio	pulse"
-					"ENABLED	replaygain"
-					"xml		rss"
-					"		samba"
-					"DISABLED	sc68" #not in tree
-					"		sid"
-					"		sndfile"
-					"		speex"
-					"DISABLED	sun" # {Open,Net}BSD only
-					"DISABLED	tremor" # not in tree
-					"		vorbis"
-					"		vocoder"
-					"ffmpeg		tta"
-					"ENABLED	wave"
-					"DISABLED	waveout" # windows only
-					"		wavpack"
-					"xml		xspf"
-					"ENABLED	xml"
-				)
-
-		local option
-		for option in "${option_map[@]}"; do
-			optionals+=$(xmms2_flag ${option})
-		done
-
-		local plugin
-		for plugin in "${plugin_map[@]}"; do
-			plugins+=$(xmms2_flag ${plugin})
-		done
-
-		if use perl; then
-			perl_set_version
-			waf_params+=( --with-perl-archdir="${ARCH_LIB}" )
-		fi
-	fi # ! server
-
-	# pass them explicitely even if empty as we try to avoid magic deps
-	waf_params+=(
-		--with-optionals="${optionals:1}" # skip first ',' if yet
-		--with-plugins="${plugins:1}"
-		$(use_with valgrind)
-	)
-
-	CC="$(tc-getCC)"         \
-	CPP="$(tc-getCPP)"       \
-	AR="$(tc-getAR)"         \
-	RANLIB="$(tc-getRANLIB)" \
-	CXX="$(tc-getCXX)"       \
-	    ./waf configure "${waf_params[@]}" || die "'waf configure' failed"
-}
-
-src_compile() {
-	# waf is very keen to run tests in build phase (bug #424377) but
-	# it does not bother running tests twice, so the hack below works:
-	./waf --verbose build || ./waf --verbose build || die "waf build failed"
-}
-
-src_test() {
-	# rerun tests
-	./waf --alltests || die "waf --alltests failed"
-}
-
-src_install() {
-	./waf --without-ldconfig --destdir="${D}" install || die "'waf install' failed"
-	dodoc AUTHORS TODO
-
-	python_optimize
-
-	# waftools/man.py always compresses man pages with gzip.
-	# to avoid code changed let's just un-gzip manpages
-	local m
-	for m in "${ED}"/usr/share/man/man1/*.gz; do
-		# For some combination of USEs no mans are installed.
-		if [[ -f ${m} ]]; then
-			einfo "Uncompressing '${m#${ED}}' back."
-			gzip -d "${m}" || die
-		fi
-	done
-}
-
-pkg_postinst() {
-	if use phonehome ; then
-		einfo ""
-		einfo "The phone-home client xmms2-et was activated"
-		einfo "This client sends anonymous usage-statistics to the xmms2"
-		einfo "developers which may help finding bugs"
-		einfo "Disable the phonehome useflag if you don't like that"
-	fi
-}


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-sound/xmms2/files/, media-sound/xmms2/
@ 2022-03-16  3:42 Ionen Wolkens
  0 siblings, 0 replies; 12+ messages in thread
From: Ionen Wolkens @ 2022-03-16  3:42 UTC (permalink / raw
  To: gentoo-commits

commit:     393ed20e6cb0037c61b4ca85edaa5d58cece6719
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 16 03:17:38 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Wed Mar 16 03:41:47 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=393ed20e

media-sound/xmms2: fix build with ffmpeg5

Closes: https://bugs.gentoo.org/834398
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 .../xmms2/files/xmms2-0.8_p20201016-ffmpeg5.patch  | 125 +++++++++++
 media-sound/xmms2/xmms2-0.8_p20201016-r2.ebuild    | 237 +++++++++++++++++++++
 2 files changed, 362 insertions(+)

diff --git a/media-sound/xmms2/files/xmms2-0.8_p20201016-ffmpeg5.patch b/media-sound/xmms2/files/xmms2-0.8_p20201016-ffmpeg5.patch
new file mode 100644
index 000000000000..14f999643241
--- /dev/null
+++ b/media-sound/xmms2/files/xmms2-0.8_p20201016-ffmpeg5.patch
@@ -0,0 +1,125 @@
+Lazy migration from audio4 that's missing in ffmpeg5, may not be
+entirely right but tested to play at least .tta/.wma properly.
+
+Bug: https://bugs.gentoo.org/834398
+Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
+--- a/src/plugins/avcodec/avcodec.c
++++ b/src/plugins/avcodec/avcodec.c
+@@ -32,4 +32,5 @@
+ typedef struct {
+ 	AVCodecContext *codecctx;
++	AVPacket packet;
+ 
+ 	guchar *buffer;
+@@ -150,4 +151,5 @@
+ 	data->buffer_size = AVCODEC_BUFFER_SIZE;
+ 	data->codecctx = NULL;
++	data->packet.size = 0;
+ 
+ 	data->read_out_frame = av_frame_alloc ();
+@@ -155,6 +157,4 @@
+ 	xmms_xform_private_data_set (xform, data);
+ 
+-	avcodec_register_all ();
+-
+ 	mimetype = xmms_xform_indata_get_str (xform,
+ 	                                      XMMS_STREAM_TYPE_MIMETYPE);
+@@ -467,43 +467,35 @@
+ xmms_avcodec_internal_decode_some (xmms_avcodec_data_t *data)
+ {
+-	int got_frame = 0;
+-	gint bytes_read = 0;
+-	AVPacket packet;
++	int rc = 0;
+ 
+-	av_init_packet (&packet);
+-	packet.data = data->buffer;
+-	packet.size = data->buffer_length;
+-
+-	/* clear buffers and reset fields to defaults */
+-	av_frame_unref (data->read_out_frame);
+-
+-	bytes_read = avcodec_decode_audio4 (
+-		data->codecctx, data->read_out_frame, &got_frame, &packet);
+-
+-	/* The DTS decoder of ffmpeg is buggy and always returns
+-	 * the input buffer length, get frame length from header */
+-	/* FIXME: Is ^^^^ still true? */
+-	if (!strcmp (data->codec_id, "dca") && bytes_read > 0) {
+-		bytes_read = ((int)data->buffer[5] << 12) |
+-		             ((int)data->buffer[6] << 4) |
+-		             ((int)data->buffer[7] >> 4);
+-		bytes_read = (bytes_read & 0x3fff) + 1;
++	if (data->packet.size == 0) {
++		av_init_packet (&data->packet);
++		data->packet.data = data->buffer;
++		data->packet.size = data->buffer_length;
++
++		rc = avcodec_send_packet(data->codecctx, &data->packet);
++		if (rc == AVERROR_EOF)
++			rc = 0;
++	}
++
++	if (rc == 0) {
++		rc = avcodec_receive_frame(data->codecctx, data->read_out_frame);
++		if (rc < 0) {
++			data->packet.size = 0;
++			data->buffer_length = 0;
++			if (rc == AVERROR(EAGAIN)) rc = 0;
++			else if (rc == AVERROR_EOF) rc = 1;
++		}
++		else
++			rc = 1;
+ 	}
+ 
+-	if (bytes_read < 0 || bytes_read > data->buffer_length) {
++	if (rc < 0) {
++		data->packet.size = 0;
+ 		XMMS_DBG ("Error decoding data!");
+ 		return -1;
+ 	}
+ 
+-	if (bytes_read < data->buffer_length) {
+-		data->buffer_length -= bytes_read;
+-		g_memmove (data->buffer,
+-		           data->buffer + bytes_read,
+-		           data->buffer_length);
+-	} else {
+-		data->buffer_length = 0;
+-	}
+-
+-	return got_frame ? 1 : 0;
++	return rc;
+ }
+ 
+--- a/src/plugins/avcodec/wscript
++++ b/src/plugins/avcodec/wscript
+@@ -2,5 +2,5 @@
+ 
+ ## Code fragments for configuration
+-avcodec_decode_audio4_fragment = """
++avcodec_send_packet_fragment = """
+ #ifdef HAVE_LIBAVCODEC_AVCODEC_H
+ # include "libavcodec/avcodec.h"
+@@ -10,9 +10,7 @@
+ int main(void) {
+     AVCodecContext *ctx;
+-    AVFrame *frame;
+-    int got_frame;
+     AVPacket *pkt;
+ 
+-    avcodec_decode_audio4 (ctx, frame, &got_frame, pkt);
++    avcodec_send_packet (ctx, pkt);
+ 
+     return 0;
+@@ -44,7 +42,7 @@
+     # * ffmpeg: commit e4de716, lavc 53.40.0, release 0.9
+     # * libav: commit 0eea212, lavc 53.25.0, release 0.8
+-    conf.check_cc(fragment=avcodec_decode_audio4_fragment, uselib="avcodec",
+-                  uselib_store="avcodec_decode_audio4",
+-                  msg="Checking for function avcodec_decode_audio4", mandatory=True)
++    conf.check_cc(fragment=avcodec_send_packet_fragment, uselib="avcodec",
++                  uselib_store="avcodec_send_packet",
++                  msg="Checking for function avcodec_send_packet", mandatory=True)
+ 
+     # non-mandatory function avcodec_free_frame since

diff --git a/media-sound/xmms2/xmms2-0.8_p20201016-r2.ebuild b/media-sound/xmms2/xmms2-0.8_p20201016-r2.ebuild
new file mode 100644
index 000000000000..a0b5bd032779
--- /dev/null
+++ b/media-sound/xmms2/xmms2-0.8_p20201016-r2.ebuild
@@ -0,0 +1,237 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+inherit multiprocessing optfeature perl-functions python-single-r1 toolchain-funcs
+
+XMMS2_COMMIT="46da10f0e20c53fd2b40843617ed182c0cba4ebb"
+S4_COMMIT="652ac581df7a0bca04334da397f8bb4f86eb7b59"
+WAF_VER="2.0.22"
+
+DESCRIPTION="X(cross)platform Music Multiplexing System, next generation of the XMMS player"
+HOMEPAGE="https://github.com/XMMS2"
+SRC_URI="
+	https://github.com/xmms2/xmms2-devel/archive/${XMMS2_COMMIT}.tar.gz -> ${P}.tar.gz
+	https://github.com/xmms2/s4/archive/${S4_COMMIT}.tar.gz -> ${PN}-s4-${PV}.tar.gz
+	https://waf.io/waf-${WAF_VER}.tar.bz2"
+S="${WORKDIR}/${PN}-devel-${XMMS2_COMMIT}"
+
+LICENSE="GPL-2+ LGPL-2.1+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ppc ~riscv ~x86"
+
+# IUSE static map to be passed to --with-{optionals,plugins}=opt1,opt2,...
+# flag:opt = `usev flag opt`, opt = `usev opt`, :opt = `echo opt`
+XMMS2_OPTIONALS=(
+	cxx:xmmsclient++,xmmsclient++-glib :launcher mlib-update:medialib-updater
+	:nycli perl :pixmaps python server:s4 test:tests
+	# disabled: et,mdns,migrate-collections,ruby,sqlite2s4,vistest,xmmsclient-cf,xmmsclient-ecore
+)
+XMMS2_PLUGINS=(
+	aac:faad airplay alsa ao asf :asx cdda :cue curl :diskwrite :equalizer
+	ffmpeg:apefile,avcodec,flv,tta :file flac fluidsynth:fluidsynth,mid1,midsquash
+	gme :html ices :icymetaint :id3v2 jack :karaoke :m3u mac +mad mms modplug
+	mp3:mpg123 :mp4 musepack :normalize :null :nulstripper ofa opus oss :pls
+	pulseaudio:pulse :replaygain samba sid sndfile speex tremor vocoder +vorbis
+	:wave wavpack :xml xml:rss,xspf zeroconf:daap
+	# disabled: coreaudio,gvfs,nms,sc68,sun,waveout
+)
+
+IUSE="
+	${XMMS2_OPTIONALS[@]%:*}
+	${XMMS2_PLUGINS[@]%:*}
+	+server valgrind"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+RESTRICT="!test? ( test ) !server? ( test )"
+
+COMMON_DEPEND="
+	dev-libs/glib:2
+	sys-libs/readline:=
+	server? (
+		aac? ( media-libs/faad2 )
+		airplay? ( dev-libs/openssl:= )
+		alsa? ( media-libs/alsa-lib )
+		ao? ( media-libs/libao )
+		cdda? (
+			dev-libs/libcdio-paranoia:=
+			dev-libs/libcdio:=
+			media-libs/libdiscid
+		)
+		curl? ( net-misc/curl )
+		ffmpeg? ( media-video/ffmpeg:= )
+		flac? ( media-libs/flac )
+		fluidsynth? ( media-sound/fluidsynth:= )
+		gme? ( media-libs/game-music-emu )
+		ices? (
+			media-libs/libogg
+			media-libs/libshout
+			media-libs/libvorbis
+		)
+		jack? ( virtual/jack )
+		mac? ( media-sound/mac )
+		mad? ( media-libs/libmad )
+		mms? (
+			media-libs/libmms
+			media-video/ffmpeg:=
+		)
+		modplug? ( media-libs/libmodplug )
+		mp3? ( media-sound/mpg123 )
+		musepack? ( media-sound/musepack-tools )
+		ofa? (
+			dev-libs/expat
+			media-libs/libofa
+			sci-libs/fftw:3.0=
+		)
+		opus? (
+			media-libs/libogg
+			media-libs/opus
+			media-libs/opusfile
+		)
+		pulseaudio? ( media-sound/pulseaudio )
+		samba? ( net-fs/samba )
+		sid? ( media-libs/libsidplay:2 )
+		sndfile? ( media-libs/libsndfile )
+		speex? (
+			media-libs/libogg
+			media-libs/speex
+		)
+		tremor? ( media-libs/tremor )
+		vocoder? (
+			media-libs/libsamplerate
+			sci-libs/fftw:3.0=
+		)
+		vorbis? ( media-libs/libvorbis )
+		wavpack? ( media-sound/wavpack )
+		xml? ( dev-libs/libxml2 )
+		zeroconf? (
+			net-dns/avahi[mdnsresponder-compat]
+			net-misc/curl
+		)
+	)
+	python? ( virtual/libcrypt:= )"
+RDEPEND="
+	${COMMON_DEPEND}
+	perl? (
+		dev-lang/perl
+		dev-perl/glib-perl
+		virtual/perl-Carp
+		virtual/perl-IO
+		virtual/perl-Scalar-List-Utils
+	)
+	python? (
+		${PYTHON_DEPS}
+		$(python_gen_cond_dep 'dev-python/pygobject[${PYTHON_USEDEP}]')
+	)"
+DEPEND="
+	${COMMON_DEPEND}
+	cxx? ( dev-libs/boost )
+	test? ( dev-util/cunit )"
+BDEPEND="
+	${PYTHON_DEPS}
+	virtual/pkgconfig
+	perl? (	dev-perl/Pod-Parser )
+	python? ( $(python_gen_cond_dep 'dev-python/cython[${PYTHON_USEDEP}]') )
+	test? ( valgrind? ( dev-util/valgrind ) )"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-0.8-rtvg.patch
+	"${FILESDIR}"/${PN}-0.8_p20161122-mac-4.patch
+	"${FILESDIR}"/${PN}-0.8_p20161122-cpp-client.patch
+	"${FILESDIR}"/${PN}-0.8_p20161122-faad.patch
+	"${FILESDIR}"/${P}-ffmpeg5.patch
+)
+
+src_prepare() {
+	rmdir src/lib/s4 && mv ../s4-${S4_COMMIT} src/lib/s4 || die
+	mv ../waf-${WAF_VER}/waf{,lib} . || die
+
+	default
+
+	sed -e "s|/path/to/.*sf2|${EPREFIX}/usr/share/sounds/sf2/FluidR3_GM.sf2|" \
+		-i src/plugins/fluidsynth/fluidsynth.c || die
+}
+
+src_configure() {
+	local waf=(
+		./waf configure
+		--prefix="${EPREFIX}"/usr
+		--libdir="${EPREFIX}"/usr/$(get_libdir)
+		--boost-includes="${ESYSROOT}"/usr/include # needed for prefix
+		--with-custom-version="%(version)s (git commit: ${XMMS2_COMMIT:0:8})"
+		--with-target-platform="${CHOST}"
+	)
+
+	xmms2_flag() {
+		local IFS=:
+		set -- ${1#+}
+
+		if [[ ${1} ]]; then
+			usev ${1} ,${2:-${1}}
+		else
+			echo ,${2}
+		fi
+	}
+
+	local flag optionals plugins
+
+	if use server; then
+		for flag in "${XMMS2_PLUGINS[@]}"; do
+			plugins+=$(xmms2_flag ${flag})
+		done
+	else
+		waf+=( --without-xmms2d )
+	fi
+
+	for flag in "${XMMS2_OPTIONALS[@]}"; do
+		optionals+=$(xmms2_flag ${flag})
+	done
+
+	waf+=(
+		# pass even if empty to avoid automagic
+		--with-optionals=${optionals:1}
+		--with-plugins=${plugins:1}
+	)
+
+	if use perl; then
+		perl_set_version
+		waf+=( --with-perl-archdir="${ARCH_LIB}" )
+	fi
+
+	if use valgrind; then
+		if valgrind true &>/dev/null; then
+			waf+=( --with-valgrind )
+		else
+			ewarn "valgrind was disabled due to failing a basic sanity check" #807271
+		fi
+	fi
+
+	tc-export AR CC CXX
+
+	echo "${waf[*]}"
+	"${waf[@]}" || die
+}
+
+src_compile() {
+	./waf build -j$(makeopts_jobs) --verbose --notests || die
+}
+
+src_test() {
+	./waf --alltests || die
+}
+
+src_install() {
+	./waf install --destdir="${D}" --without-ldconfig --notests || die
+
+	einstalldocs
+
+	use python && python_optimize
+
+	# to avoid editing waftools/man.py (use find given not always installed)
+	find "${ED}" -name '*.gz' -exec gzip -d {} + || die
+}
+
+pkg_postinst() {
+	use fluidsynth && optfeature "the default MIDI soundfont" media-sound/fluid-soundfont
+}


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-sound/xmms2/files/, media-sound/xmms2/
@ 2022-05-03  5:57 Ionen Wolkens
  0 siblings, 0 replies; 12+ messages in thread
From: Ionen Wolkens @ 2022-05-03  5:57 UTC (permalink / raw
  To: gentoo-commits

commit:     24f50fc0c415d1037d79b26c802c944ef0da4035
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Tue May  3 04:29:08 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Tue May  3 05:55:43 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=24f50fc0

media-sound/xmms2: add 0.9.1

Special thanks to slyfox for handling a few things upstream
and making a release after so long.

Mostly same as previous snapshot with patches but with several
of these upstreamed and now have a proper release tarball
including s4 submodule and updated waf to simplify the ebuild.

Also refreshed older patches (none are new).

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 media-sound/xmms2/Manifest                         |   1 +
 .../xmms2/files/xmms2-0.9.1-cpp-client.patch       |  13 ++
 media-sound/xmms2/files/xmms2-0.9.1-faad.patch     |  13 ++
 media-sound/xmms2/files/xmms2-0.9.1-rtvg.patch     |  23 +++
 media-sound/xmms2/xmms2-0.9.1.ebuild               | 224 +++++++++++++++++++++
 5 files changed, 274 insertions(+)

diff --git a/media-sound/xmms2/Manifest b/media-sound/xmms2/Manifest
index 38569c9908ac..e49b5778f52a 100644
--- a/media-sound/xmms2/Manifest
+++ b/media-sound/xmms2/Manifest
@@ -1,3 +1,4 @@
 DIST waf-2.0.22.tar.bz2 687244 BLAKE2B feea82e7e6aaba1187f368aa00025f206a7217196de9be7a97ca6aa8882823decd79db38dda4f1f25e81541eaa44edf029eea8d57e28f7d31b94d9ee93201ea9 SHA512 a3a275fd4c81c7b7385c2da001f3924d272105b8f33839265ebbb38708051b7cb13b9b9019e84325707d04513de0c13b032b1ad21458aec6586d10df4ed8d5f5
 DIST xmms2-0.8_p20201016.tar.gz 1720185 BLAKE2B e1cad8ed2ece9d8ce905ffe86de53bb4010639d83fd15700eefccf190034577ff8666f3557bfb23741ed8400eba1e6246ef28ff21c4dbbe499239da945befc74 SHA512 0e73771f56c341e5dea15451457426958217de3ac19cad1924c11740f96feb69e385242a27a9cf9258841ed4e6538c12e135492f715bfae6976b31fb358508bf
+DIST xmms2-0.9.1.tar.bz2 1940773 BLAKE2B 4044499c2ffc55e66d5836e2e36360486b970ff05f0dc17b62e65111c06cfcc84f58c74427b1afa4455b4e0bdb7784dc8840cc84411bc57cb7b9f0cac4e46359 SHA512 a7d42202571d7eb5d9da4c9f5d55d2f6e072df52892080d6cc4349f66a55f5fece510c9872be9814dd5b258d0c59e2704ea8497c2d3be515c510d602c17b703a
 DIST xmms2-s4-0.8_p20201016.tar.gz 184231 BLAKE2B 0676f89b743e265af01593c215c609ae48ea368d861fd28b022b4124a00852182686a46ebf90ac44a10343f86ba5c398c47fd85e2688971b2b4445f3c3843af5 SHA512 f510141ca792893feba2c00d9bc437f492fdce7c29b12c9a8432792ca5a1703cc7068e1a9f4641abd50b320fefb5867fb5bc58a58b0b0272cf75828c764f94ed

diff --git a/media-sound/xmms2/files/xmms2-0.9.1-cpp-client.patch b/media-sound/xmms2/files/xmms2-0.9.1-cpp-client.patch
new file mode 100644
index 000000000000..491c6fb9771d
--- /dev/null
+++ b/media-sound/xmms2/files/xmms2-0.9.1-cpp-client.patch
@@ -0,0 +1,13 @@
+https://github.com/xmms2/xmms2-devel/pull/5
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Thu, 6 Dec 2018 07:19:08 +0000
+Subject: [PATCH] OTHER: fix c++ client dangling reference
+--- a/src/include/xmmsclient/xmmsclient++/mainloop.h
++++ b/src/include/xmmsclient/xmmsclient++/mainloop.h
+@@ -42,5 +42,5 @@
+ 			 *        mainloop, not start it!
+ 			 */
+-			MainloopInterface( xmmsc_connection_t* conn ) :
++			MainloopInterface( xmmsc_connection_t*& conn ) :
+ 				running_( false ), conn_( conn ) { }
+ 

diff --git a/media-sound/xmms2/files/xmms2-0.9.1-faad.patch b/media-sound/xmms2/files/xmms2-0.9.1-faad.patch
new file mode 100644
index 000000000000..6c282ed6d0a4
--- /dev/null
+++ b/media-sound/xmms2/files/xmms2-0.9.1-faad.patch
@@ -0,0 +1,13 @@
+This line has stopped working since security fixes in the faad 2.9.0
+release. XMMS2 upstream were informed via IRC but have yet to act on
+it. I've run XMMS2 with this patch for months without issue.
+
+-- Chewi
+--- a/src/plugins/faad/faad.c
++++ b/src/plugins/faad/faad.c
+@@ -243,5 +243,4 @@
+ 	 * it frame 1.
+ 	 */
+-	NeAACDecPostSeekReset (data->decoder, 1);
+ 
+ 	/* FIXME: Because for HE AAC files some versions of libfaad return the wrong

diff --git a/media-sound/xmms2/files/xmms2-0.9.1-rtvg.patch b/media-sound/xmms2/files/xmms2-0.9.1-rtvg.patch
new file mode 100644
index 000000000000..86f48ca066dc
--- /dev/null
+++ b/media-sound/xmms2/files/xmms2-0.9.1-rtvg.patch
@@ -0,0 +1,23 @@
+Add knob to control valgrind usage during tests.
+https://bugs.gentoo.org/424377
+--- a/waftools/unittest.py
++++ b/waftools/unittest.py
+@@ -147,5 +147,6 @@
+ def configure(conf):
+     conf.load("waf_unit_test")
+-    conf.find_program("valgrind", var="VALGRIND", mandatory=False)
++    if conf.options.enable_valgrind is True:
++        conf.find_program("valgrind", var="VALGRIND", mandatory=False)
+     conf.find_program("lcov", var="LCOV", mandatory=False)
+     conf.find_program("genhtml", var="GENHTML", mandatory=False)
+--- a/wscript
++++ b/wscript
+@@ -624,4 +624,8 @@
+     opt.add_option('--without-ldconfig', action='store_false',
+                    dest='ldconfig', help="Don't run ldconfig after install")
++    opt.add_option('--with-valgrind', action='store_true', default=None,
++                   dest='enable_valgrind', help="Run testsuite under valgrind (if present).")
++    opt.add_option('--without-valgrind', action='store_false', default=None,
++                   dest='enable_valgrind', help="Don't run testsuite under valgrind.")
+ 
+     opt.recurse("src/xmms")

diff --git a/media-sound/xmms2/xmms2-0.9.1.ebuild b/media-sound/xmms2/xmms2-0.9.1.ebuild
new file mode 100644
index 000000000000..3352a282436e
--- /dev/null
+++ b/media-sound/xmms2/xmms2-0.9.1.ebuild
@@ -0,0 +1,224 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+inherit multiprocessing optfeature perl-functions python-single-r1 toolchain-funcs
+
+DESCRIPTION="X(cross)platform Music Multiplexing System, next generation of the XMMS player"
+HOMEPAGE="https://github.com/XMMS2"
+SRC_URI="https://github.com/xmms2/xmms2-devel/releases/download/${PV}/${P}.tar.bz2"
+
+LICENSE="GPL-2+ LGPL-2.1+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ppc ~riscv ~x86"
+
+# IUSE static map to be passed to --with-{optionals,plugins}=opt1,opt2,...
+# flag:opt = `usev flag opt`, opt = `usev opt`, :opt = `echo opt`
+# (if have a use for some of these disabled features, please fill a bug)
+XMMS2_OPTIONALS=(
+	cxx:xmmsclient++,xmmsclient++-glib :launcher mlib-update:medialib-updater
+	:nycli perl :pixmaps python server:s4 test:tests
+	# disabled: et,mdns,migrate-collections,ruby,sqlite2s4,vistest,xmmsclient-cf,xmmsclient-ecore
+)
+XMMS2_PLUGINS=(
+	aac:faad airplay alsa ao :asx cdda :cue curl :diskwrite :equalizer
+	ffmpeg:apefile,asf,avcodec,flv,tta :file flac fluidsynth:fluidsynth,mid1,midsquash
+	gme :html ices :icymetaint :id3v2 jack :karaoke :m3u mac +mad mms modplug
+	mp3:mpg123 :mp4 musepack :normalize :null :nulstripper ofa opus oss :pls
+	pulseaudio:pulse :replaygain samba sid sndfile speex tremor vocoder +vorbis
+	:wave wavpack :xml xml:rss,xspf zeroconf:daap
+	# disabled: coreaudio,gvfs,nms,sc68,sun,waveout
+)
+
+IUSE="
+	${XMMS2_OPTIONALS[@]%:*}
+	${XMMS2_PLUGINS[@]%:*}
+	+server valgrind"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+RESTRICT="!test? ( test ) !server? ( test )"
+
+COMMON_DEPEND="
+	dev-libs/glib:2
+	sys-libs/readline:=
+	server? (
+		aac? ( media-libs/faad2 )
+		airplay? ( dev-libs/openssl:= )
+		alsa? ( media-libs/alsa-lib )
+		ao? ( media-libs/libao )
+		cdda? (
+			dev-libs/libcdio-paranoia:=
+			dev-libs/libcdio:=
+			media-libs/libdiscid
+		)
+		curl? ( net-misc/curl )
+		ffmpeg? ( media-video/ffmpeg:= )
+		flac? ( media-libs/flac )
+		fluidsynth? ( media-sound/fluidsynth:= )
+		gme? ( media-libs/game-music-emu )
+		ices? (
+			media-libs/libogg
+			media-libs/libshout
+			media-libs/libvorbis
+		)
+		jack? ( virtual/jack )
+		mac? ( media-sound/mac )
+		mad? ( media-libs/libmad )
+		mms? (
+			media-libs/libmms
+			media-video/ffmpeg:=
+		)
+		modplug? ( media-libs/libmodplug )
+		mp3? ( media-sound/mpg123 )
+		musepack? ( media-sound/musepack-tools )
+		ofa? (
+			dev-libs/expat
+			media-libs/libofa
+			sci-libs/fftw:3.0=
+		)
+		opus? (
+			media-libs/libogg
+			media-libs/opus
+			media-libs/opusfile
+		)
+		pulseaudio? ( || ( media-libs/libpulse media-sound/pulseaudio ) )
+		samba? ( net-fs/samba )
+		sid? ( media-libs/libsidplay:2 )
+		sndfile? ( media-libs/libsndfile )
+		speex? (
+			media-libs/libogg
+			media-libs/speex
+		)
+		tremor? ( media-libs/tremor )
+		vocoder? (
+			media-libs/libsamplerate
+			sci-libs/fftw:3.0=
+		)
+		vorbis? ( media-libs/libvorbis )
+		wavpack? ( media-sound/wavpack )
+		xml? ( dev-libs/libxml2 )
+		zeroconf? (
+			net-dns/avahi[mdnsresponder-compat]
+			net-misc/curl
+		)
+	)"
+RDEPEND="
+	${COMMON_DEPEND}
+	perl? (
+		dev-lang/perl
+		dev-perl/glib-perl
+		virtual/perl-Carp
+		virtual/perl-IO
+		virtual/perl-Scalar-List-Utils
+	)
+	python? (
+		${PYTHON_DEPS}
+		$(python_gen_cond_dep 'dev-python/pygobject[${PYTHON_USEDEP}]')
+	)"
+DEPEND="
+	${COMMON_DEPEND}
+	cxx? ( dev-libs/boost )
+	test? ( dev-util/cunit )"
+BDEPEND="
+	${PYTHON_DEPS}
+	virtual/pkgconfig
+	perl? (	dev-perl/Pod-Parser )
+	python? ( $(python_gen_cond_dep 'dev-python/cython[${PYTHON_USEDEP}]') )
+	test? ( valgrind? ( dev-util/valgrind ) )"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-0.9.1-cpp-client.patch
+	"${FILESDIR}"/${PN}-0.9.1-faad.patch
+	"${FILESDIR}"/${PN}-0.9.1-rtvg.patch
+)
+
+src_prepare() {
+	default
+
+	# meant to be configured, but give a default for out-of-the-box midi
+	sed -e "s|/path/to/.*sf2|${EPREFIX}/usr/share/sounds/sf2/FluidR3_GM.sf2|" \
+		-i src/plugins/fluidsynth/fluidsynth.c || die
+}
+
+src_configure() {
+	local waf=(
+		./waf configure
+		--prefix="${EPREFIX}"/usr
+		--libdir="${EPREFIX}"/usr/$(get_libdir)
+		--boost-includes="${ESYSROOT}"/usr/include # needed for prefix
+		--with-target-platform="${CHOST}"
+	)
+
+	xmms2_flag() {
+		local IFS=:
+		set -- ${1#+}
+
+		if [[ ${1} ]]; then
+			usev ${1} ,${2:-${1}}
+		else
+			echo ,${2}
+		fi
+	}
+
+	local flag optionals plugins
+
+	if use server; then
+		for flag in "${XMMS2_PLUGINS[@]}"; do
+			plugins+=$(xmms2_flag ${flag})
+		done
+	else
+		waf+=( --without-xmms2d )
+	fi
+
+	for flag in "${XMMS2_OPTIONALS[@]}"; do
+		optionals+=$(xmms2_flag ${flag})
+	done
+
+	waf+=(
+		# pass even if empty to avoid automagic
+		--with-optionals=${optionals:1}
+		--with-plugins=${plugins:1}
+	)
+
+	if use perl; then
+		perl_set_version
+		waf+=( --with-perl-archdir="${ARCH_LIB}" )
+	fi
+
+	if use valgrind; then
+		if valgrind true &>/dev/null; then
+			waf+=( --with-valgrind )
+		else
+			ewarn "valgrind was disabled due to failing a basic sanity check" #807271
+		fi
+	fi
+
+	tc-export AR CC CXX
+
+	echo "${waf[*]}"
+	"${waf[@]}" || die
+}
+
+src_compile() {
+	./waf build -j$(makeopts_jobs) --verbose --notests || die
+}
+
+src_test() {
+	./waf --alltests || die
+}
+
+src_install() {
+	./waf install --destdir="${D}" --without-ldconfig --notests || die
+
+	dodoc AUTHORS README.mdown *.ChangeLog
+
+	use python && python_optimize
+
+	# to avoid editing waftools/man.py (use find given not always installed)
+	find "${ED}" -name '*.gz' -exec gzip -d {} + || die
+}
+
+pkg_postinst() {
+	use fluidsynth && optfeature "the default MIDI soundfont" media-sound/fluid-soundfont
+}


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-sound/xmms2/files/, media-sound/xmms2/
@ 2022-06-02 15:07 Ionen Wolkens
  0 siblings, 0 replies; 12+ messages in thread
From: Ionen Wolkens @ 2022-06-02 15:07 UTC (permalink / raw
  To: gentoo-commits

commit:     7d0d6669b10193e155bf9c8cf30eab47bc4b6ea6
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Thu Jun  2 13:24:15 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Thu Jun  2 14:56:58 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d0d6669

media-sound/xmms2: drop 0.8_p20201016-r2

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 media-sound/xmms2/Manifest                         |   3 -
 media-sound/xmms2/files/xmms2-0.8-rtvg.patch       |  31 ---
 .../files/xmms2-0.8_p20161122-cpp-client.patch     |  16 --
 .../xmms2/files/xmms2-0.8_p20161122-faad.patch     |  16 --
 .../xmms2/files/xmms2-0.8_p20161122-mac-4.patch    |  38 ----
 .../xmms2/files/xmms2-0.8_p20201016-ffmpeg5.patch  | 127 -----------
 media-sound/xmms2/xmms2-0.8_p20201016-r2.ebuild    | 237 ---------------------
 7 files changed, 468 deletions(-)

diff --git a/media-sound/xmms2/Manifest b/media-sound/xmms2/Manifest
index e49b5778f52a..39e87419b578 100644
--- a/media-sound/xmms2/Manifest
+++ b/media-sound/xmms2/Manifest
@@ -1,4 +1 @@
-DIST waf-2.0.22.tar.bz2 687244 BLAKE2B feea82e7e6aaba1187f368aa00025f206a7217196de9be7a97ca6aa8882823decd79db38dda4f1f25e81541eaa44edf029eea8d57e28f7d31b94d9ee93201ea9 SHA512 a3a275fd4c81c7b7385c2da001f3924d272105b8f33839265ebbb38708051b7cb13b9b9019e84325707d04513de0c13b032b1ad21458aec6586d10df4ed8d5f5
-DIST xmms2-0.8_p20201016.tar.gz 1720185 BLAKE2B e1cad8ed2ece9d8ce905ffe86de53bb4010639d83fd15700eefccf190034577ff8666f3557bfb23741ed8400eba1e6246ef28ff21c4dbbe499239da945befc74 SHA512 0e73771f56c341e5dea15451457426958217de3ac19cad1924c11740f96feb69e385242a27a9cf9258841ed4e6538c12e135492f715bfae6976b31fb358508bf
 DIST xmms2-0.9.1.tar.bz2 1940773 BLAKE2B 4044499c2ffc55e66d5836e2e36360486b970ff05f0dc17b62e65111c06cfcc84f58c74427b1afa4455b4e0bdb7784dc8840cc84411bc57cb7b9f0cac4e46359 SHA512 a7d42202571d7eb5d9da4c9f5d55d2f6e072df52892080d6cc4349f66a55f5fece510c9872be9814dd5b258d0c59e2704ea8497c2d3be515c510d602c17b703a
-DIST xmms2-s4-0.8_p20201016.tar.gz 184231 BLAKE2B 0676f89b743e265af01593c215c609ae48ea368d861fd28b022b4124a00852182686a46ebf90ac44a10343f86ba5c398c47fd85e2688971b2b4445f3c3843af5 SHA512 f510141ca792893feba2c00d9bc437f492fdce7c29b12c9a8432792ca5a1703cc7068e1a9f4641abd50b320fefb5867fb5bc58a58b0b0272cf75828c764f94ed

diff --git a/media-sound/xmms2/files/xmms2-0.8-rtvg.patch b/media-sound/xmms2/files/xmms2-0.8-rtvg.patch
deleted file mode 100644
index e0a970c91869..000000000000
--- a/media-sound/xmms2/files/xmms2-0.8-rtvg.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-Add knob to disable valgrind at test runtime.
-
-When valgrind is installed in system but is not
-working we should still be able to run tests.
-
-Bug: https://bugs.gentoo.org/424377
---- a/waftools/unittest.py
-+++ b/waftools/unittest.py
-@@ -64,7 +64,8 @@ def generate_coverage(bld):
- 
- def configure(conf):
-     conf.load("waf_unit_test")
--    conf.find_program("valgrind", var="VALGRIND", mandatory=False)
-+    if conf.options.enable_valgrind is True:
-+        conf.find_program("valgrind", var="VALGRIND", mandatory=False)
-     conf.find_program("lcov", var="LCOV", mandatory=False)
-     conf.find_program("genhtml", var="GENHTML", mandatory=False)
- 
---- a/wscript
-+++ b/wscript
-@@ -501,6 +501,10 @@ def options(opt):
-                    dest='ldconfig', help="Run ldconfig after install even if not root")
-     opt.add_option('--without-ldconfig', action='store_false',
-                    dest='ldconfig', help="Don't run ldconfig after install")
-+    opt.add_option('--with-valgrind', action='store_true', default=None,
-+                   dest='enable_valgrind', help="Run testsuite under valgrind (if present).")
-+    opt.add_option('--without-valgrind', action='store_false', default=None,
-+                   dest='enable_valgrind', help="Don't run testsuite under valgrind.")
- 
-     opt.sub_options("src/xmms")
-     for o in optional_subdirs + subdirs:

diff --git a/media-sound/xmms2/files/xmms2-0.8_p20161122-cpp-client.patch b/media-sound/xmms2/files/xmms2-0.8_p20161122-cpp-client.patch
deleted file mode 100644
index df1d1c616576..000000000000
--- a/media-sound/xmms2/files/xmms2-0.8_p20161122-cpp-client.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-https://github.com/xmms2/xmms2-devel/pull/5
-
-From: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Thu, 6 Dec 2018 07:19:08 +0000
-Subject: [PATCH] OTHER: fix c++ client dangling reference
---- a/src/include/xmmsclient/xmmsclient++/mainloop.h
-+++ b/src/include/xmmsclient/xmmsclient++/mainloop.h
-@@ -41,7 +41,7 @@ namespace Xmms
- 			 *  @note The constructor should only initialize the
- 			 *        mainloop, not start it!
- 			 */
--			MainloopInterface( xmmsc_connection_t* conn ) :
-+			MainloopInterface( xmmsc_connection_t*& conn ) :
- 				running_( false ), conn_( conn ) { }
- 
- 			/** Destructor.  Should also stop the loop.

diff --git a/media-sound/xmms2/files/xmms2-0.8_p20161122-faad.patch b/media-sound/xmms2/files/xmms2-0.8_p20161122-faad.patch
deleted file mode 100644
index 2a206b913fe4..000000000000
--- a/media-sound/xmms2/files/xmms2-0.8_p20161122-faad.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-This line has stopped working since security fixes in the faad 2.9.0
-release. XMMS2 upstream were informed via IRC but have yet to act on
-it. I've run XMMS2 with this patch for months without issue.
-
--- Chewi
-
---- a/src/plugins/faad/faad.c
-+++ b/src/plugins/faad/faad.c
-@@ -242,7 +242,6 @@ xmms_faad_init (xmms_xform_t *xform)
- 	 * and durations calculations... So we cheat and tell libfaad2 we're feeding
- 	 * it frame 1.
- 	 */
--	NeAACDecPostSeekReset (data->decoder, 1);
- 
- 	/* FIXME: Because for HE AAC files some versions of libfaad return the wrong
- 	 * samplerate in init, we have to do one read and let it decide the real

diff --git a/media-sound/xmms2/files/xmms2-0.8_p20161122-mac-4.patch b/media-sound/xmms2/files/xmms2-0.8_p20161122-mac-4.patch
deleted file mode 100644
index 9785b4198d51..000000000000
--- a/media-sound/xmms2/files/xmms2-0.8_p20161122-mac-4.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-https://github.com/xmms2/xmms2-devel/pull/2
-
-From: Jérôme Carretero <cJ@zougloub.eu>
-Date: Tue, 24 Oct 2017 18:43:26 -0400
-Subject: [PATCH] plugins: mac: support newer mac API version
---- a/src/plugins/mac/mac.cpp
-+++ b/src/plugins/mac/mac.cpp
-@@ -210,8 +210,12 @@ xmms_mac_get_media_info (xmms_xform_t *xform)
- 				gchar *name;
- 
- 				field_name = pTagField->GetFieldName ();
--				name = (gchar *)GetUTF8FromUTF16 (field_name);
- 
-+#if MAC_DLL_INTERFACE_VERSION_NUMBER >= 1000
-+				name = (gchar *)CAPECharacterHelper::GetUTF8FromUTF16 (field_name);
-+#else
-+				name = (gchar *)GetUTF8FromUTF16 (field_name);
-+#endif
- 				memset (field_value, 0, 255);
- 				int size = 255;
- 				p_ape_tag->GetFieldString (field_name, (char *)field_value, &size, TRUE);
---- a/src/plugins/mac/source_adapter.h
-+++ b/src/plugins/mac/source_adapter.h
-@@ -38,7 +38,13 @@ public:
- 	~CSourceAdapter () {};
- 
- 	// open / close
--	int Open (const wchar_t * pName) { return ERROR_SUCCESS; }
-+#if MAC_DLL_INTERFACE_VERSION_NUMBER >= 1000
-+	int Open (const wchar_t * pName, BOOL bOpenReadOnly = FALSE)
-+#else
-+	int Open (const wchar_t * pName)
-+#endif
-+	{ return ERROR_SUCCESS; }
-+
- 	int Close () { return ERROR_SUCCESS; }
- 
- 	// read / write

diff --git a/media-sound/xmms2/files/xmms2-0.8_p20201016-ffmpeg5.patch b/media-sound/xmms2/files/xmms2-0.8_p20201016-ffmpeg5.patch
deleted file mode 100644
index b338e57cdfca..000000000000
--- a/media-sound/xmms2/files/xmms2-0.8_p20201016-ffmpeg5.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-Lazy migration from audio4 that's missing in ffmpeg5, may not be
-entirely right but tested to play at least .tta/.wma properly.
-
-https://github.com/xmms2/xmms2-devel/pull/11
-
-Bug: https://bugs.gentoo.org/834398
-Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
---- a/src/plugins/avcodec/avcodec.c
-+++ b/src/plugins/avcodec/avcodec.c
-@@ -32,4 +32,5 @@
- typedef struct {
- 	AVCodecContext *codecctx;
-+	AVPacket packet;
- 
- 	guchar *buffer;
-@@ -150,4 +151,5 @@
- 	data->buffer_size = AVCODEC_BUFFER_SIZE;
- 	data->codecctx = NULL;
-+	data->packet.size = 0;
- 
- 	data->read_out_frame = av_frame_alloc ();
-@@ -155,6 +157,4 @@
- 	xmms_xform_private_data_set (xform, data);
- 
--	avcodec_register_all ();
--
- 	mimetype = xmms_xform_indata_get_str (xform,
- 	                                      XMMS_STREAM_TYPE_MIMETYPE);
-@@ -467,43 +467,35 @@
- xmms_avcodec_internal_decode_some (xmms_avcodec_data_t *data)
- {
--	int got_frame = 0;
--	gint bytes_read = 0;
--	AVPacket packet;
-+	int rc = 0;
- 
--	av_init_packet (&packet);
--	packet.data = data->buffer;
--	packet.size = data->buffer_length;
--
--	/* clear buffers and reset fields to defaults */
--	av_frame_unref (data->read_out_frame);
--
--	bytes_read = avcodec_decode_audio4 (
--		data->codecctx, data->read_out_frame, &got_frame, &packet);
--
--	/* The DTS decoder of ffmpeg is buggy and always returns
--	 * the input buffer length, get frame length from header */
--	/* FIXME: Is ^^^^ still true? */
--	if (!strcmp (data->codec_id, "dca") && bytes_read > 0) {
--		bytes_read = ((int)data->buffer[5] << 12) |
--		             ((int)data->buffer[6] << 4) |
--		             ((int)data->buffer[7] >> 4);
--		bytes_read = (bytes_read & 0x3fff) + 1;
-+	if (data->packet.size == 0) {
-+		av_init_packet (&data->packet);
-+		data->packet.data = data->buffer;
-+		data->packet.size = data->buffer_length;
-+
-+		rc = avcodec_send_packet(data->codecctx, &data->packet);
-+		if (rc == AVERROR_EOF)
-+			rc = 0;
-+	}
-+
-+	if (rc == 0) {
-+		rc = avcodec_receive_frame(data->codecctx, data->read_out_frame);
-+		if (rc < 0) {
-+			data->packet.size = 0;
-+			data->buffer_length = 0;
-+			if (rc == AVERROR(EAGAIN)) rc = 0;
-+			else if (rc == AVERROR_EOF) rc = 1;
-+		}
-+		else
-+			rc = 1;
- 	}
- 
--	if (bytes_read < 0 || bytes_read > data->buffer_length) {
-+	if (rc < 0) {
-+		data->packet.size = 0;
- 		XMMS_DBG ("Error decoding data!");
- 		return -1;
- 	}
- 
--	if (bytes_read < data->buffer_length) {
--		data->buffer_length -= bytes_read;
--		g_memmove (data->buffer,
--		           data->buffer + bytes_read,
--		           data->buffer_length);
--	} else {
--		data->buffer_length = 0;
--	}
--
--	return got_frame ? 1 : 0;
-+	return rc;
- }
- 
---- a/src/plugins/avcodec/wscript
-+++ b/src/plugins/avcodec/wscript
-@@ -2,5 +2,5 @@
- 
- ## Code fragments for configuration
--avcodec_decode_audio4_fragment = """
-+avcodec_send_packet_fragment = """
- #ifdef HAVE_LIBAVCODEC_AVCODEC_H
- # include "libavcodec/avcodec.h"
-@@ -10,9 +10,7 @@
- int main(void) {
-     AVCodecContext *ctx;
--    AVFrame *frame;
--    int got_frame;
-     AVPacket *pkt;
- 
--    avcodec_decode_audio4 (ctx, frame, &got_frame, pkt);
-+    avcodec_send_packet (ctx, pkt);
- 
-     return 0;
-@@ -44,7 +42,7 @@
-     # * ffmpeg: commit e4de716, lavc 53.40.0, release 0.9
-     # * libav: commit 0eea212, lavc 53.25.0, release 0.8
--    conf.check_cc(fragment=avcodec_decode_audio4_fragment, uselib="avcodec",
--                  uselib_store="avcodec_decode_audio4",
--                  msg="Checking for function avcodec_decode_audio4", mandatory=True)
-+    conf.check_cc(fragment=avcodec_send_packet_fragment, uselib="avcodec",
-+                  uselib_store="avcodec_send_packet",
-+                  msg="Checking for function avcodec_send_packet", mandatory=True)
- 
-     # non-mandatory function avcodec_free_frame since

diff --git a/media-sound/xmms2/xmms2-0.8_p20201016-r2.ebuild b/media-sound/xmms2/xmms2-0.8_p20201016-r2.ebuild
deleted file mode 100644
index 0edb6f31cd7f..000000000000
--- a/media-sound/xmms2/xmms2-0.8_p20201016-r2.ebuild
+++ /dev/null
@@ -1,237 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-PYTHON_COMPAT=( python3_{8..10} )
-inherit multiprocessing optfeature perl-functions python-single-r1 toolchain-funcs
-
-XMMS2_COMMIT="46da10f0e20c53fd2b40843617ed182c0cba4ebb"
-S4_COMMIT="652ac581df7a0bca04334da397f8bb4f86eb7b59"
-WAF_VER="2.0.22"
-
-DESCRIPTION="X(cross)platform Music Multiplexing System, next generation of the XMMS player"
-HOMEPAGE="https://github.com/XMMS2"
-SRC_URI="
-	https://github.com/xmms2/xmms2-devel/archive/${XMMS2_COMMIT}.tar.gz -> ${P}.tar.gz
-	https://github.com/xmms2/s4/archive/${S4_COMMIT}.tar.gz -> ${PN}-s4-${PV}.tar.gz
-	https://waf.io/waf-${WAF_VER}.tar.bz2"
-S="${WORKDIR}/${PN}-devel-${XMMS2_COMMIT}"
-
-LICENSE="GPL-2+ LGPL-2.1+"
-SLOT="0"
-KEYWORDS="~alpha amd64 ~arm ppc ~riscv x86"
-
-# IUSE static map to be passed to --with-{optionals,plugins}=opt1,opt2,...
-# flag:opt = `usev flag opt`, opt = `usev opt`, :opt = `echo opt`
-XMMS2_OPTIONALS=(
-	cxx:xmmsclient++,xmmsclient++-glib :launcher mlib-update:medialib-updater
-	:nycli perl :pixmaps python server:s4 test:tests
-	# disabled: et,mdns,migrate-collections,ruby,sqlite2s4,vistest,xmmsclient-cf,xmmsclient-ecore
-)
-XMMS2_PLUGINS=(
-	aac:faad airplay alsa ao :asx cdda :cue curl :diskwrite :equalizer
-	ffmpeg:apefile,asf,avcodec,flv,tta :file flac fluidsynth:fluidsynth,mid1,midsquash
-	gme :html ices :icymetaint :id3v2 jack :karaoke :m3u mac +mad mms modplug
-	mp3:mpg123 :mp4 musepack :normalize :null :nulstripper ofa opus oss :pls
-	pulseaudio:pulse :replaygain samba sid sndfile speex tremor vocoder +vorbis
-	:wave wavpack :xml xml:rss,xspf zeroconf:daap
-	# disabled: coreaudio,gvfs,nms,sc68,sun,waveout
-)
-
-IUSE="
-	${XMMS2_OPTIONALS[@]%:*}
-	${XMMS2_PLUGINS[@]%:*}
-	+server valgrind"
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-RESTRICT="!test? ( test ) !server? ( test )"
-
-COMMON_DEPEND="
-	dev-libs/glib:2
-	sys-libs/readline:=
-	server? (
-		aac? ( media-libs/faad2 )
-		airplay? ( dev-libs/openssl:= )
-		alsa? ( media-libs/alsa-lib )
-		ao? ( media-libs/libao )
-		cdda? (
-			dev-libs/libcdio-paranoia:=
-			dev-libs/libcdio:=
-			media-libs/libdiscid
-		)
-		curl? ( net-misc/curl )
-		ffmpeg? ( media-video/ffmpeg:= )
-		flac? ( media-libs/flac )
-		fluidsynth? ( media-sound/fluidsynth:= )
-		gme? ( media-libs/game-music-emu )
-		ices? (
-			media-libs/libogg
-			media-libs/libshout
-			media-libs/libvorbis
-		)
-		jack? ( virtual/jack )
-		mac? ( media-sound/mac )
-		mad? ( media-libs/libmad )
-		mms? (
-			media-libs/libmms
-			media-video/ffmpeg:=
-		)
-		modplug? ( media-libs/libmodplug )
-		mp3? ( media-sound/mpg123 )
-		musepack? ( media-sound/musepack-tools )
-		ofa? (
-			dev-libs/expat
-			media-libs/libofa
-			sci-libs/fftw:3.0=
-		)
-		opus? (
-			media-libs/libogg
-			media-libs/opus
-			media-libs/opusfile
-		)
-		pulseaudio? ( media-sound/pulseaudio )
-		samba? ( net-fs/samba )
-		sid? ( media-libs/libsidplay:2 )
-		sndfile? ( media-libs/libsndfile )
-		speex? (
-			media-libs/libogg
-			media-libs/speex
-		)
-		tremor? ( media-libs/tremor )
-		vocoder? (
-			media-libs/libsamplerate
-			sci-libs/fftw:3.0=
-		)
-		vorbis? ( media-libs/libvorbis )
-		wavpack? ( media-sound/wavpack )
-		xml? ( dev-libs/libxml2 )
-		zeroconf? (
-			net-dns/avahi[mdnsresponder-compat]
-			net-misc/curl
-		)
-	)
-	python? ( virtual/libcrypt:= )"
-RDEPEND="
-	${COMMON_DEPEND}
-	perl? (
-		dev-lang/perl
-		dev-perl/glib-perl
-		virtual/perl-Carp
-		virtual/perl-IO
-		virtual/perl-Scalar-List-Utils
-	)
-	python? (
-		${PYTHON_DEPS}
-		$(python_gen_cond_dep 'dev-python/pygobject[${PYTHON_USEDEP}]')
-	)"
-DEPEND="
-	${COMMON_DEPEND}
-	cxx? ( dev-libs/boost )
-	test? ( dev-util/cunit )"
-BDEPEND="
-	${PYTHON_DEPS}
-	virtual/pkgconfig
-	perl? (	dev-perl/Pod-Parser )
-	python? ( $(python_gen_cond_dep 'dev-python/cython[${PYTHON_USEDEP}]') )
-	test? ( valgrind? ( dev-util/valgrind ) )"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-0.8-rtvg.patch
-	"${FILESDIR}"/${PN}-0.8_p20161122-mac-4.patch
-	"${FILESDIR}"/${PN}-0.8_p20161122-cpp-client.patch
-	"${FILESDIR}"/${PN}-0.8_p20161122-faad.patch
-	"${FILESDIR}"/${P}-ffmpeg5.patch
-)
-
-src_prepare() {
-	rmdir src/lib/s4 && mv ../s4-${S4_COMMIT} src/lib/s4 || die
-	mv ../waf-${WAF_VER}/waf{,lib} . || die
-
-	default
-
-	sed -e "s|/path/to/.*sf2|${EPREFIX}/usr/share/sounds/sf2/FluidR3_GM.sf2|" \
-		-i src/plugins/fluidsynth/fluidsynth.c || die
-}
-
-src_configure() {
-	local waf=(
-		./waf configure
-		--prefix="${EPREFIX}"/usr
-		--libdir="${EPREFIX}"/usr/$(get_libdir)
-		--boost-includes="${ESYSROOT}"/usr/include # needed for prefix
-		--with-custom-version="%(version)s (git commit: ${XMMS2_COMMIT:0:8})"
-		--with-target-platform="${CHOST}"
-	)
-
-	xmms2_flag() {
-		local IFS=:
-		set -- ${1#+}
-
-		if [[ ${1} ]]; then
-			usev ${1} ,${2:-${1}}
-		else
-			echo ,${2}
-		fi
-	}
-
-	local flag optionals plugins
-
-	if use server; then
-		for flag in "${XMMS2_PLUGINS[@]}"; do
-			plugins+=$(xmms2_flag ${flag})
-		done
-	else
-		waf+=( --without-xmms2d )
-	fi
-
-	for flag in "${XMMS2_OPTIONALS[@]}"; do
-		optionals+=$(xmms2_flag ${flag})
-	done
-
-	waf+=(
-		# pass even if empty to avoid automagic
-		--with-optionals=${optionals:1}
-		--with-plugins=${plugins:1}
-	)
-
-	if use perl; then
-		perl_set_version
-		waf+=( --with-perl-archdir="${ARCH_LIB}" )
-	fi
-
-	if use valgrind; then
-		if valgrind true &>/dev/null; then
-			waf+=( --with-valgrind )
-		else
-			ewarn "valgrind was disabled due to failing a basic sanity check" #807271
-		fi
-	fi
-
-	tc-export AR CC CXX
-
-	echo "${waf[*]}"
-	"${waf[@]}" || die
-}
-
-src_compile() {
-	./waf build -j$(makeopts_jobs) --verbose --notests || die
-}
-
-src_test() {
-	./waf --alltests || die
-}
-
-src_install() {
-	./waf install --destdir="${D}" --without-ldconfig --notests || die
-
-	einstalldocs
-
-	use python && python_optimize
-
-	# to avoid editing waftools/man.py (use find given not always installed)
-	find "${ED}" -name '*.gz' -exec gzip -d {} + || die
-}
-
-pkg_postinst() {
-	use fluidsynth && optfeature "the default MIDI soundfont" media-sound/fluid-soundfont
-}


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-sound/xmms2/files/, media-sound/xmms2/
@ 2024-11-18 23:37 Ionen Wolkens
  0 siblings, 0 replies; 12+ messages in thread
From: Ionen Wolkens @ 2024-11-18 23:37 UTC (permalink / raw
  To: gentoo-commits

commit:     5aca3e490b9eb281ad13d30f1e614aef46ede80e
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 18 22:55:47 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Mon Nov 18 22:56:11 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5aca3e49

media-sound/xmms2: backport c23 fixes for gcc15

Closes: https://bugs.gentoo.org/943862
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 media-sound/xmms2/files/xmms2-0.9.4-c23.patch | 33 +++++++++++++++++++++++++++
 media-sound/xmms2/xmms2-0.9.4.ebuild          |  1 +
 2 files changed, 34 insertions(+)

diff --git a/media-sound/xmms2/files/xmms2-0.9.4-c23.patch b/media-sound/xmms2/files/xmms2-0.9.4-c23.patch
new file mode 100644
index 000000000000..1f74cb4c4a0b
--- /dev/null
+++ b/media-sound/xmms2/files/xmms2-0.9.4-c23.patch
@@ -0,0 +1,33 @@
+https://bugs.gentoo.org/943862
+https://github.com/xmms2/xmms2-devel/commit/b6a6e8c20b
+https://github.com/xmms2/xmms2-devel/commit/fdf542b408
+https://github.com/xmms2/xmms2-devel/commit/5bd52ac2e5
+--- a/src/clients/lib/xmmsclient/service/client.c
++++ b/src/clients/lib/xmmsclient/service/client.c
+@@ -348,6 +348,6 @@
+ 	xmmsc_sc_interface_entity_t *ifent;
+ 
+-	x_api_error_if (!name, "with NULL name.", false);
+-	x_api_error_if (!validate_entity_name (name), "with invalid name", false);
++	x_api_error_if (!name, "with NULL name.", NULL);
++	x_api_error_if (!validate_entity_name (name), "with invalid name", NULL);
+ 
+ 	x_return_null_if_fail (parent);
+--- a/src/clients/lib/xmmsclient/visualization/unixshm.c
++++ b/src/clients/lib/xmmsclient/visualization/unixshm.c
+@@ -29,5 +29,5 @@
+ 	if (t->shmid == -1) {
+ 		c->error = strdup ("Couldn't create the shared memory!");
+-		return false;
++		return NULL;
+ 	}
+ 	/* attach early, so that the server doesn't think we aren't there */
+--- a/src/clients/lib/xmmsclient/xmmsclient.c
++++ b/src/clients/lib/xmmsclient/xmmsclient.c
+@@ -223,5 +223,5 @@
+ xmmsc_get_last_error (xmmsc_connection_t *c)
+ {
+-	x_api_error_if (!c, "with a NULL connection", false);
++	x_api_error_if (!c, "with a NULL connection", NULL);
+ 	return c->error;
+ }

diff --git a/media-sound/xmms2/xmms2-0.9.4.ebuild b/media-sound/xmms2/xmms2-0.9.4.ebuild
index 870046b6842d..a4011e18d871 100644
--- a/media-sound/xmms2/xmms2-0.9.4.ebuild
+++ b/media-sound/xmms2/xmms2-0.9.4.ebuild
@@ -133,6 +133,7 @@ QA_CONFIG_IMPL_DECL_SKIP=(
 PATCHES=(
 	"${FILESDIR}"/${PN}-0.9.1-cpp-client.patch
 	"${FILESDIR}"/${PN}-0.9.1-faad.patch
+	"${FILESDIR}"/${P}-c23.patch
 )
 
 src_prepare() {


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-11-18 23:37 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-06 19:35 [gentoo-commits] repo/gentoo:master commit in: media-sound/xmms2/files/, media-sound/xmms2/ Sergei Trofimovich
  -- strict thread matches above, loose matches on Subject: below --
2024-11-18 23:37 Ionen Wolkens
2022-06-02 15:07 Ionen Wolkens
2022-05-03  5:57 Ionen Wolkens
2022-03-16  3:42 Ionen Wolkens
2021-09-22 22:26 Ionen Wolkens
2017-07-30 22:16 Sergei Trofimovich
2017-05-20 10:21 Sergei Trofimovich
2016-04-02 14:45 Sergei Trofimovich
2016-04-02 10:43 Sergei Trofimovich
2016-04-02  9:06 Sergei Trofimovich
2015-11-27 23:15 Sergei Trofimovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox