[vlc-devel] [PATCH] contrib:taglib: use a more recent taglib needing less patches

Steve Lhomme robux4 at videolabs.io
Sat Jan 30 09:26:47 CET 2016


From: Steve Lhomme <robUx4 at gmail.com>

---
 .../0002-Rewrote-ByteVector-replace-simpler.patch  | 131 ---------------------
 contrib/src/taglib/SHA512SUMS                      |   2 +-
 contrib/src/taglib/fix-atomic-checks.patch         |  50 --------
 contrib/src/taglib/rules.mak                       |   5 +-
 contrib/src/taglib/taglib-pc.patch                 |  13 --
 5 files changed, 2 insertions(+), 199 deletions(-)
 delete mode 100644 contrib/src/taglib/0002-Rewrote-ByteVector-replace-simpler.patch
 delete mode 100644 contrib/src/taglib/fix-atomic-checks.patch
 delete mode 100644 contrib/src/taglib/taglib-pc.patch

diff --git a/contrib/src/taglib/0002-Rewrote-ByteVector-replace-simpler.patch b/contrib/src/taglib/0002-Rewrote-ByteVector-replace-simpler.patch
deleted file mode 100644
index cf17e6c..0000000
--- a/contrib/src/taglib/0002-Rewrote-ByteVector-replace-simpler.patch
+++ /dev/null
@@ -1,131 +0,0 @@
-From 4a7d31c87bf41c1de21cb725176d5b34c2a95720 Mon Sep 17 00:00:00 2001
-From: Tsuda Kageyu <tsuda.kageyu at gmail.com>
-Date: Thu, 14 Nov 2013 14:05:32 +0900
-Subject: [PATCH 2/3] 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.5.2
-
diff --git a/contrib/src/taglib/SHA512SUMS b/contrib/src/taglib/SHA512SUMS
index 936ebe1..37d0915 100644
--- a/contrib/src/taglib/SHA512SUMS
+++ b/contrib/src/taglib/SHA512SUMS
@@ -1 +1 @@
-63a4f06b88b33be716dde3111e62a624995bc020127c9d22f63e918a535ebba858c59308ca4295eeedb29dc72b87d6673db5483f20d9dbf3f56cd93c7ba7ed58  taglib-1.9.1.tar.gz
+881b3dc3bee27f199f8a7eefc5a4e35a69555c5244eb5cb34856e733b1e4f33fd3085e0608c7b128c247a71b407faedd488902dee5e632858c610d8f7b7ee67c  taglib-1.10beta.tar.gz
diff --git a/contrib/src/taglib/fix-atomic-checks.patch b/contrib/src/taglib/fix-atomic-checks.patch
deleted file mode 100644
index abad12e..0000000
--- a/contrib/src/taglib/fix-atomic-checks.patch
+++ /dev/null
@@ -1,50 +0,0 @@
---- tablib_orig/taglib/toolkit/trefcounter.h	2015-10-09 14:09:14.162193621 +0200
-+++ taglib/taglib/toolkit/trefcounter.h	2015-10-09 14:39:37.009992159 +0200
-@@ -29,21 +29,13 @@
- #include "taglib_export.h"
- #include "taglib.h"
- 
--#ifdef __APPLE__
-+#if defined(HAVE_MAC_ATOMIC)
- #  include <libkern/OSAtomic.h>
--#  define TAGLIB_ATOMIC_MAC
--#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-+#elif defined(HAVE_WIN_ATOMIC)
- #  define NOMINMAX
- #  include <windows.h>
--#  define TAGLIB_ATOMIC_WIN
--#elif defined (__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 401)    \
--      && (defined(__i386__) || defined(__i486__) || defined(__i586__) || \
--          defined(__i686__) || defined(__x86_64) || defined(__ia64)) \
--      && !defined(__INTEL_COMPILER)
--#  define TAGLIB_ATOMIC_GCC
--#elif defined(__ia64) && defined(__INTEL_COMPILER)
-+#elif defined(HAVE_IA64_ATOMIC)
- #  include <ia64intrin.h>
--#  define TAGLIB_ATOMIC_GCC
- #endif
- 
- #ifndef DO_NOT_DOCUMENT // Tell Doxygen to skip this class.
-@@ -77,19 +69,19 @@
-   public:
-     RefCounterOld() : refCount(1) {}
- 
--#ifdef TAGLIB_ATOMIC_MAC
-+#if defined(HAVE_MAC_ATOMIC)
-     void ref() { OSAtomicIncrement32Barrier(const_cast<int32_t*>(&refCount)); }
-     bool deref() { return ! OSAtomicDecrement32Barrier(const_cast<int32_t*>(&refCount)); }
-     int32_t count() { return refCount; }
-   private:
-     volatile int32_t refCount;
--#elif defined(TAGLIB_ATOMIC_WIN)
-+#elif defined(HAVE_WIN_ATOMIC)
-     void ref() { InterlockedIncrement(&refCount); }
-     bool deref() { return ! InterlockedDecrement(&refCount); }
-     long count() { return refCount; }
-   private:
-     volatile long refCount;
--#elif defined(TAGLIB_ATOMIC_GCC)
-+#elif defined(HAVE_GCC_ATOMIC)
-     void ref() { __sync_add_and_fetch(&refCount, 1); }
-     bool deref() { return ! __sync_sub_and_fetch(&refCount, 1); }
-     int count() { return refCount; }
diff --git a/contrib/src/taglib/rules.mak b/contrib/src/taglib/rules.mak
index d723665..8c6afb4 100644
--- a/contrib/src/taglib/rules.mak
+++ b/contrib/src/taglib/rules.mak
@@ -1,6 +1,6 @@
 # TagLib
 
-TAGLIB_VERSION := 1.9.1
+TAGLIB_VERSION := 1.10beta
 TAGLIB_URL := http://taglib.github.io/releases/taglib-$(TAGLIB_VERSION).tar.gz
 
 PKGS += taglib
@@ -15,9 +15,6 @@ $(TARBALLS)/taglib-$(TAGLIB_VERSION).tar.gz:
 
 taglib: taglib-$(TAGLIB_VERSION).tar.gz .sum-taglib
 	$(UNPACK)
-	$(APPLY) $(SRC)/taglib/taglib-pc.patch
-	$(APPLY) $(SRC)/taglib/0002-Rewrote-ByteVector-replace-simpler.patch
-	$(APPLY) $(SRC)/taglib/fix-atomic-checks.patch
 	$(MOVE)
 
 .taglib: taglib toolchain.cmake
diff --git a/contrib/src/taglib/taglib-pc.patch b/contrib/src/taglib/taglib-pc.patch
deleted file mode 100644
index 977034f..0000000
--- a/contrib/src/taglib/taglib-pc.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- taglib-1.8/CMakeLists.txt.orig	2012-09-06 20:03:15.000000000 +0200
-+++ taglib-1.8/CMakeLists.txt	2012-09-27 15:24:05.840067656 +0200
-@@ -69,10 +69,8 @@
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/taglib-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/taglib-config )
- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/taglib-config DESTINATION ${BIN_INSTALL_DIR})
- 
--if(NOT WIN32 AND NOT BUILD_FRAMEWORK)
-   configure_file(${CMAKE_CURRENT_SOURCE_DIR}/taglib.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/taglib.pc )
-   install(FILES ${CMAKE_CURRENT_BINARY_DIR}/taglib.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
--endif()
- 
- include_directories(${CMAKE_CURRENT_BINARY_DIR})
- configure_file(config-taglib.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
-- 
2.6.0.windows.1



More information about the vlc-devel mailing list