# ChangeLog for media-libs/sdl-mixer
-# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-libs/sdl-mixer/ChangeLog,v 1.83 2011/12/09 21:16:44 tupone Exp $
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/sdl-mixer/ChangeLog,v 1.84 2012/01/02 21:39:19 mr_bones_ Exp $
+
+*sdl-mixer-1.2.11-r2 (02 Jan 2012)
+
+ 02 Jan 2012; Michael Sterrett <mr_bones_@gentoo.org>
+ +sdl-mixer-1.2.11-r2.ebuild, +files/sdl-mixer-1.2.11-midi.patch:
+ add upstream patch for playing some midi files (bug #397333)
09 Dec 2011; Tupone Alfredo <tupone@gentoo.org> sdl-mixer-1.2.11-r1.ebuild,
metadata.xml:
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
+AUX sdl-mixer-1.2.11-midi.patch 779 RMD160 aaeeb0e11e002f5648f6079943c2969cd668436a SHA1 8c2cf4d016781f317c328526ac6edff41b18d06f SHA256 267535c82e1e97f4407b02cf7a21c98a1f89fdd431a8698cffa69afacdd44ef5
AUX sdl-mixer-1.2.11-multilib.patch 1247 RMD160 76f4d4c32bcfd1367dda5e82816d5adc7ff9c1f4 SHA1 05fc2f40e177fd92c27f67a7661f273efca53169 SHA256 76ab56747d29bdae932394f8e501ce22f470096268e0b8cc63ea4335c837976c
DIST SDL_mixer-1.2.11.tar.gz 2690654 RMD160 559355116a1c380edf71879da0dbcf5359f05476 SHA1 ef5d45160babeb51eafa7e4019cec38324ee1a5d SHA256 86145ac39cac6d2c6169c226f937648dca5e89dcd828751763dd174fa9af9cf9
EBUILD sdl-mixer-1.2.11-r1.ebuild 1951 RMD160 ed55ecb18b9953302b1a13088539a7a4c5e342a3 SHA1 e2fd96ad1f66c58af006ebbef62850ac8de324c8 SHA256 7b43f2fb558ed816b37da24eb4d62346518ceb791a3eb67dee1c479631f68431
-MISC ChangeLog 10973 RMD160 36199f333b3246364c50443bdb8d81643daafe55 SHA1 f858596f7564b7f9158ef66e8640baf787835cb8 SHA256 fa44a51e6afd2bf1541d396df0eb0550fbf18d0cd7bda5212a788acda68aa1ce
+EBUILD sdl-mixer-1.2.11-r2.ebuild 2001 RMD160 00f8791f2c6db5d1f3758a60028bef62f832762d SHA1 e1ed9b39f3da70fb2be3c757cb5a031414dba5b6 SHA256 abee677cae29900fd4f72b379299367629ba25b4e0f68454c5891f4fb62c2ca8
+MISC ChangeLog 11198 RMD160 5c696331d5ebd1c362c57b8de4c9812311ff032d SHA1 981d48a86ab3ab61a15334fdb8f3f76a27a74234 SHA256 6180d0c15daabf2efc20925852dfa225c8002ec8127e56864ecee8600bb1c798
MISC metadata.xml 358 RMD160 0ca371404fcfabc51cd869a21a9942427c787a74 SHA1 a369c9d062d738d276e1a7c79892cfea918f706d SHA256 26734aaec72a5da02b2391dd99321c7eb65e9de1236165d0b5cafbad9d22bf18
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.18 (GNU/Linux)
-
-iEYEARECAAYFAk7iepsACgkQIY77eQFFFC3k8gCfZTsXoucxHRQy7uqwKwuFYvJ/
-DGcAnRpQojLRHKZbdiK031QADkTPk6+C
-=oeKO
------END PGP SIGNATURE-----
--- /dev/null
+For bug 397333
+https://bugs.gentoo.org/show_bug.cgi?id=397333
+
+upstream patch pulled from:
+http://hg.libsdl.org/SDL_mixer/raw-diff/7a8f0018e23d/timidity/readmidi.c
+
+--- a/timidity/readmidi.c
++++ b/timidity/readmidi.c
+@@ -530,7 +530,7 @@
+ {
+ MidiEventList *meep;
+ MidiEventList *next, *new;
+- int32 len;
++ int32 len, next_pos, pos;
+ char tmp[4];
+
+ meep=evlist;
+@@ -552,7 +552,7 @@
+ return -1;
+ }
+ len=BE_LONG(len);
+-
++ next_pos = SDL_RWtell(rw) + len;
+ if (memcmp(tmp, "MTrk", 4))
+ {
+ ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
+@@ -567,6 +567,9 @@
+
+ if (new==MAGIC_EOT) /* End-of-track Hack. */
+ {
++ pos = SDL_RWtell(rw);
++ if (pos < next_pos)
++ SDL_RWseek(rw, next_pos - pos, RW_SEEK_CUR);
+ return 0;
+ }
+
+
+
+
+
--- /dev/null
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/sdl-mixer/sdl-mixer-1.2.11-r2.ebuild,v 1.1 2012/01/02 21:39:18 mr_bones_ Exp $
+
+EAPI=2
+inherit eutils
+
+MY_P=${P/sdl-/SDL_}
+DESCRIPTION="Simple Direct Media Layer Mixer Library"
+HOMEPAGE="http://www.libsdl.org/projects/SDL_mixer/"
+SRC_URI="http://www.libsdl.org/projects/SDL_mixer/release/${MY_P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-solaris"
+IUSE="flac mad +midi mikmod mp3 playtools static-libs timidity vorbis +wav"
+
+DEPEND=">=media-libs/libsdl-1.2.10
+ flac? ( media-libs/flac )
+ timidity? ( media-sound/timidity++ )
+ mad? ( media-libs/libmad )
+ !mad? ( mp3? ( >=media-libs/smpeg-0.4.4-r1 ) )
+ vorbis? ( >=media-libs/libvorbis-1.0_beta4 media-libs/libogg )
+ mikmod? ( >=media-libs/libmikmod-3.1.10 )"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-multilib.patch \
+ "${FILESDIR}"/${P}-midi.patch
+}
+
+src_configure() {
+ econf \
+ --disable-dependency-tracking \
+ --disable-music-mod-shared \
+ --disable-music-ogg-shared \
+ --disable-music-flac-shared \
+ --disable-music-mp3-shared \
+ $(use_enable wav music-wave) \
+ $(use_enable midi music-midi) \
+ $(use_enable timidity music-timidity-midi) \
+ $(use_enable mikmod music-mod) \
+ $(use_enable vorbis music-ogg) \
+ $(use_enable flac music-flac) \
+ $(use_enable static-libs static) \
+ $(use mad && echo --disable-music-mp3 || use_enable mp3 music-mp3) \
+ $(use_enable mad music-mp3-mad-gpl)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "make install failed"
+ if use playtools; then
+ emake DESTDIR="${D}" install-bin || die "make install-bin failed"
+ fi
+ dodoc CHANGES README
+ if ! use static-libs ; then
+ find "${D}" -type f -name '*.la' -exec rm {} + \
+ || die "la removal failed"
+ fi
+}