summaryrefslogtreecommitdiffstats
path: root/media-libs
diff options
context:
space:
mode:
Diffstat (limited to 'media-libs')
-rw-r--r--media-libs/taglib/Manifest5
-rw-r--r--media-libs/taglib/files/taglib-1.11-ds-rusxmms.patch684
-rw-r--r--media-libs/taglib/files/taglib-1.11-install-examples.patch13
-rw-r--r--media-libs/taglib/files/taglib-1.11.1_p20181028-version-1.11.2.patch11
-rw-r--r--media-libs/taglib/taglib-1.11.1_p20181028-r1.ebuild66
5 files changed, 779 insertions, 0 deletions
diff --git a/media-libs/taglib/Manifest b/media-libs/taglib/Manifest
index 011a10b..65efcc1 100644
--- a/media-libs/taglib/Manifest
+++ b/media-libs/taglib/Manifest
@@ -1,4 +1,7 @@
AUX taglib-1.10-ds-rusxmms.patch 41838 BLAKE2B 9cdfdf376f08a916bfafd603fe1fb3fb89dd618cc08360cd4d35183e346acab23b24acd393e3249c9c08353e7afe988e4ec0d16bb452ba3ec45a91deb8b43dc6 SHA512 24be668fc9754bba3b39c22b842557176ddc1c964fd6493405838911dc8db6317f610a4ee4fc95a3404904f4512b41a0fee826f64ed9c1eda85192dea6880b64
+AUX taglib-1.11-ds-rusxmms.patch 23162 BLAKE2B 3034dcf046141bb59d35aaed3309a2a031389910a8d510ce0c66b2f65ee88bab389296f0147272e991ec8a8496e0b434249f88da4b583c19e48b332faff2a8ba SHA512 92b469efc5c9310e9debf0951e8d689ce848f28757aa572163b167392259025e12c800167be35f45f40332acc8ae4107d5f02528faf0bb311d31031713abaec0
+AUX taglib-1.11-install-examples.patch 371 BLAKE2B ee42b80e8c6093dbfc4c89c25bcb6bd25e2f5152c14743fa49c6c44a14f93a961f08a4d53337efe0800d98126a8aa58627a330e19386283cc16d8f20c9637262 SHA512 149ce1256ec557ee1e896b56e361f2fcf69633424f9b125666827eda610e84c35bf28e5c3fe5f38d4d87f1eacf977fc5b8b8c2d9c6634997bfe4e4bac122fc37
+AUX taglib-1.11.1_p20181028-version-1.11.2.patch 486 BLAKE2B a0b9021a01268eaeb32cb7a6b333b54df522aaf9d07d9b89870f0dbc38a9648ab9173a916bd8a29537b454631be5cd32c2dfb256ebf2f2b86000fec8d2f32bb6 SHA512 e5c3d814ae7c4b2cb84eded86e909d2db985ec21409767a9bdd502d562b55edf30c74834e2829199f1fd20ca8b1dab832a78b05246ae82fe6ff94cb1266d98d0
AUX taglib-1.6.1-install-examples.patch 581 BLAKE2B 65bc122295b1c28a59a56db7bb9894ee0b6ad6a74083bd5417cd098d5b87f47b4437684a556db311859f6439996451046328e2ada3c43ab3259d62b970e778ff SHA512 8af5b52b33c82f0d4961ad3ef0cd72844f84f442db2638ba0187ba808257e7d0602bc5f9c643252c7217d3119b1dd5a6fbf5f84a364f72c1d9154812b14e383b
AUX taglib-1.9.1-abi-breakage.patch 3888 BLAKE2B 928c61111a3f45dfc6383bf53c3411cfb9ca6851401cd410231b97d4e7a60eb05616a8995e89d8b6e87cb48bf23a7a3cde2e8334ff4af7e529d44f2effecc0f6 SHA512 ec17447f97d83482fbf7fbafd99014344c638436fbadab2144a19679869603106e0f21cdfb738cf77743eb3230d244a81ed93d1bbf62efa1a8a3484d9e43e90b
AUX taglib-1.9.1-bytevector-simpler.patch 3685 BLAKE2B 38018145649747dbf8ffa44dd6eadc86a162d0bedba5d7ab1603cab9cab938efec2015b53841ecdb83b67dc8bf620c19d0052bf82bd19cd3ff130f2ce593b53f SHA512 1d19d40766e8cb74cb60d5b13fb509c56ee1b0d10f622bfea954bbaf2c5a4908c81e026dc07e83764034647818eb875c71a505a6e1425c9d03820d8e0a3a4a11
@@ -6,5 +9,7 @@ AUX taglib-1.9.1-ds-rusxmms-enforce.patch 844 BLAKE2B 3e6fb11c828f6e6860ababcf52
AUX taglib-1.9.1-ds-rusxmms.patch 21026 BLAKE2B 8d92aa3990dcae0c170d60746927e3c581ca2807e512d321f30bc6218667a652a64ef5395d657c6bc635ecc9b26a52865e9fbf09a69455c4f5826f8f48875f29 SHA512 7578e03a6d14c5f09cfd492ddd342f6ea36fd8819e59298f374aefb1be81ec7d2d07b3b8579be8580a3e49060e798f7b34d00324224ad73f8f22baf01a1d480b
AUX taglib-1.9.1-missing-deletes.patch 1194 BLAKE2B 4559e86ea704f16d58e0e5e671c6f35f2062febfa7287a7abfef1eace5fc49f42db2a79d4895b4f7f05a5ec202dfee39876d18ca326d59aef3d47276bfdddf23 SHA512 1cc2796401dc1291b19245bd9a6bde9d77549d7ddab96b99b8e0f95c331a1ba7296f7107bd99f6f789cd04dd412d6e330db099ab49344c4dd1a10ccfef203fd1
AUX taglib-1.9.1-order-big-endian.patch 884 BLAKE2B 9382802fe5bb4d2cf20a5a075ffeb5200b2cec5acfe33eb68031a80b7a1718c7578fe9f091f29be61a13bc7a3ec3ee87f1a54033ab271c56f3cf98de74e71263 SHA512 4f2c751f03e976da64fc1480e369443d724c420198600ae1a5e9e9cab3172289c73d15b66ec0c95165da30e52dff1d956314fd71fb067e10a11c350566671bd3
+DIST taglib-1.11.1_p20181028.tar.gz 1299993 BLAKE2B d281873a87742ba417ea764bb01f9a4c5553a4624d2c257dd82bbb2f0b7e3103ab6ca253f78c0167908f449aac833873ca1cce6f24b1eb5f608131382833262a SHA512 e26439b65ab579455f79e87a94c33a98e17209b31a19b531e5964a2c0ded395c35067655e31ad22b6205149e2e920d7bd145993f064d3ad13e1de8a9f7e37256
DIST taglib-1.9.1.tar.gz 654074 BLAKE2B ce8384a9cc8ddfe93c0b24c695963ed43f70366931eb1f1748d5cb92eac08833154fbd5a05307154581854b4a59a414846a0e411722d56330d1bc51695d2be31 SHA512 17523b7ebdd089520289ae817b07f291be93fd0b9d3b2891eb4860a24e45943e94d25b99250c1ac477de5e51b08c39887ca13fdcc2dce17867eb60d1edb26154
+EBUILD taglib-1.11.1_p20181028-r1.ebuild 1581 BLAKE2B e52944a0cd801ba68626f1c6ca167ecb87b6d1eb79f7e3aa28514dbd2e6f32f47dc4ea1ba2e94bef0680b8b777f58e03455c98d712902431b3716cea15ab1742 SHA512 0995fbfaf6d5ecdd7c33c524ba6ac40d9bc5914b0aae4df1d5fd5cd36a26db61dbdac1e3c5046526f2c49f2323ecd8a03fb619e11b55d1c7369c293196714e9b
EBUILD taglib-1.9.1-r4.ebuild 2264 BLAKE2B 35ded2500e55ca37a3f84ca558222ac29ad6238fd58275e227f64e1a155aee393a3be5e74c8300a8e7182dbbb0ff36ad4d4536254375cdd4a22959acdf4c4964 SHA512 c1e08587ccec0cbe95624d12906f8cbb6f6eb1fdb9d248b8b3e951f58015ba30565d9b710395f434312cab09c44d532144e2abadc8cf3d03dbab2208d9066ae3
diff --git a/media-libs/taglib/files/taglib-1.11-ds-rusxmms.patch b/media-libs/taglib/files/taglib-1.11-ds-rusxmms.patch
new file mode 100644
index 0000000..9f777c8
--- /dev/null
+++ b/media-libs/taglib/files/taglib-1.11-ds-rusxmms.patch
@@ -0,0 +1,684 @@
+diff -dPNur taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c/config.h.cmake taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c-ds/config.h.cmake
+--- taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c/config.h.cmake 2018-10-28 14:43:45.000000000 +0100
++++ taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c-ds/config.h.cmake 2019-09-01 08:32:29.569443643 +0200
+@@ -30,6 +30,9 @@
+ /* Indicates whether debug messages are shown even in release mode */
+ #cmakedefine TRACE_IN_RELEASE 1
+
++/* Defined if you have LibRCC from RusXMMS project */
++#cmakedefine HAVE_LIBRCC 1
++
+ #cmakedefine TESTS_DIR "@TESTS_DIR@"
+
+ #endif
+diff -dPNur taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c/ConfigureChecks.cmake taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c-ds/ConfigureChecks.cmake
+--- taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c/ConfigureChecks.cmake 2018-10-28 14:43:45.000000000 +0100
++++ taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c-ds/ConfigureChecks.cmake 2019-09-01 08:32:29.577443787 +0200
+@@ -213,3 +213,5 @@
+ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+ set(PLATFORM WINRT 1)
+ endif()
++
++SET(HAVE_LIBRCC 1)
+\ No newline at end of file
+diff -dPNur taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c/examples/tagreader_c.c taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c-ds/examples/tagreader_c.c
+--- taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c/examples/tagreader_c.c 2018-10-28 14:43:45.000000000 +0100
++++ taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c-ds/examples/tagreader_c.c 2019-09-01 08:32:29.577443787 +0200
+@@ -38,7 +38,7 @@
+ TagLib_Tag *tag;
+ const TagLib_AudioProperties *properties;
+
+- taglib_set_strings_unicode(FALSE);
++ //taglib_set_strings_unicode(FALSE);
+
+ for(i = 1; i < argc; i++) {
+ printf("******************** \"%s\" ********************\n", argv[i]);
+diff -dPNur taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c/examples/tagwriter.cpp taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c-ds/examples/tagwriter.cpp
+--- taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c/examples/tagwriter.cpp 2018-10-28 14:43:45.000000000 +0100
++++ taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c-ds/examples/tagwriter.cpp 2019-09-01 08:32:29.577443787 +0200
+@@ -115,7 +115,7 @@
+ if(isArgument(argv[i]) && i + 1 < argc && !isArgument(argv[i + 1])) {
+
+ char field = argv[i][1];
+- TagLib::String value = argv[i + 1];
++ TagLib::String value(argv[i + 1], TagLib::String::Locale);
+
+ TagLib::List<TagLib::FileRef>::ConstIterator it;
+ for(it = fileList.begin(); it != fileList.end(); ++it) {
+diff -dPNur taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c/taglib/CMakeLists.txt taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c-ds/taglib/CMakeLists.txt
+--- taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c/taglib/CMakeLists.txt 2018-10-28 14:43:45.000000000 +0100
++++ taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c-ds/taglib/CMakeLists.txt 2019-09-01 08:32:29.577443787 +0200
+@@ -41,6 +41,7 @@
+ audioproperties.h
+ taglib_export.h
+ ${CMAKE_CURRENT_BINARY_DIR}/../taglib_config.h
++ toolkit/rccpatch.h
+ toolkit/taglib.h
+ toolkit/tstring.h
+ toolkit/tlist.h
+@@ -312,6 +313,7 @@
+ )
+
+ set(toolkit_SRCS
++ toolkit/rccpatch.cpp
+ toolkit/tstring.cpp
+ toolkit/tstringlist.cpp
+ toolkit/tbytevector.cpp
+@@ -354,7 +356,9 @@
+ add_library(tag ${tag_LIB_SRCS} ${tag_HDRS})
+
+ if(HAVE_ZLIB AND NOT HAVE_ZLIB_SOURCE)
+- target_link_libraries(tag ${ZLIB_LIBRARIES})
++ target_link_libraries(tag rcc ${ZLIB_LIBRARIES})
++else ()
++ target_link_libraries(tag rcc)
+ endif()
+
+ set_target_properties(tag PROPERTIES
+diff -dPNur taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c/taglib/mpeg/id3v1/id3v1tag.cpp taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c-ds/taglib/mpeg/id3v1/id3v1tag.cpp
+--- taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c/taglib/mpeg/id3v1/id3v1tag.cpp 2018-10-28 14:43:45.000000000 +0100
++++ taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c-ds/taglib/mpeg/id3v1/id3v1tag.cpp 2019-09-01 08:32:29.577443787 +0200
+@@ -69,15 +69,18 @@
+
+ String ID3v1::StringHandler::parse(const ByteVector &data) const
+ {
+- return String(data, String::Latin1).stripWhiteSpace();
++ return String(data, String::Latin1ID3).stripWhiteSpace();
+ }
+
+ ByteVector ID3v1::StringHandler::render(const String &s) const
+ {
+- if(s.isLatin1())
+- return s.data(String::Latin1);
+- else
++ if(!s.isLatin1())
++ {
++ if (String::ID3WType(String::Latin1) == String::Latin1)
+ return ByteVector();
++ }
++
++ return s.data(String::Latin1ID3);
+ }
+
+ ////////////////////////////////////////////////////////////////////////////////
+@@ -262,7 +265,7 @@
+ d->track = static_cast<unsigned char>(data[offset + 29]);
+ }
+ else
+- d->comment = data.mid(offset, 30);
++ d->comment = stringHandler->parse(data.mid(offset, 30));
+
+ offset += 30;
+
+diff -dPNur taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c/taglib/mpeg/id3v2/frames/commentsframe.cpp taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c-ds/taglib/mpeg/id3v2/frames/commentsframe.cpp
+--- taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c/taglib/mpeg/id3v2/frames/commentsframe.cpp 2018-10-28 14:43:45.000000000 +0100
++++ taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c-ds/taglib/mpeg/id3v2/frames/commentsframe.cpp 2019-09-01 08:32:29.578443805 +0200
+@@ -150,10 +150,10 @@
+ return;
+ }
+
+- d->textEncoding = String::Type(data[0]);
++ d->textEncoding = String::ID3Type(data[0]);
+ d->language = data.mid(1, 3);
+
+- int byteAlign = d->textEncoding == String::Latin1 || d->textEncoding == String::UTF8 ? 1 : 2;
++ int byteAlign = (d->textEncoding == String::Latin1 || d->textEncoding == String::Latin1ID3 || d->textEncoding == String::Latin1ID3V2 || d->textEncoding == String::UTF8) ? 1 : 2;
+
+ ByteVectorList l = ByteVectorList::split(data.mid(4), textDelimiter(d->textEncoding), byteAlign, 2);
+
+@@ -173,11 +173,13 @@
+ ByteVector v;
+
+ String::Type encoding = d->textEncoding;
++
++ encoding = String::ID3WType(encoding);
+
+ encoding = checkTextEncoding(d->description, encoding);
+ encoding = checkTextEncoding(d->text, encoding);
+
+- v.append(char(encoding));
++ v.append(char(String::ID3RealType(encoding)));
+ v.append(d->language.size() == 3 ? d->language : "XXX");
+ v.append(d->description.data(encoding));
+ v.append(textDelimiter(encoding));
+diff -dPNur taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c/taglib/mpeg/id3v2/frames/textidentificationframe.cpp taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c-ds/taglib/mpeg/id3v2/frames/textidentificationframe.cpp
+--- taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c/taglib/mpeg/id3v2/frames/textidentificationframe.cpp 2018-10-28 14:43:45.000000000 +0100
++++ taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c-ds/taglib/mpeg/id3v2/frames/textidentificationframe.cpp 2019-09-01 08:32:29.578443805 +0200
+@@ -191,12 +191,12 @@
+
+ // read the string data type (the first byte of the field data)
+
+- d->textEncoding = String::Type(data[0]);
++ d->textEncoding = String::ID3Type(data[0]);
+
+ // split the byte array into chunks based on the string type (two byte delimiter
+ // for unicode encodings)
+
+- int byteAlign = d->textEncoding == String::Latin1 || d->textEncoding == String::UTF8 ? 1 : 2;
++ int byteAlign = (d->textEncoding == String::Latin1 || d->textEncoding == String::Latin1ID3 || d->textEncoding == String::Latin1ID3V2 || d->textEncoding == String::UTF8) ? 1 : 2;
+
+ // build a small counter to strip nulls off the end of the field
+
+@@ -227,11 +227,14 @@
+
+ ByteVector TextIdentificationFrame::renderFields() const
+ {
+- String::Type encoding = checkTextEncoding(d->fieldList, d->textEncoding);
++ String::Type encoding = d->textEncoding;
++
++ encoding = String::ID3WType(encoding);
++ encoding = checkTextEncoding(d->fieldList, encoding);
+
+ ByteVector v;
+
+- v.append(char(encoding));
++ v.append(char(String::ID3RealType(encoding)));
+
+ for(StringList::ConstIterator it = d->fieldList.begin(); it != d->fieldList.end(); it++) {
+
+diff -dPNur taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c/taglib/mpeg/id3v2/id3v2frame.cpp taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c-ds/taglib/mpeg/id3v2/id3v2frame.cpp
+--- taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c/taglib/mpeg/id3v2/id3v2frame.cpp 2018-10-28 14:43:45.000000000 +0100
++++ taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c-ds/taglib/mpeg/id3v2/id3v2frame.cpp 2019-09-01 08:32:29.578443805 +0200
+@@ -297,7 +297,7 @@
+ if((encoding == String::UTF8 || encoding == String::UTF16BE) && version != 4)
+ return String::UTF16;
+
+- if(encoding != String::Latin1)
++ if((encoding != String::Latin1)&&(encoding != String::Latin1ID3V2))
+ return encoding;
+
+ for(StringList::ConstIterator it = fields.begin(); it != fields.end(); ++it) {
+diff -dPNur taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c/taglib/toolkit/rccpatch.cpp taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c-ds/taglib/toolkit/rccpatch.cpp
+--- taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c/taglib/toolkit/rccpatch.cpp 1970-01-01 01:00:00.000000000 +0100
++++ taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c-ds/taglib/toolkit/rccpatch.cpp 2019-09-01 08:32:29.578443805 +0200
+@@ -0,0 +1,237 @@
++#include <stdlib.h>
++
++#include <string>
++#include "tstring.h"
++#include "tbytevector.h"
++
++//#define RCC_DEBUG
++
++
++#ifndef HAVE_LIBRCC
++# include <config.h>
++#endif
++
++#ifdef HAVE_LIBRCC
++# ifdef RCC_DEBUG
++# include <stdio.h>
++# endif /* RCC_DEBUG */
++# include <librcc.h>
++# include <string.h>
++#endif /* HAVE_LIBRCC */
++
++
++#ifdef HAVE_LIBRCC
++# define ID3_CLASS 0
++# define ID3V2_CLASS 1
++# define UTF_CLASS 2
++# define OUT_CLASS 3
++static rcc_class classes[] = {
++ { "id3", RCC_CLASS_STANDARD, NULL, NULL, "ID3 Encoding", 0 },
++ { "id3v2", RCC_CLASS_STANDARD, "id3", NULL, "ID3 v.2 Encoding", 0 },
++ { "utf", RCC_CLASS_KNOWN, "UTF-8", NULL, "Unicode Encoding", 0},
++ { "out", RCC_CLASS_TRANSLATE_LOCALE, "LC_CTYPE", NULL, "Output Encoding", 0 },
++ { NULL, RCC_CLASS_STANDARD, NULL, NULL, NULL, 0 }
++};
++
++static int rcc_initialized = 0;
++
++static rcc_context ctx = NULL;
++#endif /* HAVE_LIBRCC */
++
++
++void rccTaglibPatchFree() {
++#ifdef HAVE_LIBRCC
++ if (rcc_initialized) {
++ rccFree();
++ rcc_initialized = 0;
++ }
++#endif /* HAVE_LIBRCC */
++}
++
++void rccTaglibPatchInit() {
++#ifdef HAVE_LIBRCC
++ if (rcc_initialized) return;
++ rccInit();
++ rccInitDefaultContext(NULL, 0, 0, classes, 0);
++ rccLoad(NULL, "xmms");
++ rccInitDb4(NULL, NULL, 0);
++ rcc_initialized = 1;
++#endif /* HAVE_LIBRCC */
++}
++
++void rccTaglibPatchSetContext(void *newctx) {
++#ifdef HAVE_LIBRCC
++ if (newctx) {
++ ctx = (rcc_context)newctx;
++ rcc_initialized = 1;
++ }
++#endif /* HAVE_LIBRCC */
++}
++
++static void rccTaglibPatchTryInit() {
++#ifdef HAVE_LIBRCC
++ if (!rcc_initialized) {
++ rccTaglibPatchInit();
++ if (rcc_initialized) atexit(rccTaglibPatchFree);
++ }
++#endif /* HAVE_LIBRCC */
++}
++
++
++TagLib::ByteVector rccTaglibPatchRecodeOutput(const std::string &s) {
++ TagLib::ByteVector v;
++#ifdef HAVE_LIBRCC
++ size_t rlen;
++ char *res;
++
++ rccTaglibPatchTryInit();
++
++ res = rccSizedRecode(ctx, UTF_CLASS, OUT_CLASS, s.c_str(), s.length(), &rlen);
++#ifdef RCC_DEBUG
++ for (const unsigned char *c = (const unsigned char*)s.c_str(); *c; c++) {
++ if (*c > 127) {
++ printf(" Output: %s - %s\n", s.c_str(), res?res:"null");
++ break;
++ }
++ }
++#endif /* RCC_DEBUG */
++
++ if (res) v.setData(res, rlen);
++ else v.setData("", 0);
++ //v.setData(s.c_str(), s.length());
++
++ return v;
++#else
++ v.setData("", 0);
++
++ return v;
++#endif /* HAVE_LIBRCC */
++}
++
++TagLib::ByteVector rccTaglibPatchRecodeOutputID3(const std::string &s, bool v2 = false) {
++ TagLib::ByteVector v;
++#ifdef HAVE_LIBRCC
++ size_t rlen;
++ char *res;
++
++ rccTaglibPatchTryInit();
++
++ res = rccSizedRecode(ctx, UTF_CLASS, v2?ID3V2_CLASS:ID3_CLASS, s.c_str(), s.length(), &rlen);
++#ifdef RCC_DEBUG
++ for (const unsigned char *c = (const unsigned char*)s.c_str(); *c; c++) {
++ if (*c > 127) {
++ printf(" OutputID3(%i): %s - %s\n", v2, s.c_str(), res?res:"null");
++ break;
++ }
++ }
++#endif /* RCC_DEBUG */
++
++ if (res) v.setData(res, rlen);
++ else v.setData("", 0);
++ //v.setData(s.c_str(), s.length());
++
++ return v;
++#else
++ v.setData("", 0);
++
++ return v;
++#endif /* HAVE_LIBRCC */
++}
++
++TagLib::ByteVector rccTaglibPatchRecodeInput(const std::string &s) {
++ TagLib::ByteVector v;
++#ifdef HAVE_LIBRCC
++ size_t rlen;
++ char *res;
++
++ rccTaglibPatchTryInit();
++
++ res = rccSizedRecode(ctx, OUT_CLASS, UTF_CLASS, s.c_str(), s.length(), &rlen);
++#ifdef RCC_DEBUG
++ for (const unsigned char *c = (const unsigned char*)s.c_str(); *c; c++) {
++ if (*c > 127) {
++ printf(" Input: %s - %s\n", s.c_str(), res?res:"null");
++ break;
++ }
++ }
++#endif /* RCC_DEBUG */
++
++ if (res) v.setData(res, rlen);
++ else
++#endif /* HAVE_LIBRCC */
++ v.setData("", 0);
++
++ return v;
++}
++
++TagLib::ByteVector rccTaglibPatchRecodeInputID3(const std::string &s, bool v2 = false) {
++ TagLib::ByteVector v;
++#ifdef HAVE_LIBRCC
++ size_t rlen;
++ char *res;
++
++ rccTaglibPatchTryInit();
++
++ res = rccSizedRecode(ctx, v2?ID3V2_CLASS:ID3_CLASS, UTF_CLASS, s.c_str(), s.length(), &rlen);
++#ifdef RCC_DEBUG
++ for (const unsigned char *c = (const unsigned char*)s.c_str(); *c; c++) {
++ if (*c > 127) {
++ printf(" InputID3(%i): %s - %s\n", v2, s.c_str(), res?res:"null");
++ break;
++ }
++ }
++#endif /* RCC_DEBUG */
++ if (res) v.setData(res, rlen + 1);
++ else
++#endif /* HAVE_LIBRCC */
++ v.setData("", 0);
++
++ return v;
++}
++
++TagLib::String::Type rccTaglibPatchGetLocaleType() {
++#ifdef HAVE_LIBRCC
++ size_t len;
++ char charset[32];
++
++ rccTaglibPatchTryInit();
++ if (!rccLocaleGetCharset(charset, NULL, 31)) {
++ if (!strncmp(charset, "UTF", 3)) {
++ len = strlen(charset);
++
++ if (charset[len-1]=='8') return TagLib::String::UTF8;
++ if (!strcmp(charset+(len-2),"16")) return TagLib::String::UTF16;
++ if (!strcmp(charset+(len-4),"16LE")) return TagLib::String::UTF16LE;
++ if (!strcmp(charset+(len-4),"16BE")) return TagLib::String::UTF16BE;
++ }
++ return TagLib::String::Latin1;
++ }
++#endif /* HAVE_LIBRCC */
++ return TagLib::String::UTF8;
++}
++
++TagLib::String::Type rccTaglibPatchGetID3Type() {
++#ifdef HAVE_LIBRCC
++ size_t len;
++ const char *charset;
++
++ rccTaglibPatchTryInit();
++
++ charset = rccGetCurrentCharsetName(ctx, ID3V2_CLASS);
++ if (charset) {
++ if (!strncmp(charset, "UTF", 3)) {
++ len = strlen(charset);
++
++ if (charset[len-1]=='8') return TagLib::String::UTF8;
++ if (!strcmp(charset+(len-2),"16")) return TagLib::String::UTF16;
++ if (!strcmp(charset+(len-4),"16LE")) return TagLib::String::UTF16LE;
++ if (!strcmp(charset+(len-4),"16BE")) return TagLib::String::UTF16BE;
++ }
++ return TagLib::String::Latin1ID3V2;
++ } else {
++ // Error or no-language configured: If Latin1ID3V2 is returned we normally will use the default unicode encoding unless Latin1 is selected by taglib
++ return TagLib::String::Latin1ID3V2;
++ }
++#endif /* HAVE_LIBRCC */
++ return TagLib::String::Latin1;
++}
+diff -dPNur taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c/taglib/toolkit/rccpatch.h taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c-ds/taglib/toolkit/rccpatch.h
+--- taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c/taglib/toolkit/rccpatch.h 1970-01-01 01:00:00.000000000 +0100
++++ taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c-ds/taglib/toolkit/rccpatch.h 2019-09-01 08:32:29.578443805 +0200
+@@ -0,0 +1,20 @@
++#ifndef _RCC_PATCH_H
++#define _RCC_PATCH_H
++
++#include <string.h>
++#include "tstring.h"
++#include "tbytevector.h"
++
++void rccTaglibPatchFree();
++void rccTaglibPatchInit();
++void rccTaglibPatchSetContext(void *newctx);
++
++TagLib::ByteVector rccTaglibPatchRecodeOutput(const std::string &s);
++TagLib::ByteVector rccTaglibPatchRecodeInput(const std::string &s);
++TagLib::ByteVector rccTaglibPatchRecodeOutputID3(const std::string &s, bool v2 = false);
++TagLib::ByteVector rccTaglibPatchRecodeInputID3(const std::string &s, bool v2 = false);
++
++TagLib::String::Type rccTaglibPatchGetLocaleType();
++TagLib::String::Type rccTaglibPatchGetID3Type();
++
++#endif /* _RCC_PATCH_H */
+diff -dPNur taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c/taglib/toolkit/tstring.cpp taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c-ds/taglib/toolkit/tstring.cpp
+--- taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c/taglib/toolkit/tstring.cpp 2018-10-28 14:43:45.000000000 +0100
++++ taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c-ds/taglib/toolkit/tstring.cpp 2019-09-01 08:27:18.763821274 +0200
+@@ -33,6 +33,7 @@
+ #include <trefcounter.h>
+ #include <tutils.h>
+
++#include "rccpatch.h"
+ #include "tstring.h"
+
+ namespace
+@@ -48,16 +49,6 @@
+ return String::UTF16BE;
+ }
+
+- // Converts a Latin-1 string into UTF-16(without BOM/CPU byte order)
+- // and copies it to the internal buffer.
+- void copyFromLatin1(std::wstring &data, const char *s, size_t length)
+- {
+- data.resize(length);
+-
+- for(size_t i = 0; i < length; ++i)
+- data[i] = static_cast<unsigned char>(s[i]);
+- }
+-
+ // Converts a UTF-8 string into UTF-16(without BOM/CPU byte order)
+ // and copies it to the internal buffer.
+ void copyFromUTF8(std::wstring &data, const char *s, size_t length)
+@@ -73,6 +64,36 @@
+ debug("String::copyFromUTF8() - UTF8-CPP error: " + message);
+ data.clear();
+ }
++
++ }
++
++ // Converts a Latin-1 string into UTF-16(without BOM/CPU byte order)
++ // and copies it to the internal buffer.
++ void copyFromLatin1(std::wstring &data, const char *s, size_t length, bool prepare, String::Type t)
++ {
++ // librcc conversation
++ if (prepare) {
++ ByteVector v;
++ std::string std_s(s);
++
++ if (t == String::Latin1ID3) v = rccTaglibPatchRecodeInputID3(std_s, false);
++ else if (t == String::Latin1ID3V2) v = rccTaglibPatchRecodeInputID3(std_s, true);
++ else /* Latin1 converted from Locale */ v = rccTaglibPatchRecodeInput(std_s);
++
++ if (v.size()) {
++ copyFromUTF8(data, v.data(), v.size());
++ return;
++ } else {
++ // We don't know if we got UTF-8 encoded string or either rcc is disable or something is failed,
++ // since standard applications are really expecting here Latin1, it is safe to just check if we have violations of UTF8
++ //if (Unicode::isLegalUTF8(s)) t = UTF8;
++ }
++ }
++
++ data.resize(length);
++
++ for(size_t i = 0; i < length; ++i)
++ data[i] = static_cast<unsigned char>(s[i]);
+ }
+
+ // Helper functions to read a UTF-16 character from an array.
+@@ -175,8 +196,11 @@
+ String::String(const std::string &s, Type t) :
+ d(new StringPrivate())
+ {
++ if(t == Locale)
++ t = rccTaglibPatchGetLocaleType();
++
+ if(t == Latin1)
+- copyFromLatin1(d->data, s.c_str(), s.length());
++ copyFromLatin1(d->data, s.c_str(), s.length(), true, t);
+ else if(t == String::UTF8)
+ copyFromUTF8(d->data, s.c_str(), s.length());
+ else {
+@@ -223,8 +247,11 @@
+ String::String(const char *s, Type t) :
+ d(new StringPrivate())
+ {
+- if(t == Latin1)
+- copyFromLatin1(d->data, s, ::strlen(s));
++ if(t == Locale)
++ t = rccTaglibPatchGetLocaleType();
++
++ if(t == Latin1 || t == Latin1ID3 || t == Latin1ID3V2)
++ copyFromLatin1(d->data, s, ::strlen(s), true, t);
+ else if(t == String::UTF8)
+ copyFromUTF8(d->data, s, ::strlen(s));
+ else {
+@@ -245,8 +272,11 @@
+ String::String(char c, Type t) :
+ d(new StringPrivate())
+ {
+- if(t == Latin1)
+- copyFromLatin1(d->data, &c, 1);
++ if(t == Locale)
++ t = rccTaglibPatchGetLocaleType();
++
++ if(t == Latin1 || t == Latin1ID3 || t == Latin1ID3V2)
++ copyFromLatin1(d->data, &c, 1, true, t);
+ else if(t == String::UTF8)
+ copyFromUTF8(d->data, &c, 1);
+ else {
+@@ -260,8 +290,11 @@
+ if(v.isEmpty())
+ return;
+
+- if(t == Latin1)
+- copyFromLatin1(d->data, v.data(), v.size());
++ if(t == Locale)
++ t = rccTaglibPatchGetLocaleType();
++
++ if(t == Latin1 || t == Latin1ID3 || t == Latin1ID3V2)
++ copyFromLatin1(d->data, v.data(), v.size(), true, t);
+ else if(t == UTF8)
+ copyFromUTF8(d->data, v.data(), v.size());
+ else
+@@ -416,8 +449,38 @@
+
+ ByteVector String::data(Type t) const
+ {
+- switch(t)
+- {
++ ByteVector v;
++
++ if (t == Locale) {
++ // The source is either Unicode or real Latin1 (if rcc is bypassed)
++ std::string s = to8Bit(true);
++
++ // In case of UTF8 locale, this probably will return NULL (no recoding needed), but we will take UTF8 path in the next swtich
++ v = rccTaglibPatchRecodeOutput(s);
++ if (v.size()) return v;
++
++ t = rccTaglibPatchGetLocaleType();
++ }
++
++ switch(t) {
++ case Latin1ID3:
++ case Latin1ID3V2:
++ {
++ std::string s = to8Bit(true);
++ if (t == Latin1ID3) v = rccTaglibPatchRecodeOutputID3(s, false);
++ else if (t == Latin1ID3V2) v = rccTaglibPatchRecodeOutputID3(s, true);
++ if (v.size())
++ return v;
++
++ // we don't know if we got NULL because rcc is disabled (error) or UTF8 output is required
++ if ((t == Latin1ID3V2)&&(rccTaglibPatchGetID3Type() == UTF8)) {
++ v.setData(s.c_str(), s.length());
++ } else {
++ for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); it++)
++ v.append(char(*it));
++ }
++ return v;
++ }
+ case Latin1:
+ {
+ ByteVector v(size(), 0);
+@@ -741,7 +804,33 @@
+
+ std::ostream &operator<<(std::ostream &s, const TagLib::String &str)
+ {
+- s << str.to8Bit();
++ TagLib::ByteVector bv = str.data(TagLib::String::Locale);
++ s << bv;
+ return s;
+ }
+
++TagLib::String::Type TagLib::String::ID3Type(int i)
++{
++ if(i == Latin1)
++ return Latin1ID3V2;
++ return Type(i);
++};
++
++TagLib::String::Type TagLib::String::ID3WType(Type type)
++{
++ Type rcc_type = rccTaglibPatchGetID3Type();
++ if((rcc_type == Latin1ID3)||(rcc_type == Latin1ID3V2)||(rcc_type == Latin1)) {
++ if(type == Latin1) return
++ rcc_type;
++ return type;
++ }
++
++ return rcc_type;
++};
++
++TagLib::String::Type TagLib::String::ID3RealType(Type type)
++{
++ if((type == Latin1ID3) || (type == Latin1ID3V2))
++ return Latin1;
++ return type;
++}
+diff -dPNur taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c/taglib/toolkit/tstring.h taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c-ds/taglib/toolkit/tstring.h
+--- taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c/taglib/toolkit/tstring.h 2018-10-28 14:43:45.000000000 +0100
++++ taglib-5cb589a5b82c13ba8f0542e5e79629da7645cb3c-ds/taglib/toolkit/tstring.h 2019-09-01 08:32:29.579443823 +0200
+@@ -96,6 +96,18 @@
+ */
+ enum Type {
+ /*!
++ * Determine using current locale settings
++ */
++ Locale = -1,
++ /*!
++ * Latin1 for ID3 tags.
++ */
++ Latin1ID3 = 65,
++ /*!
++ * Latin1 for ID3v2 tags.
++ */
++ Latin1ID3V2 = 66,
++ /*!
+ * IS08859-1, or <i>Latin1</i> encoding. 8 bit characters.
+ */
+ Latin1 = 0,
+@@ -117,6 +129,10 @@
+ */
+ UTF16LE = 4
+ };
++
++ static Type ID3Type(int i);
++ static Type ID3WType(Type type);
++ static Type ID3RealType(Type type);
+
+ /*!
+ * Constructs an empty String.
diff --git a/media-libs/taglib/files/taglib-1.11-install-examples.patch b/media-libs/taglib/files/taglib-1.11-install-examples.patch
new file mode 100644
index 0000000..fd676c6
--- /dev/null
+++ b/media-libs/taglib/files/taglib-1.11-install-examples.patch
@@ -0,0 +1,13 @@
+--- a/examples/CMakeLists.txt
++++ b/examples/CMakeLists.txt
+@@ -37,3 +37,10 @@
+ add_executable(strip-id3v1 strip-id3v1.cpp)
+ target_link_libraries(strip-id3v1 tag)
+
++INSTALL(TARGETS
++ tagreader tagreader_c tagwriter framelist strip-id3v1
++ LIBRARY DESTINATION ${LIB_INSTALL_DIR}
++ RUNTIME DESTINATION ${BIN_INSTALL_DIR}
++ ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
++)
++
diff --git a/media-libs/taglib/files/taglib-1.11.1_p20181028-version-1.11.2.patch b/media-libs/taglib/files/taglib-1.11.1_p20181028-version-1.11.2.patch
new file mode 100644
index 0000000..4b8311d
--- /dev/null
+++ b/media-libs/taglib/files/taglib-1.11.1_p20181028-version-1.11.2.patch
@@ -0,0 +1,11 @@
+--- a/taglib/toolkit/taglib.h 2018-10-28 14:43:45.000000000 +0100
++++ b/taglib/toolkit/taglib.h 2018-11-17 23:40:39.517716254 +0100
+@@ -30,7 +30,7 @@
+
+ #define TAGLIB_MAJOR_VERSION 1
+ #define TAGLIB_MINOR_VERSION 11
+-#define TAGLIB_PATCH_VERSION 1
++#define TAGLIB_PATCH_VERSION 2
+
+ #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 1)) || defined(__clang__)
+ #define TAGLIB_IGNORE_MISSING_DESTRUCTOR _Pragma("GCC diagnostic ignored \"-Wnon-virtual-dtor\"")
diff --git a/media-libs/taglib/taglib-1.11.1_p20181028-r1.ebuild b/media-libs/taglib/taglib-1.11.1_p20181028-r1.ebuild
new file mode 100644
index 0000000..188d9cd
--- /dev/null
+++ b/media-libs/taglib/taglib-1.11.1_p20181028-r1.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+COMMIT=5cb589a5b82c13ba8f0542e5e79629da7645cb3c
+inherit cmake-multilib flag-o-matic
+
+DESCRIPTION="A library for reading and editing audio meta data"
+HOMEPAGE="https://taglib.github.io/"
+SRC_URI="https://github.com/${PN}/${PN}/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="LGPL-2.1 MPL-1.1"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-solaris"
+SLOT="0"
+
+#SDS
+IUSE="debug examples test rcc"
+
+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}] )
+ rcc? ( app-i18n/librcc )
+"
+
+S="${WORKDIR}/${PN}-${COMMIT}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.11-install-examples.patch
+ "${FILESDIR}"/${P}-version-1.11.2.patch
+ "${FILESDIR}"/taglib-1.11-ds-rusxmms.patch
+ "${FILESDIR}"/taglib-1.9.1-ds-rusxmms-enforce.patch
+)
+#EDS
+
+
+MULTILIB_CHOST_TOOLS=(
+ /usr/bin/taglib-config
+)
+
+src_prepare() {
+ cmake-utils_src_prepare
+
+ sed -e "s/BUILD_TESTS AND NOT BUILD_SHARED_LIBS/BUILD_TESTS/" \
+ -i CMakeLists.txt \
+ -i ConfigureChecks.cmake || die
+
+ # bug 651744
+ append-cxxflags -std=c++11
+}
+
+multilib_src_configure() {
+ local mycmakeargs=(
+ -DBUILD_EXAMPLES=$(multilib_native_usex examples)
+ -DBUILD_SHARED_LIBS=ON
+ -DBUILD_TESTS=$(usex test)
+ )
+
+ cmake-utils_src_configure
+}
+
+multilib_src_test() {
+ # ctest does not work
+ emake -C "${BUILD_DIR}" check
+}