[mingw-id3lib] Apply several patches from the Debian package
David King
amigadave at fedoraproject.org
Fri Nov 14 19:47:32 UTC 2014
commit 8454f7a7240aaf3f8badd1f98ff4a5515f73cdc0
Author: David King <amigadave at amigadave.com>
Date: Fri Nov 14 17:25:16 2014 +0000
Apply several patches from the Debian package
Similar to the corresponding change in the native package (#1164332).
60-fix_make_check.patch | 50 +++++++++++++++++++++++++++++
60-id3lib-missing-nullpointer-check.patch | 12 +++++++
id3lib-3.8.3-fix-utf16-stringlists.patch | 23 +++++++++++++
mingw-id3lib.spec | 15 ++++++++-
4 files changed, 99 insertions(+), 1 deletions(-)
---
diff --git a/60-fix_make_check.patch b/60-fix_make_check.patch
new file mode 100644
index 0000000..e2bb1b0
--- /dev/null
+++ b/60-fix_make_check.patch
@@ -0,0 +1,50 @@
+This patch fixes some function headers and imports in order for 'make check'
+to work.
+
+It was first introduced in version 3.8.3-9
+diff -Naur id3lib-3.8.3.orig/examples/findeng.cpp id3lib-3.8.3/examples/findeng.cpp
+--- id3lib-3.8.3.orig/examples/findeng.cpp 2003-03-02 01:23:00.000000000 +0100
++++ id3lib-3.8.3/examples/findeng.cpp 2009-12-10 00:58:12.173795997 +0100
+@@ -9,7 +9,7 @@
+ using std::cout;
+ using std::endl;
+
+-int main(unsigned argc, char* argv[])
++int main(int argc, char* argv[])
+ {
+ ID3D_INIT_DOUT();
+ ID3D_INIT_WARNING();
+diff -Naur id3lib-3.8.3.orig/examples/findstr.cpp id3lib-3.8.3/examples/findstr.cpp
+--- id3lib-3.8.3.orig/examples/findstr.cpp 2003-03-02 01:23:00.000000000 +0100
++++ id3lib-3.8.3/examples/findstr.cpp 2009-12-10 00:57:48.036819825 +0100
+@@ -9,7 +9,7 @@
+ using std::cout;
+ using std::endl;
+
+-int main(unsigned argc, char* argv[])
++int main(int argc, char* argv[])
+ {
+ ID3D_INIT_DOUT();
+ ID3D_INIT_WARNING();
+diff -Naur id3lib-3.8.3.orig/examples/test_io.cpp id3lib-3.8.3/examples/test_io.cpp
+--- id3lib-3.8.3.orig/examples/test_io.cpp 2003-03-02 01:23:00.000000000 +0100
++++ id3lib-3.8.3/examples/test_io.cpp 2009-12-10 00:57:03.612111640 +0100
+@@ -11,6 +11,9 @@
+ #include <id3/io_strings.h>
+ #include <id3/utils.h>
+
++using std::cin;
++using std::hex;
++using std::dec;
+ using std::cout;
+ using std::endl;
+ using std::cerr;
+@@ -18,7 +21,7 @@
+ using namespace dami;
+
+ int
+-main(size_t argc, const char** argv)
++main(int argc, const char** argv)
+ {
+ ID3D_INIT_DOUT();
+ ID3D_INIT_WARNING();
diff --git a/60-id3lib-missing-nullpointer-check.patch b/60-id3lib-missing-nullpointer-check.patch
new file mode 100644
index 0000000..d4ca5d2
--- /dev/null
+++ b/60-id3lib-missing-nullpointer-check.patch
@@ -0,0 +1,12 @@
+This patch adds a check for a null pointer
+--- a/src/header_tag.cpp
++++ b/src/header_tag.cpp
+@@ -54,7 +54,7 @@
+ {
+ size_t bytesUsed = ID3_TagHeader::SIZE;
+
+- if (_info->is_extended)
++ if (_info && _info->is_extended)
+ {
+ bytesUsed += _info->extended_bytes;
+ }
diff --git a/id3lib-3.8.3-fix-utf16-stringlists.patch b/id3lib-3.8.3-fix-utf16-stringlists.patch
new file mode 100644
index 0000000..c7c7506
--- /dev/null
+++ b/id3lib-3.8.3-fix-utf16-stringlists.patch
@@ -0,0 +1,23 @@
+Based on a Debian patch by Urs Fleisch <urs.fleisch at gmail.com>
+https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=680915
+diff -urN id3lib-3.8.3.old/src/io_helpers.cpp id3lib-3.8.3/src/io_helpers.cpp
+--- id3lib-3.8.3.old/src/io_helpers.cpp 2014-11-14 14:54:49.492964576 +0000
++++ id3lib-3.8.3/src/io_helpers.cpp 2014-11-14 14:53:25.304945568 +0000
+@@ -364,10 +364,17 @@
+ unicode_t BOM = 0xFEFF;
+ writer.writeChars((const unsigned char*) &BOM, 2);
+ const unsigned char* pdata = (const unsigned char*)data.c_str();
++ unicode_t lastCh = BOM;
+ for (size_t i = 0; i < size; i += 2)
+ {
+ unicode_t ch = (pdata[i] << 8) | pdata[i+1];
++ if (lastCh == 0 && ch != BOM)
++ {
++ // Last character was NULL, so start next string with BOM.
++ writer.writeChars((const unsigned char*) &BOM, 2);
++ }
+ writer.writeChars((const unsigned char*) &ch, 2);
++ lastCh = ch;
+ }
+ }
+ return writer.getCur() - beg;
diff --git a/mingw-id3lib.spec b/mingw-id3lib.spec
index 16cbfbb..2c9bdf3 100644
--- a/mingw-id3lib.spec
+++ b/mingw-id3lib.spec
@@ -5,7 +5,7 @@
Summary: Library for manipulating ID3v1 and ID3v2 tags
Name: mingw-%{_basename}
Version: 3.8.3
-Release: 33%{?dist}
+Release: 34%{?dist}
License: LGPLv2+
Group: System Environment/Libraries
URL: http://www.id3lib.sourceforge.net/
@@ -16,6 +16,9 @@ Patch2: id3lib-3.8.3-includes.patch
Patch3: http://launchpadlibrarian.net/33114077/id3lib-vbr_buffer_overflow.diff
Patch4: id3lib-3.8.3-autoreconf.patch
Patch5: id3lib-3.8.3-mingw.patch
+Patch6: http://anonscm.debian.org/viewvc/collab-maint/deb-maint/id3lib/trunk/debian/patches/60-fix_make_check.patch
+Patch7: http://anonscm.debian.org/viewvc/collab-maint/deb-maint/id3lib/trunk/debian/patches/60-id3lib-missing-nullpointer-check.patch
+Patch8: id3lib-3.8.3-fix-utf16-stringlists.patch
BuildArch: noarch
BuildRequires: autoconf
BuildRequires: automake
@@ -107,6 +110,9 @@ These are the MinGW tools, built for the win64 target.
%patch3 -p1
%patch4 -p1 -b .autoreconf
%patch5 -p1 -b .mingw
+%patch6 -p1 -b .make-check
+%patch7 -p1 -b .nullpointer
+%patch8 -p1 -b .string-lists
chmod -x src/*.h src/*.cpp include/id3/*.h
iconv -f ISO-8859-1 -t UTF8 ChangeLog > tmp && \
touch -r ChangeLog tmp && \
@@ -128,6 +134,10 @@ rm -f %{buildroot}/%{mingw32_libdir}/*.la
rm -f %{buildroot}/%{mingw64_libdir}/*.la
+%check
+%{mingw_make} check
+
+
%files -n mingw32-%{_basename}
%doc AUTHORS COPYING ChangeLog HISTORY NEWS README THANKS TODO
%{mingw32_bindir}/libid3-3-8-3.dll
@@ -156,6 +166,9 @@ rm -f %{buildroot}/%{mingw64_libdir}/*.la
%changelog
+* Fri Nov 14 2014 David King <amigadave at amigadave.com> - 3.8.3-34
+- Apply several patches from the Debian package
+
* Mon Sep 29 2014 David King <amigadave at amigadave.com> - 3.8.3-33
- Preserve timestamps during install
More information about the scm-commits
mailing list