diff options
author | Pacho Ramos <pacho@gentoo.org> | 2014-07-07 12:43:45 +0000 |
---|---|---|
committer | Pacho Ramos <pacho@gentoo.org> | 2014-07-07 12:43:45 +0000 |
commit | 8c4e89b0d56f87864bad4083c66b1926d2a84c6b (patch) | |
tree | 502a7dd500d8daba84473c4f67810def55015162 /media-libs | |
parent | elt/aixrtl: need semicolon after noop command to get subsequent variable set (diff) | |
download | gentoo-2-8c4e89b0d56f87864bad4083c66b1926d2a84c6b.tar.gz gentoo-2-8c4e89b0d56f87864bad4083c66b1926d2a84c6b.tar.bz2 gentoo-2-8c4e89b0d56f87864bad4083c66b1926d2a84c6b.zip |
Apply some upstream patches fixing important bugs like an accidental ABI breakage (#516342#c1 by CT)
(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key A188FBD4)
Diffstat (limited to 'media-libs')
-rw-r--r-- | media-libs/taglib/ChangeLog | 12 | ||||
-rw-r--r-- | media-libs/taglib/files/taglib-1.9.1-abi-breakage.patch | 107 | ||||
-rw-r--r-- | media-libs/taglib/files/taglib-1.9.1-bytevector-simpler.patch | 131 | ||||
-rw-r--r-- | media-libs/taglib/files/taglib-1.9.1-missing-deletes.patch | 48 | ||||
-rw-r--r-- | media-libs/taglib/files/taglib-1.9.1-order-big-endian.patch | 33 | ||||
-rw-r--r-- | media-libs/taglib/taglib-1.9.1-r2.ebuild | 66 |
6 files changed, 396 insertions, 1 deletions
diff --git a/media-libs/taglib/ChangeLog b/media-libs/taglib/ChangeLog index 42d41fad5d66..34255f508cd6 100644 --- a/media-libs/taglib/ChangeLog +++ b/media-libs/taglib/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for media-libs/taglib # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-libs/taglib/ChangeLog,v 1.150 2014/06/18 19:58:34 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-libs/taglib/ChangeLog,v 1.151 2014/07/07 12:43:45 pacho Exp $ + +*taglib-1.9.1-r2 (07 Jul 2014) + + 07 Jul 2014; Pacho Ramos <pacho@gentoo.org> + +files/taglib-1.9.1-abi-breakage.patch, + +files/taglib-1.9.1-bytevector-simpler.patch, + +files/taglib-1.9.1-missing-deletes.patch, + +files/taglib-1.9.1-order-big-endian.patch, +taglib-1.9.1-r2.ebuild: + Apply some upstream patches fixing important bugs like an accidental ABI + breakage (#516342#c1 by CT) 18 Jun 2014; Michał Górny <mgorny@gentoo.org> taglib-1.9.1-r1.ebuild: Update dependencies to require guaranteed EAPI=5 or multilib ebuilds, bug diff --git a/media-libs/taglib/files/taglib-1.9.1-abi-breakage.patch b/media-libs/taglib/files/taglib-1.9.1-abi-breakage.patch new file mode 100644 index 000000000000..930439fc8349 --- /dev/null +++ b/media-libs/taglib/files/taglib-1.9.1-abi-breakage.patch @@ -0,0 +1,107 @@ +From 3bf30af66c8fd77a88d9379a0956ddb2fc70dc20 Mon Sep 17 00:00:00 2001 +From: Tsuda Kageyu <tsuda.kageyu@gmail.com> +Date: Wed, 6 Nov 2013 17:01:21 +0900 +Subject: [PATCH 2/6] Fixed ABI breakage in TagLib::String + +--- + taglib/toolkit/tstring.cpp | 20 ++++++++++++++++++-- + taglib/toolkit/tstring.h | 12 ++++++++++-- + tests/test_string.cpp | 14 ++++++++++++++ + 3 files changed, 42 insertions(+), 4 deletions(-) + +diff --git a/taglib/toolkit/tstring.cpp b/taglib/toolkit/tstring.cpp +index 75a9833..fb6e947 100644 +--- a/taglib/toolkit/tstring.cpp ++++ b/taglib/toolkit/tstring.cpp +@@ -209,8 +209,16 @@ String::String(const std::string &s, Type t) + String::String(const wstring &s, Type t) + : d(new StringPrivate()) + { +- if(t == UTF16 || t == UTF16BE || t == UTF16LE) ++ if(t == UTF16 || t == UTF16BE || t == UTF16LE) { ++ // This looks ugly but needed for the compatibility with TagLib1.8. ++ // Should be removed in TabLib2.0. ++ if (t == UTF16BE) ++ t = WCharByteOrder; ++ else if (t == UTF16LE) ++ t = (WCharByteOrder == UTF16LE ? UTF16BE : UTF16LE); ++ + copyFromUTF16(s.c_str(), s.length(), t); ++ } + else { + debug("String::String() -- A TagLib::wstring should not contain Latin1 or UTF-8."); + } +@@ -219,8 +227,16 @@ String::String(const wstring &s, Type t) + String::String(const wchar_t *s, Type t) + : d(new StringPrivate()) + { +- if(t == UTF16 || t == UTF16BE || t == UTF16LE) ++ if(t == UTF16 || t == UTF16BE || t == UTF16LE) { ++ // This looks ugly but needed for the compatibility with TagLib1.8. ++ // Should be removed in TabLib2.0. ++ if (t == UTF16BE) ++ t = WCharByteOrder; ++ else if (t == UTF16LE) ++ t = (WCharByteOrder == UTF16LE ? UTF16BE : UTF16LE); ++ + copyFromUTF16(s, ::wcslen(s), t); ++ } + else { + debug("String::String() -- A const wchar_t * should not contain Latin1 or UTF-8."); + } +diff --git a/taglib/toolkit/tstring.h b/taglib/toolkit/tstring.h +index 57945be..605b9c2 100644 +--- a/taglib/toolkit/tstring.h ++++ b/taglib/toolkit/tstring.h +@@ -134,13 +134,21 @@ namespace TagLib { + + /*! + * Makes a deep copy of the data in \a s. ++ * ++ * /note If \a t is UTF16LE, the byte order of \a s will be swapped regardless ++ * of the CPU byte order. If UTF16BE, it will not be swapped. This behavior ++ * will be changed in TagLib2.0. + */ +- String(const wstring &s, Type t = WCharByteOrder); ++ String(const wstring &s, Type t = UTF16BE); + + /*! + * Makes a deep copy of the data in \a s. ++ * ++ * /note If \a t is UTF16LE, the byte order of \a s will be swapped regardless ++ * of the CPU byte order. If UTF16BE, it will not be swapped. This behavior ++ * will be changed in TagLib2.0. + */ +- String(const wchar_t *s, Type t = WCharByteOrder); ++ String(const wchar_t *s, Type t = UTF16BE); + + /*! + * Makes a deep copy of the data in \a c. +diff --git a/tests/test_string.cpp b/tests/test_string.cpp +index a815a0b..9a574b3 100644 +--- a/tests/test_string.cpp ++++ b/tests/test_string.cpp +@@ -75,6 +75,20 @@ public: + String unicode3(L"\u65E5\u672C\u8A9E"); + CPPUNIT_ASSERT(*(unicode3.toCWString() + 1) == L'\u672C'); + ++ String unicode4(L"\u65e5\u672c\u8a9e", String::UTF16BE); ++ CPPUNIT_ASSERT(unicode4[1] == L'\u672c'); ++ ++ String unicode5(L"\u65e5\u672c\u8a9e", String::UTF16LE); ++ CPPUNIT_ASSERT(unicode5[1] == L'\u2c67'); ++ ++ wstring stduni = L"\u65e5\u672c\u8a9e"; ++ ++ String unicode6(stduni, String::UTF16BE); ++ CPPUNIT_ASSERT(unicode6[1] == L'\u672c'); ++ ++ String unicode7(stduni, String::UTF16LE); ++ CPPUNIT_ASSERT(unicode7[1] == L'\u2c67'); ++ + CPPUNIT_ASSERT(strcmp(String::number(0).toCString(), "0") == 0); + CPPUNIT_ASSERT(strcmp(String::number(12345678).toCString(), "12345678") == 0); + CPPUNIT_ASSERT(strcmp(String::number(-12345678).toCString(), "-12345678") == 0); +-- +1.8.4.2 + diff --git a/media-libs/taglib/files/taglib-1.9.1-bytevector-simpler.patch b/media-libs/taglib/files/taglib-1.9.1-bytevector-simpler.patch new file mode 100644 index 000000000000..0b134ec82215 --- /dev/null +++ b/media-libs/taglib/files/taglib-1.9.1-bytevector-simpler.patch @@ -0,0 +1,131 @@ +From 4a7d31c87bf41c1de21cb725176d5b34c2a95720 Mon Sep 17 00:00:00 2001 +From: Tsuda Kageyu <tsuda.kageyu@gmail.com> +Date: Thu, 14 Nov 2013 14:05:32 +0900 +Subject: [PATCH 3/6] Rewrote ByteVector::replace() simpler + +--- + taglib/toolkit/tbytevector.cpp | 77 +++++++++++++++--------------------------- + tests/test_bytevector.cpp | 5 +++ + 2 files changed, 33 insertions(+), 49 deletions(-) + +diff --git a/taglib/toolkit/tbytevector.cpp b/taglib/toolkit/tbytevector.cpp +index b658246..566a20f 100644 +--- a/taglib/toolkit/tbytevector.cpp ++++ b/taglib/toolkit/tbytevector.cpp +@@ -31,6 +31,7 @@ + #include <iostream> + #include <cstdio> + #include <cstring> ++#include <cstddef> + + #include <tstring.h> + #include <tdebug.h> +@@ -508,62 +509,40 @@ ByteVector &ByteVector::replace(const ByteVector &pattern, const ByteVector &wit + if(pattern.size() == 0 || pattern.size() > size()) + return *this; + +- const uint withSize = with.size(); +- const uint patternSize = pattern.size(); +- int offset = 0; ++ const size_t withSize = with.size(); ++ const size_t patternSize = pattern.size(); ++ const ptrdiff_t diff = withSize - patternSize; ++ ++ size_t offset = 0; ++ while (true) ++ { ++ offset = find(pattern, offset); ++ if(offset == static_cast<size_t>(-1)) // Use npos in taglib2. ++ break; + +- if(withSize == patternSize) { +- // I think this case might be common enough to optimize it + detach(); +- offset = find(pattern); +- while(offset >= 0) { +- ::memcpy(data() + offset, with.data(), withSize); +- offset = find(pattern, offset + withSize); +- } +- return *this; +- } + +- // calculate new size: +- uint newSize = 0; +- for(;;) { +- int next = find(pattern, offset); +- if(next < 0) { +- if(offset == 0) +- // pattern not found, do nothing: +- return *this; +- newSize += size() - offset; +- break; ++ if(diff < 0) { ++ ::memmove( ++ data() + offset + withSize, ++ data() + offset + patternSize, ++ size() - offset - patternSize); ++ resize(size() + diff); + } +- newSize += (next - offset) + withSize; +- offset = next + patternSize; +- } +- +- // new private data of appropriate size: +- ByteVectorPrivate *newData = new ByteVectorPrivate(newSize, 0); +- char *target = DATA(newData); +- const char *source = data(); +- +- // copy modified data into new private data: +- offset = 0; +- for(;;) { +- int next = find(pattern, offset); +- if(next < 0) { +- ::memcpy(target, source + offset, size() - offset); +- break; ++ else if(diff > 0) { ++ resize(size() + diff); ++ ::memmove( ++ data() + offset + withSize, ++ data() + offset + patternSize, ++ size() - diff - offset - patternSize); + } +- int chunkSize = next - offset; +- ::memcpy(target, source + offset, chunkSize); +- target += chunkSize; +- ::memcpy(target, with.data(), withSize); +- target += withSize; +- offset += chunkSize + patternSize; +- } + +- // replace private data: +- if(d->deref()) +- delete d; ++ ::memcpy(data() + offset, with.data(), with.size()); + +- d = newData; ++ offset += withSize; ++ if(offset > size() - patternSize) ++ break; ++ } + + return *this; + } +diff --git a/tests/test_bytevector.cpp b/tests/test_bytevector.cpp +index 9efd23a..eca74f8 100644 +--- a/tests/test_bytevector.cpp ++++ b/tests/test_bytevector.cpp +@@ -239,6 +239,11 @@ public: + a.replace(ByteVector("ab"), ByteVector()); + CPPUNIT_ASSERT_EQUAL(ByteVector("cdf"), a); + } ++ { ++ ByteVector a("abcdabf"); ++ a.replace(ByteVector("bf"), ByteVector("x")); ++ CPPUNIT_ASSERT_EQUAL(ByteVector("abcdax"), a); ++ } + } + + }; +-- +1.8.4.2 + diff --git a/media-libs/taglib/files/taglib-1.9.1-missing-deletes.patch b/media-libs/taglib/files/taglib-1.9.1-missing-deletes.patch new file mode 100644 index 000000000000..9cdbdcf00fbd --- /dev/null +++ b/media-libs/taglib/files/taglib-1.9.1-missing-deletes.patch @@ -0,0 +1,48 @@ +From c14a3b5c3d0831f7c113d0cf95840c4671d9ebd4 Mon Sep 17 00:00:00 2001 +From: Tsuda Kageyu <tsuda.kageyu@gmail.com> +Date: Tue, 13 May 2014 20:07:02 +0900 +Subject: [PATCH] Added some missing deletes to test_flac.cpp. + +--- + tests/test_flac.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/tests/test_flac.cpp b/tests/test_flac.cpp +index caec715..364fb11 100644 +--- a/tests/test_flac.cpp ++++ b/tests/test_flac.cpp +@@ -91,6 +91,7 @@ public: + newpic->setData("JPEG data"); + f->addPicture(newpic); + f->save(); ++ delete f; + + f = new FLAC::File(newname.c_str()); + lst = f->pictureList(); +@@ -138,6 +139,7 @@ public: + f->removePictures(); + f->addPicture(newpic); + f->save(); ++ delete f; + + f = new FLAC::File(newname.c_str()); + lst = f->pictureList(); +@@ -165,6 +167,7 @@ public: + + f->removePictures(); + f->save(); ++ delete f; + + f = new FLAC::File(newname.c_str()); + lst = f->pictureList(); +@@ -185,6 +188,7 @@ public: + tag->setTitle("NEW TITLE 2"); + f->save(); + CPPUNIT_ASSERT_EQUAL(String("NEW TITLE 2"), tag->title()); ++ delete f; + + f = new FLAC::File(newname.c_str()); + tag = f->tag(); +-- +1.9.0 + diff --git a/media-libs/taglib/files/taglib-1.9.1-order-big-endian.patch b/media-libs/taglib/files/taglib-1.9.1-order-big-endian.patch new file mode 100644 index 000000000000..86d5201e54d4 --- /dev/null +++ b/media-libs/taglib/files/taglib-1.9.1-order-big-endian.patch @@ -0,0 +1,33 @@ +From db3e961d1098d5efe57364f540f68a5996dc83c2 Mon Sep 17 00:00:00 2001 +From: Tsuda Kageyu <tsuda.kageyu@gmail.com> +Date: Tue, 13 May 2014 18:22:16 +0900 +Subject: [PATCH] Fixed a wrong byte order handling on big-endian machines. + +--- + taglib/toolkit/tstring.cpp | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/taglib/toolkit/tstring.cpp b/taglib/toolkit/tstring.cpp +index 603455a..1ec083b 100644 +--- a/taglib/toolkit/tstring.cpp ++++ b/taglib/toolkit/tstring.cpp +@@ -47,10 +47,14 @@ + + namespace + { +- + inline unsigned short combine(unsigned char c1, unsigned char c2) + { +- return (c1 << 8) | c2; ++ using namespace TagLib::Utils; ++ ++ if(SystemByteOrder == LittleEndian) ++ return (c1 << 8) | c2; ++ else ++ return (c2 << 8) | c1; + } + + void UTF16toUTF8(const wchar_t *src, size_t srcLength, char *dst, size_t dstLength) +-- +1.9.0 + diff --git a/media-libs/taglib/taglib-1.9.1-r2.ebuild b/media-libs/taglib/taglib-1.9.1-r2.ebuild new file mode 100644 index 000000000000..12ee2c33efe1 --- /dev/null +++ b/media-libs/taglib/taglib-1.9.1-r2.ebuild @@ -0,0 +1,66 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-libs/taglib/taglib-1.9.1-r2.ebuild,v 1.1 2014/07/07 12:43:45 pacho Exp $ + +EAPI=5 + +inherit cmake-multilib + +DESCRIPTION="A library for reading and editing audio meta data" +HOMEPAGE="http://developer.kde.org/~wheeler/taglib.html" +SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="LGPL-2.1 MPL-1.1" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x86-solaris" +SLOT="0" +IUSE="+asf debug examples +mp4 test" + +RDEPEND=">=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]" +DEPEND="${RDEPEND} + >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] + test? ( >=dev-util/cppunit-1.13.2[${MULTILIB_USEDEP}] ) +" +RDEPEND="${RDEPEND} + abi_x86_32? ( !<=app-emulation/emul-linux-x86-medialibs-20140508-r2 + !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)] )" + +PATCHES=( + "${FILESDIR}"/${PN}-1.6.1-install-examples.patch + "${FILESDIR}"/${P}-missing-deletes.patch + "${FILESDIR}"/${P}-order-big-endian.patch + "${FILESDIR}"/${P}-abi-breakage.patch + "${FILESDIR}"/${P}-bytevector-simpler.patch +) + +DOCS=( AUTHORS NEWS ) + +MULTILIB_CHOST_TOOLS=( + /usr/bin/taglib-config +) + +multilib_src_configure() { + mycmakeargs=( + $(multilib_is_native_abi && cmake-utils_use_build examples) + $(cmake-utils_use_build test TESTS) + $(cmake-utils_use_with asf) + $(cmake-utils_use_with mp4) + ) + + cmake-utils_src_configure +} + +multilib_src_test() { + # ctest does not work + emake -C "${BUILD_DIR}" check +} + +pkg_postinst() { + if ! use asf; then + elog "You've chosen to disable the asf use flag, thus taglib won't include" + elog "support for Microsoft's 'advanced systems format' media container" + fi + if ! use mp4; then + elog "You've chosen to disable the mp4 use flag, thus taglib won't include" + elog "support for the MPEG-4 part 14 / MP4 media container" + fi +} |