mirror of
https://git.freebsd.org/ports.git
synced 2025-06-04 04:16:27 -04:00
- Update taglib to 1.6.1 release
- Update taglib-extras to 1.0.1 release - Switch to cmake build - Add optional patch to support on-the-fly charset recoding via devel/librcc - Tag shlib version changed to original, provided by authors Approved by: miwi (mentor) Exp-run by: miwi
This commit is contained in:
parent
8e366b5c0c
commit
6dac64742a
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=245120
7 changed files with 591 additions and 56 deletions
|
@ -5,31 +5,19 @@
|
|||
# $FreeBSD$
|
||||
|
||||
PORTNAME= taglib-extras
|
||||
PORTVERSION= 0.1.7
|
||||
PORTVERSION= 1.0.1
|
||||
CATEGORIES= audio
|
||||
MASTER_SITES= http://www.kollide.net/~jefferai/
|
||||
|
||||
MAINTAINER= datahead4@gmail.com
|
||||
COMMENT= Extra taglib features for Amarok 2.1
|
||||
COMMENT= Extra taglib features for Amarok 2.2
|
||||
|
||||
LIB_DEPENDS= tag.6:${PORTSDIR}/audio/taglib
|
||||
LIB_DEPENDS= tag.1:${PORTSDIR}/audio/taglib
|
||||
|
||||
USE_KDE4= automoc4 kdehier
|
||||
USE_QT_VER= 4
|
||||
QT_COMPONENTS= corelib qmake_build moc_build rcc_build uic_build phonon
|
||||
USE_CMAKE= yes
|
||||
|
||||
OPTIONS= KDE4_MIME "Resolve file types with KMimeTypeResolve" ON
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if defined(WITHOUT_KDE4_MIME)
|
||||
CMAKE_ARGS+= -DWITH_KDE:BOOL=Off
|
||||
.else
|
||||
USE_KDE4+= kdelibs
|
||||
CMAKE_ARGS+= -DWITH_KDE:BOOL=On
|
||||
.endif
|
||||
|
||||
post-extract:
|
||||
${REINPLACE_CMD} -e 's|$${LIB_INSTALL_DIR}/pkgconfig|libdata/pkgconfig|' \
|
||||
${WRKSRC}/CMakeLists.txt
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
MD5 (taglib-extras-0.1.7.tar.gz) = 09bf9c89d953a238b55ac74bf9db0be3
|
||||
SHA256 (taglib-extras-0.1.7.tar.gz) = 206bc6eb49d644239b4bc9fb928685c0c0b07f7e6f1ee3748a96898682c01659
|
||||
SIZE (taglib-extras-0.1.7.tar.gz) = 49421
|
||||
MD5 (taglib-extras-1.0.1.tar.gz) = e973ca609b18e2c03c147ff9fd9e6eb8
|
||||
SHA256 (taglib-extras-1.0.1.tar.gz) = fe546b4b315f3227c975fed8ea9dfc0e54fc6997fdbba2a9da7beba479229632
|
||||
SIZE (taglib-extras-1.0.1.tar.gz) = 31363
|
||||
|
|
|
@ -1,31 +1,14 @@
|
|||
bin/taglib-extras-config
|
||||
include/taglib-extras/asfattribute.h
|
||||
include/taglib-extras/asffile.h
|
||||
include/taglib-extras/asffiletyperesolver.h
|
||||
include/taglib-extras/asfproperties.h
|
||||
include/taglib-extras/asftag.h
|
||||
include/taglib-extras/audiblefile.h
|
||||
include/taglib-extras/audiblefiletyperesolver.h
|
||||
include/taglib-extras/audibleproperties.h
|
||||
include/taglib-extras/audibletag.h
|
||||
include/taglib-extras/mp4atom.h
|
||||
include/taglib-extras/mp4file.h
|
||||
include/taglib-extras/mp4filetyperesolver.h
|
||||
include/taglib-extras/mp4item.h
|
||||
include/taglib-extras/mp4properties.h
|
||||
include/taglib-extras/mp4tag.h
|
||||
include/taglib-extras/realmediafile.h
|
||||
include/taglib-extras/realmediafiletyperesolver.h
|
||||
include/taglib-extras/taglib-extras_export.h
|
||||
include/taglib-extras/tdebug.h
|
||||
include/taglib-extras/tfile_helper.h
|
||||
include/taglib-extras/tplugins.h
|
||||
include/taglib-extras/wavfile.h
|
||||
include/taglib-extras/wavfiletyperesolver.h
|
||||
include/taglib-extras/wavproperties.h
|
||||
lib/libtag-extras.so
|
||||
lib/libtag-extras.so.0
|
||||
lib/libtag-extras.so.0.1.0
|
||||
lib/libtag-extras.so.1
|
||||
lib/libtag-extras.so.1.0.0
|
||||
libdata/pkgconfig/taglib-extras.pc
|
||||
@dirrmtry lib/pkgconfig
|
||||
@dirrm include/taglib-extras
|
||||
|
|
|
@ -6,21 +6,45 @@
|
|||
#
|
||||
|
||||
PORTNAME= taglib
|
||||
PORTVERSION= 1.5
|
||||
PORTVERSION= 1.6.1
|
||||
CATEGORIES= audio
|
||||
MASTER_SITES= http://ktown.kde.org/~wheeler/files/src/
|
||||
MASTER_SITES= http://developer.kde.org/~wheeler/files/src/ \
|
||||
ftp://ftp.musicbrainz.org/${MASTER_SITE_SUBDIR}/ \
|
||||
http://uk.musicbrainz.org/${MASTER_SITE_SUBDIR}/ \
|
||||
ftp://ftp.osuosl.org/pub/${MASTER_SITE_SUBDIR}/
|
||||
MASTER_SITE_SUBDIR= pub/musicbrainz/users/luks/${PORTNAME}
|
||||
|
||||
MAINTAINER= bsdkaffee@gmail.com
|
||||
COMMENT= Library for manipulating ID3 tags and Ogg comments
|
||||
|
||||
USE_AUTOTOOLS= libtool:22
|
||||
GNU_CONFIGURE= yes
|
||||
USE_GMAKE= yes
|
||||
USE_CMAKE= yes
|
||||
USE_LDCONFIG= yes
|
||||
MAKE_JOBS_SAFE= yes
|
||||
|
||||
post-patch:
|
||||
@${REINPLACE_CMD} -e \
|
||||
"s#\$$(libdir)/pkgconfig#${PREFIX}/libdata/pkgconfig#g" \
|
||||
${WRKSRC}/Makefile.in ${WRKSRC}/bindings/c/Makefile.in
|
||||
CMAKE_ARGS= -DWITH_ASF:BOOL=ON \
|
||||
-DWITH_MP4:BOOL=ON
|
||||
|
||||
.include <bsd.port.mk>
|
||||
OPTIONS= RCC "Build with RusXMMS librcc patches (experimental)" off
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if defined(WITH_RCC)
|
||||
PKGNAMESUFFIX= -rcc
|
||||
EXTRA_PATCHES+= ${FILESDIR}/extrapatch-rcc
|
||||
|
||||
LIB_DEPENDS+= rcc.2:${PORTSDIR}/devel/librcc
|
||||
PLIST_SUB+= RCC=""
|
||||
.else
|
||||
PLIST_SUB+= RCC="@comment "
|
||||
.endif
|
||||
|
||||
post-patch:
|
||||
.if defined(WITH_RCC)
|
||||
@${REINPLACE_CMD} -e 's|-ltag|-ltag -lrcc|g' \
|
||||
${WRKSRC}/taglib.pc.cmake ${WRKSRC}/taglib-config.cmake \
|
||||
${WRKSRC}/bindings/c/taglib_c.pc.cmake
|
||||
.endif
|
||||
${REINPLACE_CMD} -e 's|$${LIB_INSTALL_DIR}/pkgconfig|libdata/pkgconfig|' \
|
||||
${WRKSRC}/CMakeLists.txt ${WRKSRC}/bindings/c/CMakeLists.txt
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
MD5 (taglib-1.5.tar.gz) = 7b557dde7425c6deb7bbedd65b4f2717
|
||||
SHA256 (taglib-1.5.tar.gz) = ba610716ec539d4858133e008d079728953820c583b200ff0936e36fc0550ec2
|
||||
SIZE (taglib-1.5.tar.gz) = 1394506
|
||||
MD5 (taglib-1.6.1.tar.gz) = db0502b3c3448ff1f1f9b090c1daa5f7
|
||||
SHA256 (taglib-1.6.1.tar.gz) = 8e752a05e294127336c0c09be3a12542ab7262cdd6db86dfc18529148d1dba44
|
||||
SIZE (taglib-1.6.1.tar.gz) = 1104563
|
||||
|
|
524
audio/taglib/files/extrapatch-rcc
Normal file
524
audio/taglib/files/extrapatch-rcc
Normal file
|
@ -0,0 +1,524 @@
|
|||
--- config-taglib.h.cmake.orig 2008-01-11 01:56:23.000000000 +0100
|
||||
+++ config-taglib.h.cmake 2008-11-20 15:58:31.000000000 +0100
|
||||
@@ -6,4 +6,6 @@
|
||||
/* Define if you have libz */
|
||||
#cmakedefine HAVE_ZLIB 1
|
||||
|
||||
+#cmakedefine HAVE_LIBRCC 1
|
||||
+
|
||||
#cmakedefine NO_ITUNES_HACKS 1
|
||||
--- ConfigureChecks.cmake.orig 2008-12-21 16:46:41.000000000 -0500
|
||||
+++ ConfigureChecks.cmake 2009-09-29 07:08:08.000000000 -0400
|
||||
@@ -20,6 +20,21 @@
|
||||
SET(HAVE_ZLIB 0)
|
||||
ENDIF(ZLIB_FOUND)
|
||||
|
||||
+#check for librcc
|
||||
+find_path(RCC_INCLUDE_DIR librcc.h)
|
||||
+find_library(RCC_LIBRARY NAMES rcc)
|
||||
+include(FindPackageHandleStandardArgs)
|
||||
+find_package_handle_standard_args(RCC DEFAULT_MSG RCC_LIBRARY RCC_INCLUDE_DIR)
|
||||
+
|
||||
+if(RCC_FOUND)
|
||||
+ set(RCC_LIBRARIES ${RCC_LIBRARY})
|
||||
+ set(HAVE_LIBRCC 1)
|
||||
+else(RCC_FOUND)
|
||||
+ set(HAVE_LIBRCC 0)
|
||||
+endif(RCC_FOUND)
|
||||
+
|
||||
+mark_as_advanced(RCC_LIBRARY RCC_INCLUDE_DIR)
|
||||
+
|
||||
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
|
||||
FIND_PACKAGE(CppUnit)
|
||||
IF (NOT CppUnit_FOUND AND BUILD_TESTS)
|
||||
--- taglib/mpeg/id3v1/id3v1tag.cpp.orig 2008-02-04 16:14:45.000000000 +0100
|
||||
+++ taglib/mpeg/id3v1/id3v1tag.cpp 2008-11-20 15:24:19.000000000 +0100
|
||||
@@ -59,17 +59,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())
|
||||
{
|
||||
+ if (String::ID3WType(String::Latin1) == String::Latin1)
|
||||
return ByteVector();
|
||||
}
|
||||
|
||||
- return s.data(String::Latin1);
|
||||
+ return s.data(String::Latin1ID3);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -240,7 +241,7 @@
|
||||
d->track = uchar(data[offset + 29]);
|
||||
}
|
||||
else
|
||||
- d->comment = data.mid(offset, 30);
|
||||
+ d->comment = TagPrivate::stringHandler->parse(data.mid(offset, 30));
|
||||
|
||||
offset += 30;
|
||||
|
||||
--- taglib/mpeg/id3v2/frames/commentsframe.cpp.orig 2008-02-04 16:14:46.000000000 +0100
|
||||
+++ taglib/mpeg/id3v2/frames/commentsframe.cpp 2008-11-20 15:24:19.000000000 +0100
|
||||
@@ -136,10 +136,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 || String::Latin1ID3 || String::Latin1ID3V2 || d->textEncoding == String::UTF8) ? 1 : 2;
|
||||
|
||||
ByteVectorList l = ByteVectorList::split(data.mid(4), textDelimiter(d->textEncoding), byteAlign, 2);
|
||||
|
||||
@@ -155,10 +155,12 @@
|
||||
|
||||
String::Type encoding = d->textEncoding;
|
||||
|
||||
+ encoding = String::ID3WType(encoding);
|
||||
+
|
||||
encoding = checkEncoding(d->description, encoding);
|
||||
encoding = checkEncoding(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));
|
||||
--- taglib/mpeg/id3v2/frames/textidentificationframe.cpp.orig 2008-02-04 16:14:46.000000000 +0100
|
||||
+++ taglib/mpeg/id3v2/frames/textidentificationframe.cpp 2008-11-20 15:24:19.000000000 +0100
|
||||
@@ -105,12 +105,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
|
||||
|
||||
@@ -139,11 +139,14 @@
|
||||
|
||||
ByteVector TextIdentificationFrame::renderFields() const
|
||||
{
|
||||
- String::Type encoding = checkEncoding(d->fieldList, d->textEncoding);
|
||||
+ String::Type encoding = d->textEncoding;
|
||||
+
|
||||
+ encoding = String::ID3WType(encoding);
|
||||
+ encoding = checkEncoding(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++) {
|
||||
|
||||
--- taglib/toolkit/CMakeLists.txt.orig 2008-01-11 01:54:01.000000000 +0100
|
||||
+++ taglib/toolkit/CMakeLists.txt 2008-11-20 15:58:31.000000000 +0100
|
||||
@@ -1 +1 @@
|
||||
-INSTALL( FILES taglib.h tstring.h tlist.h tlist.tcc tstringlist.h tbytevector.h tbytevectorlist.h tfile.h tmap.h tmap.tcc DESTINATION ${INCLUDE_INSTALL_DIR}/taglib)
|
||||
+INSTALL( FILES rccpatch.h taglib.h tstring.h tlist.h tlist.tcc tstringlist.h tbytevector.h tbytevectorlist.h tfile.h tmap.h tmap.tcc DESTINATION ${INCLUDE_INSTALL_DIR}/taglib)
|
||||
--- taglib/toolkit/rccpatch.cpp.orig 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ taglib/toolkit/rccpatch.cpp 2008-11-20 15:58:31.000000000 +0100
|
||||
@@ -0,0 +1,198 @@
|
||||
+#include <stdlib.h>
|
||||
+
|
||||
+#include <string>
|
||||
+#include "tstring.h"
|
||||
+#include "tbytevector.h"
|
||||
+
|
||||
+#ifndef HAVE_LIBRCC
|
||||
+# include <config.h>
|
||||
+#endif
|
||||
+
|
||||
+#ifdef HAVE_LIBRCC
|
||||
+# 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 rccPatchFree() {
|
||||
+#ifdef HAVE_LIBRCC
|
||||
+ if (rcc_initialized) {
|
||||
+ rccFree();
|
||||
+ rcc_initialized = 0;
|
||||
+ }
|
||||
+#endif /* HAVE_LIBRCC */
|
||||
+}
|
||||
+
|
||||
+void rccPatchInit() {
|
||||
+#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 rccPatchSetContext(void *newctx) {
|
||||
+#ifdef HAVE_LIBRCC
|
||||
+ if (newctx) {
|
||||
+ ctx = (rcc_context)newctx;
|
||||
+ rcc_initialized = 1;
|
||||
+ }
|
||||
+#endif /* HAVE_LIBRCC */
|
||||
+}
|
||||
+
|
||||
+static void rccPatchTryInit() {
|
||||
+#ifdef HAVE_LIBRCC
|
||||
+ if (!rcc_initialized) {
|
||||
+ rccPatchInit();
|
||||
+ if (rcc_initialized) atexit(rccPatchFree);
|
||||
+ }
|
||||
+#endif /* HAVE_LIBRCC */
|
||||
+}
|
||||
+
|
||||
+
|
||||
+TagLib::ByteVector rccPatchRecodeOutput(const std::string &s) {
|
||||
+ TagLib::ByteVector v;
|
||||
+#ifdef HAVE_LIBRCC
|
||||
+ size_t rlen;
|
||||
+ char *res;
|
||||
+
|
||||
+ rccPatchTryInit();
|
||||
+
|
||||
+ res = rccSizedRecode(ctx, UTF_CLASS, OUT_CLASS, s.c_str(), s.length(), &rlen);
|
||||
+ if (res) v.setData(res, rlen);
|
||||
+ else v.setData(s.c_str(), s.length());
|
||||
+
|
||||
+ return v;
|
||||
+#else
|
||||
+ v.setData("", 0);
|
||||
+
|
||||
+ return v;
|
||||
+#endif /* HAVE_LIBRCC */
|
||||
+}
|
||||
+
|
||||
+TagLib::ByteVector rccPatchRecodeOutputID3(const std::string &s, bool v2 = false) {
|
||||
+ TagLib::ByteVector v;
|
||||
+#ifdef HAVE_LIBRCC
|
||||
+ size_t rlen;
|
||||
+ char *res;
|
||||
+
|
||||
+ rccPatchTryInit();
|
||||
+
|
||||
+ res = rccSizedRecode(ctx, UTF_CLASS, v2?ID3V2_CLASS:ID3_CLASS, s.c_str(), s.length(), &rlen);
|
||||
+ if (res) v.setData(res, rlen);
|
||||
+ else v.setData(s.c_str(), s.length());
|
||||
+
|
||||
+ return v;
|
||||
+#else
|
||||
+ v.setData("", 0);
|
||||
+
|
||||
+ return v;
|
||||
+#endif /* HAVE_LIBRCC */
|
||||
+}
|
||||
+
|
||||
+TagLib::ByteVector rccPatchRecodeInput(const std::string &s) {
|
||||
+ TagLib::ByteVector v;
|
||||
+#ifdef HAVE_LIBRCC
|
||||
+ size_t rlen;
|
||||
+ char *res;
|
||||
+
|
||||
+ rccPatchTryInit();
|
||||
+
|
||||
+ res = rccSizedRecode(ctx, OUT_CLASS, UTF_CLASS, s.c_str(), s.length(), &rlen);
|
||||
+ if (res) v.setData(res, rlen);
|
||||
+ else v.setData(s.c_str(), s.length());
|
||||
+
|
||||
+ return v;
|
||||
+#else
|
||||
+ v.setData("", 0);
|
||||
+
|
||||
+ return v;
|
||||
+#endif /* HAVE_LIBRCC */
|
||||
+}
|
||||
+
|
||||
+TagLib::ByteVector rccPatchRecodeInputID3(const std::string &s, bool v2 = false) {
|
||||
+ TagLib::ByteVector v;
|
||||
+#ifdef HAVE_LIBRCC
|
||||
+ size_t rlen;
|
||||
+ char *res;
|
||||
+
|
||||
+ rccPatchTryInit();
|
||||
+
|
||||
+ res = rccSizedRecode(ctx, v2?ID3V2_CLASS:ID3_CLASS, UTF_CLASS, s.c_str(), s.length(), &rlen);
|
||||
+ if (res) v.setData(res, rlen);
|
||||
+ else v.setData(s.c_str(), s.length());
|
||||
+
|
||||
+ return v;
|
||||
+#else
|
||||
+ v.setData("", 0);
|
||||
+
|
||||
+ return v;
|
||||
+#endif /* HAVE_LIBRCC */
|
||||
+}
|
||||
+
|
||||
+TagLib::String::Type rccPatchGetLocaleType() {
|
||||
+#ifdef HAVE_LIBRCC
|
||||
+ size_t len;
|
||||
+ char charset[32];
|
||||
+
|
||||
+ rccPatchTryInit();
|
||||
+
|
||||
+ 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 rccPatchGetID3Type() {
|
||||
+#ifdef HAVE_LIBRCC
|
||||
+ size_t len;
|
||||
+ const char *charset;
|
||||
+
|
||||
+ rccPatchTryInit();
|
||||
+
|
||||
+ 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;
|
||||
+ }
|
||||
+#endif /* HAVE_LIBRCC */
|
||||
+ return TagLib::String::Latin1;
|
||||
+}
|
||||
--- taglib/toolkit/rccpatch.h.orig 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ taglib/toolkit/rccpatch.h 2008-11-20 15:24:19.000000000 +0100
|
||||
@@ -0,0 +1,20 @@
|
||||
+#ifndef _RCC_PATCH_H
|
||||
+#define _RCC_PATCH_H
|
||||
+
|
||||
+#include <string.h>
|
||||
+#include "tstring.h"
|
||||
+#include "tbytevector.h"
|
||||
+
|
||||
+void rccPatchFree();
|
||||
+void rccPatchInit();
|
||||
+void rccPatchSetContext(void *newctx);
|
||||
+
|
||||
+TagLib::ByteVector rccPatchRecodeOutput(const std::string &s);
|
||||
+TagLib::ByteVector rccPatchRecodeInput(const std::string &s);
|
||||
+TagLib::ByteVector rccPatchRecodeOutputID3(const std::string &s, bool v2 = false);
|
||||
+TagLib::ByteVector rccPatchRecodeInputID3(const std::string &s, bool v2 = false);
|
||||
+
|
||||
+TagLib::String::Type rccPatchGetLocaleType();
|
||||
+TagLib::String::Type rccPatchGetID3Type();
|
||||
+
|
||||
+#endif /* _RCC_PATCH_H */
|
||||
--- taglib/toolkit/tstring.cpp.orig 2008-02-04 16:14:45.000000000 +0100
|
||||
+++ taglib/toolkit/tstring.cpp 2008-11-20 15:24:21.000000000 +0100
|
||||
@@ -23,6 +23,7 @@
|
||||
* http://www.mozilla.org/MPL/ *
|
||||
***************************************************************************/
|
||||
|
||||
+#include "rccpatch.h"
|
||||
#include "tstring.h"
|
||||
#include "unicode.h"
|
||||
#include "tdebug.h"
|
||||
@@ -167,7 +168,7 @@
|
||||
if(v.isEmpty())
|
||||
return;
|
||||
|
||||
- if(t == Latin1 || t == UTF8) {
|
||||
+ if(t == Latin1 || t == Latin1ID3 || t == Latin1ID3V2 || t == UTF8) {
|
||||
|
||||
int length = 0;
|
||||
d->data.resize(v.size());
|
||||
@@ -358,10 +359,21 @@
|
||||
{
|
||||
ByteVector v;
|
||||
|
||||
- switch(t) {
|
||||
+ if (t == Locale) t = rccPatchGetLocaleType();
|
||||
|
||||
+ switch(t) {
|
||||
+ case Locale:
|
||||
case Latin1:
|
||||
+ case Latin1ID3:
|
||||
+ case Latin1ID3V2:
|
||||
{
|
||||
+ std::string s = to8Bit(true);
|
||||
+ if (t == Latin1ID3) v = rccPatchRecodeOutputID3(s, false);
|
||||
+ else if (t == Latin1ID3V2) v = rccPatchRecodeOutputID3(s, true);
|
||||
+ else /* if (t == Latin1(Locale) */ v = rccPatchRecodeOutput(s);
|
||||
+
|
||||
+ if (v.size()) return v;
|
||||
+
|
||||
for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); it++)
|
||||
v.append(char(*it));
|
||||
break;
|
||||
@@ -692,6 +704,31 @@
|
||||
|
||||
void String::prepare(Type t)
|
||||
{
|
||||
+ if (t == Locale) t = rccPatchGetLocaleType();
|
||||
+
|
||||
+ if ((t == Latin1)||(t == Latin1ID3)||(t == Latin1ID3V2)) {
|
||||
+ std::string s = to8Bit(false);
|
||||
+ ByteVector v;
|
||||
+
|
||||
+ if (t == Latin1ID3) v = rccPatchRecodeInputID3(s, false);
|
||||
+ else if (t == Latin1ID3V2) v = rccPatchRecodeInputID3(s, true);
|
||||
+ else /* Latin1 converted from Locale */ v = rccPatchRecodeInput(s);
|
||||
+
|
||||
+ if (v.size()) {
|
||||
+ int length = 0;
|
||||
+ d->data.resize(v.size());
|
||||
+ wstring::iterator targetIt = d->data.begin();
|
||||
+ for(ByteVector::ConstIterator it = v.begin(); it != v.end() && (*it); ++it) {
|
||||
+ *targetIt = uchar(*it);
|
||||
+ ++targetIt;
|
||||
+ ++length;
|
||||
+ }
|
||||
+ d->data.resize(length);
|
||||
+ }
|
||||
+
|
||||
+ t = UTF8;
|
||||
+ }
|
||||
+
|
||||
switch(t) {
|
||||
case UTF16:
|
||||
{
|
||||
@@ -781,6 +818,27 @@
|
||||
|
||||
std::ostream &operator<<(std::ostream &s, const String &str)
|
||||
{
|
||||
- s << str.to8Bit();
|
||||
+ ByteVector bv = str.data(String::Locale);
|
||||
+ s << bv;
|
||||
return s;
|
||||
}
|
||||
+
|
||||
+String::Type String::ID3Type(int i) {
|
||||
+ if (i == Latin1) return Latin1ID3V2;
|
||||
+ return Type(i);
|
||||
+};
|
||||
+
|
||||
+String::Type String::ID3WType(Type type) {
|
||||
+ Type rcc_type = rccPatchGetID3Type();
|
||||
+ if ((rcc_type == Latin1ID3)||(rcc_type == Latin1ID3V2)) {
|
||||
+ if (type == Latin1) return rcc_type;
|
||||
+ return type;
|
||||
+ }
|
||||
+
|
||||
+ return rcc_type;
|
||||
+};
|
||||
+
|
||||
+String::Type String::ID3RealType(Type type) {
|
||||
+ if ((type == Latin1ID3)||(type == Latin1ID3V2)) return Latin1;
|
||||
+ return type;
|
||||
+}
|
||||
--- taglib/toolkit/tstring.h.orig 2008-02-04 16:14:45.000000000 +0100
|
||||
+++ taglib/toolkit/tstring.h 2008-11-20 15:24:21.000000000 +0100
|
||||
@@ -81,6 +81,18 @@
|
||||
*/
|
||||
enum Type {
|
||||
/*!
|
||||
+ * Determine using current locale settings
|
||||
+ */
|
||||
+ Locale = -1,
|
||||
+ /*!
|
||||
+ * Latin1 for ID3 tags.
|
||||
+ */
|
||||
+ Latin1ID3 = 65,
|
||||
+ /*!
|
||||
+ * Latin1 for ID3 tags.
|
||||
+ */
|
||||
+ Latin1ID3V2 = 66,
|
||||
+ /*!
|
||||
* IS08859-1, or <i>Latin1</i> encoding. 8 bit characters.
|
||||
*/
|
||||
Latin1 = 0,
|
||||
@@ -103,6 +115,10 @@
|
||||
UTF16LE = 4
|
||||
};
|
||||
|
||||
+ static Type ID3Type(int i);
|
||||
+ static Type ID3WType(Type type);
|
||||
+ static Type ID3RealType(Type type);
|
||||
+
|
||||
/*!
|
||||
* Constructs an empty String.
|
||||
*/
|
||||
--- taglib/CMakeLists.txt.orig 2008-02-12 05:15:20.000000000 +0100
|
||||
+++ taglib/CMakeLists.txt 2008-11-20 15:58:31.000000000 +0100
|
||||
@@ -17,6 +17,11 @@
|
||||
${CMAKE_CURRENT_BINARY_DIR}/taglib
|
||||
${CMAKE_CURRENT_BINARY_DIR}/..
|
||||
)
|
||||
+
|
||||
+if(HAVE_LIBRCC)
|
||||
+ INCLUDE_DIRECTORIES(${RCC_INCLUDE_DIR})
|
||||
+endif(HAVE_LIBRCC)
|
||||
+
|
||||
if(ZLIB_FOUND)
|
||||
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
|
||||
endif(ZLIB_FOUND)
|
||||
@@ -119,6 +119,7 @@
|
||||
)
|
||||
|
||||
SET(toolkit_SRCS
|
||||
+toolkit/rccpatch.cpp
|
||||
toolkit/tstring.cpp
|
||||
toolkit/tstringlist.cpp
|
||||
toolkit/tbytevector.cpp
|
||||
@@ -140,7 +141,7 @@
|
||||
|
||||
ADD_LIBRARY(tag SHARED ${tag_LIB_SRCS})
|
||||
|
||||
-TARGET_LINK_LIBRARIES(tag )
|
||||
+TARGET_LINK_LIBRARIES(tag ${RCC_LIBRARIES})
|
||||
if(ZLIB_FOUND)
|
||||
TARGET_LINK_LIBRARIES(tag ${ZLIB_LIBRARIES})
|
||||
endif(ZLIB_FOUND)
|
|
@ -1,7 +1,13 @@
|
|||
bin/taglib-config
|
||||
include/taglib/aifffile.h
|
||||
include/taglib/aiffproperties.h
|
||||
include/taglib/apefooter.h
|
||||
include/taglib/apeitem.h
|
||||
include/taglib/apetag.h
|
||||
include/taglib/asfattribute.h
|
||||
include/taglib/asffile.h
|
||||
include/taglib/asfproperties.h
|
||||
include/taglib/asftag.h
|
||||
include/taglib/attachedpictureframe.h
|
||||
include/taglib/audioproperties.h
|
||||
include/taglib/commentsframe.h
|
||||
|
@ -18,6 +24,12 @@ include/taglib/id3v2framefactory.h
|
|||
include/taglib/id3v2header.h
|
||||
include/taglib/id3v2synchdata.h
|
||||
include/taglib/id3v2tag.h
|
||||
include/taglib/mp4atom.h
|
||||
include/taglib/mp4coverart.h
|
||||
include/taglib/mp4file.h
|
||||
include/taglib/mp4item.h
|
||||
include/taglib/mp4properties.h
|
||||
include/taglib/mp4tag.h
|
||||
include/taglib/mpcfile.h
|
||||
include/taglib/mpcproperties.h
|
||||
include/taglib/mpegfile.h
|
||||
|
@ -27,12 +39,17 @@ include/taglib/oggfile.h
|
|||
include/taglib/oggflacfile.h
|
||||
include/taglib/oggpage.h
|
||||
include/taglib/oggpageheader.h
|
||||
include/taglib/popularimeterframe.h
|
||||
include/taglib/privateframe.h
|
||||
%%RCC%%include/taglib/rccpatch.h
|
||||
include/taglib/relativevolumeframe.h
|
||||
include/taglib/rifffile.h
|
||||
include/taglib/speexfile.h
|
||||
include/taglib/speexproperties.h
|
||||
include/taglib/tag.h
|
||||
include/taglib/tag_c.h
|
||||
include/taglib/taglib.h
|
||||
include/taglib/taglib_config.h
|
||||
include/taglib/taglib_export.h
|
||||
include/taglib/tbytevector.h
|
||||
include/taglib/tbytevectorlist.h
|
||||
|
@ -52,19 +69,18 @@ include/taglib/unsynchronizedlyricsframe.h
|
|||
include/taglib/urllinkframe.h
|
||||
include/taglib/vorbisfile.h
|
||||
include/taglib/vorbisproperties.h
|
||||
include/taglib/wavfile.h
|
||||
include/taglib/wavpackfile.h
|
||||
include/taglib/wavpackproperties.h
|
||||
include/taglib/wavproperties.h
|
||||
include/taglib/xingheader.h
|
||||
include/taglib/xiphcomment.h
|
||||
lib/libtag.a
|
||||
lib/libtag.la
|
||||
lib/libtag.so
|
||||
lib/libtag.so.6
|
||||
lib/libtag_c.a
|
||||
lib/libtag_c.la
|
||||
lib/libtag.so.1
|
||||
lib/libtag.so.1.6.1
|
||||
lib/libtag_c.so
|
||||
lib/libtag_c.so.0
|
||||
lib/libtag_c.so.0.0.0
|
||||
libdata/pkgconfig/taglib.pc
|
||||
libdata/pkgconfig/taglib_c.pc
|
||||
@dirrm include/taglib
|
||||
@dirrmtry lib/pkgconfig
|
||||
|
|
Loading…
Add table
Reference in a new issue