[easytag/wip/flatpak: 1/4] Add manifest for flatpak



commit eacededde339486f459fa12e8a13d7a9b49f328a
Author: David King <amigadave amigadave com>
Date:   Thu May 12 16:46:26 2016 +0100

    Add manifest for flatpak
    
    Add a manifest that includes all the dependencies which are not present
    in the GNOME runtime. Copy patches from the Fedora (and Debian)
    packages. Include a custom patch for the libid3tag pkg-config file, as
    it is not easy to include an extra source file and then install it
    (without modifying the build system).

 data/flatpak/easytag.json                          |  143 ++++++++++++++++++
 data/flatpak/id3lib-3.8.3-autoreconf.patch         |  155 ++++++++++++++++++++
 .../id3lib-3.8.3-fix-utf16-stringlists.patch       |   23 +++
 data/flatpak/id3lib-3.8.3-includes.patch           |   95 ++++++++++++
 data/flatpak/id3lib-3.8.3-io_helpers-163101.patch  |   15 ++
 .../id3lib-3.8.3-missing-nullpointer-check.patch   |   12 ++
 data/flatpak/id3lib-3.8.3-mkstemp.patch            |   49 ++++++
 data/flatpak/id3lib-vbr_buffer_overflow.patch      |   12 ++
 data/flatpak/libid3tag-0.15.1b-fix_overflow.patch  |   11 ++
 data/flatpak/libid3tag-0.15.1b-pkgconfig.patch     |   45 ++++++
 10 files changed, 560 insertions(+), 0 deletions(-)
---
diff --git a/data/flatpak/easytag.json b/data/flatpak/easytag.json
new file mode 100644
index 0000000..98a5c4e
--- /dev/null
+++ b/data/flatpak/easytag.json
@@ -0,0 +1,143 @@
+{
+    "id": "org.gnome.EasyTAG",
+    "version": "master",
+    "runtime": "org.gnome.Platform",
+    "runtime-version": "3.20",
+    "sdk": "org.gnome.Sdk",
+    "command": "easytag",
+    "rename-appdata-file": "easytag.appdata.xml",
+    "rename-desktop-file": "easytag.desktop",
+    "rename-icon": "easytag",
+    "finish-args": ["--filesystem=host",
+                    "--share=ipc",
+                    "--share=network",
+                    "--socket=x11",
+                    "--socket=wayland",
+                    "--socket=session-bus",
+                    "--filesystem=~/.config/dconf:ro",
+                    "--filesystem=xdg-run/dconf",
+                    "--talk-name=ca.desrt.dconf",
+                    "--env=DCONF_USER_CONFIG_DIR=.config/dconf"],
+    "cleanup": [ "/include", "/lib/pkgconfig", "/lib/*.a", "/lib/*.la" ],
+    "modules": [
+        {
+            "name": "id3lib",
+            "cleanup": [ "/bin" ],
+            "sources": [
+                {
+                    "type": "archive",
+                    "url": "http://downloads.sourceforge.net/id3lib/id3lib-3.8.3.tar.gz";,
+                    "sha256": "2749cc3c0cd7280b299518b1ddf5a5bcfe2d1100614519b68702230e26c7d079"
+                },
+                {
+                    "type": "patch",
+                    "path": "id3lib-3.8.3-autoreconf.patch"
+                },
+                {
+                    "type": "patch",
+                    "path": "id3lib-3.8.3-io_helpers-163101.patch"
+                },
+                {
+                    "type": "patch",
+                    "path": "id3lib-3.8.3-mkstemp.patch"
+                },
+                {
+                    "type": "patch",
+                    "path": "id3lib-3.8.3-includes.patch"
+                },
+                {
+                    "type": "patch",
+                    "path": "id3lib-vbr_buffer_overflow.patch"
+                },
+                {
+                    "type": "patch",
+                    "path": "id3lib-3.8.3-missing-nullpointer-check.patch"
+                },
+                {
+                    "type": "patch",
+                    "path": "id3lib-3.8.3-fix-utf16-stringlists.patch"
+                }
+            ]
+        },
+        {
+            "name": "libid3tag",
+            "cleanup": [ "/bin" ],
+            "rm-configure": true,
+            "sources": [
+                {
+                    "type": "archive",
+                    "url": "http://downloads.sourceforge.net/mad/libid3tag-0.15.1b.tar.gz";,
+                    "sha256": "63da4f6e7997278f8a3fef4c6a372d342f705051d1eeb6a46a86b03610e26151"
+                },
+                {
+                    "type": "patch",
+                    "path": "libid3tag-0.15.1b-fix_overflow.patch",
+                    "strip-components": 0
+                },
+                {
+                    "type": "patch",
+                    "path": "libid3tag-0.15.1b-pkgconfig.patch"
+                },
+                {
+                    "type": "script",
+                    "commands": [ "autoreconf --force --install" ]
+                }
+            ]
+        },
+        {
+            "name": "opus",
+            "cleanup": [ "/share/aclocal" ],
+            "config-opts": [ "--disable-doc", "--disable-extra-programs" ],
+            "sources": [
+                {
+                    "type": "archive",
+                    "url": "http://downloads.xiph.org/releases/opus/opus-1.1.2.tar.gz";,
+                    "sha256": "0e290078e31211baa7b5886bcc8ab6bc048b9fc83882532da4a1a45e58e907fd"
+                }
+            ]
+        },
+        {
+            "name": "opusfile",
+            "config-opts": [ "--disable-doc", "--disable-examples" ],
+            "sources": [
+                {
+                    "type": "archive",
+                    "url": "http://downloads.xiph.org/releases/opus/opusfile-0.7.tar.gz";,
+                    "sha256": "9e2bed13bc729058591a0f1cab2505e8cfd8e7ac460bf10a78bcc3b125e7c301"
+                }
+            ]
+        },
+        {
+            "name": "taglib",
+            "cleanup": [ "/bin" ],
+            "cmake": true,
+            "sources": [
+                {
+                    "type": "archive",
+                    "url": "http://taglib.github.io/releases/taglib-1.11.tar.gz";,
+                    "sha256": "ed4cabb3d970ff9a30b2620071c2b054c4347f44fc63546dbe06f97980ece288"
+                }
+            ]
+        },
+        {
+            "name": "wavpack",
+            "cleanup": [ "/bin", "/share/man" ],
+            "sources": [
+                {
+                    "type": "archive",
+                    "url": "http://www.wavpack.com/wavpack-4.80.0.tar.bz2";,
+                    "sha256": "79182ea75f7bd1ca931ed230062b435fde4a4c2e0dbcad048007bd1ef1e66be9"
+                }
+            ]
+        },
+        {
+            "name": "easytag",
+            "sources": [
+                {
+                    "type": "git",
+                    "url": "git://git.gnome.org/easytag"
+                }
+            ]
+        }
+    ]
+}
diff --git a/data/flatpak/id3lib-3.8.3-autoreconf.patch b/data/flatpak/id3lib-3.8.3-autoreconf.patch
new file mode 100644
index 0000000..0f0e042
--- /dev/null
+++ b/data/flatpak/id3lib-3.8.3-autoreconf.patch
@@ -0,0 +1,155 @@
+Patch by František Dvořák
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1066559
+
+diff -urN id3lib-3.8.3.old/configure.in id3lib-3.8.3/configure.in
+--- id3lib-3.8.3.old/configure.in      2003-03-02 00:23:00.000000000 +0000
++++ id3lib-3.8.3/configure.in  2014-02-24 21:46:57.974108875 +0000
+@@ -15,7 +15,9 @@
+ AC_PREREQ(2.13)
+ 
+ # init autoconf (and check for presence fo reconf)
+-AC_INIT(reconf)
++AC_INIT([id3lib], [3.8.3])
++AC_CONFIG_SRCDIR([reconf])
++AC_CONFIG_MACRO_DIR([m4])
+ 
+ ID3LIB_NAME=id3lib
+ 
+@@ -83,14 +85,14 @@
+ 
+ AC_SUBST(ID3LIB_FULLNAME)
+ 
+-AM_CONFIG_HEADER(config.h)
++AC_CONFIG_HEADERS(config.h)
+ 
+-AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
++AM_INIT_AUTOMAKE
+ 
+ AC_ISC_POSIX
+ 
+ dnl Initialize libtool
+-AM_PROG_LIBTOOL
++LT_INIT
+ 
+ dnl Initialize maintainer mode
+ AM_MAINTAINER_MODE
+@@ -168,7 +170,7 @@
+               iconv_oldstyle=1, iconv_oldstyle=0)
+   if test $iconv_oldstyle = 1; then
+     AC_MSG_RESULT(const char **)
+-    AC_DEFINE(ID3LIB_ICONV_OLDSTYLE)
++    AC_DEFINE(ID3LIB_ICONV_OLDSTYLE, [], [Old-style iconv interface])
+     #we'll check out the need of
+     #typecast in the call of iconv_open
+     AC_MSG_CHECKING(whether to typecast in iconv)
+@@ -184,7 +186,7 @@
+                    iconv_cast=0, iconv_cast=1)
+     if test $iconv_cast = 1; then
+       AC_MSG_RESULT(yes)
+-      AC_DEFINE(ID3LIB_ICONV_CAST_OK)
++      AC_DEFINE(ID3LIB_ICONV_CAST_OK, [], [iconv type cast])
+     else
+       AC_MSG_RESULT(no)
+     fi
+@@ -206,7 +208,7 @@
+                    iconv_cast=0, iconv_cast=1)
+     if test $iconv_cast = 1; then
+       AC_MSG_RESULT(yes)
+-      AC_DEFINE(ID3LIB_ICONV_CAST_OK)
++      AC_DEFINE(ID3LIB_ICONV_CAST_OK, [], [iconv type cast])
+     else
+       AC_MSG_RESULT(no)
+     fi
+diff -urN id3lib-3.8.3.old/examples/Makefile.am id3lib-3.8.3/examples/Makefile.am
+--- id3lib-3.8.3.old/examples/Makefile.am      2003-03-02 00:23:00.000000000 +0000
++++ id3lib-3.8.3/examples/Makefile.am  2014-02-24 21:21:51.645554552 +0000
+@@ -30,7 +30,7 @@
+ 
+ LDADD =  $(top_builddir)/src/libid3.la $(zlib_lib) $(ID3_DEBUG_LIBS) $(getopt_lib)
+ 
+-INCLUDES = @ID3LIB_DEBUG_FLAGS@ -I$(top_srcdir)/include
++AM_CPPFLAGS = @ID3LIB_DEBUG_FLAGS@ -I$(top_srcdir)/include
+ 
+ bin_PROGRAMS            = id3info id3convert id3tag id3cp
+ check_PROGRAMS          = \
+diff -urN id3lib-3.8.3.old/m4/id3_cxx.m4 id3lib-3.8.3/m4/id3_cxx.m4
+--- id3lib-3.8.3.old/m4/id3_cxx.m4     2003-03-02 00:23:00.000000000 +0000
++++ id3lib-3.8.3/m4/id3_cxx.m4 2014-02-24 21:21:51.650554401 +0000
+@@ -68,7 +68,7 @@
+ dnl #undef CXX_HAS_NO_BOOL
+ dnl END ACCONFIG
+ 
+-AC_DEFUN(ID3_CXX_PORTABILITY,[
++AC_DEFUN([ID3_CXX_PORTABILITY],[
+ 
+   AC_PROVIDE([$0])
+ 
+diff -urN id3lib-3.8.3.old/m4/id3_unicode.m4 id3lib-3.8.3/m4/id3_unicode.m4
+--- id3lib-3.8.3.old/m4/id3_unicode.m4 2003-03-02 00:23:00.000000000 +0000
++++ id3lib-3.8.3/m4/id3_unicode.m4     2014-02-24 21:21:51.654554280 +0000
+@@ -5,7 +5,7 @@
+ dnl #undef ID3_ICONV_FORMAT_ASCII
+ dnl END ACCONFIG
+ 
+-AC_DEFUN(ID3_CHECK_ICONV_FORMAT,[
++AC_DEFUN([ID3_CHECK_ICONV_FORMAT],[
+   if eval "test \"x\$$1\" = \"xno\""; then
+     AC_MSG_CHECKING(whether iconv supports $2)
+     AC_TRY_RUN([#include <iconv.h>
+diff -urN id3lib-3.8.3.old/Makefile.am id3lib-3.8.3/Makefile.am
+--- id3lib-3.8.3.old/Makefile.am       2003-03-02 00:23:00.000000000 +0000
++++ id3lib-3.8.3/Makefile.am   2014-02-24 21:21:51.659554129 +0000
+@@ -11,6 +11,7 @@
+ 
+ # require automake 1.5
+ AUTOMAKE_OPTIONS = 1.5
++ACLOCAL_AMFLAGS = -I m4
+ 
+ EXTRA_DIST =                    \
+         HISTORY                 \
+@@ -30,7 +31,7 @@
+ SUBDIRS =  . m4 $(zlib_subdir) doc include id3com src examples
+ DIST_SUBDIRS = . m4 zlib doc include id3com src examples prj libprj
+ 
+-INCLUDES = @ID3LIB_DEBUG_FLAGS@
++AM_CPPFLAGS = @ID3LIB_DEBUG_FLAGS@
+ 
+ config.h.win32: $(top_builddir)/config.status $(top_srcdir)/config.h.win32.in 
+       cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+diff -urN id3lib-3.8.3.old/src/Makefile.am id3lib-3.8.3/src/Makefile.am
+--- id3lib-3.8.3.old/src/Makefile.am   2003-03-02 00:23:00.000000000 +0000
++++ id3lib-3.8.3/src/Makefile.am       2014-02-24 21:21:51.664553979 +0000
+@@ -17,7 +17,7 @@
+ zlib_include = 
+ endif
+ 
+-INCLUDES = \
++AM_CPPFLAGS = \
+   @ID3LIB_DEBUG_FLAGS@ -I$(top_srcdir)/include/id3 -I$(top_srcdir)/include $(zlib_include)
+ 
+ noinst_HEADERS =                \
+diff -urN id3lib-3.8.3.old/zlib/configure.in id3lib-3.8.3/zlib/configure.in
+--- id3lib-3.8.3.old/zlib/configure.in 2003-03-02 00:23:00.000000000 +0000
++++ id3lib-3.8.3/zlib/configure.in     2014-02-24 21:49:18.990854419 +0000
+@@ -14,16 +14,13 @@
+ AC_PREREQ(2.13)
+ 
+ # init autoconf (and check for presence of reconf)
+-AC_INIT(reconf)
++AC_INIT([zlib], [1.1.3])
+ 
+-VERSION=1.1.3
+-PACKAGE=zlib
+-
+-AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
+-AM_CONFIG_HEADER(config.h)
++AM_INIT_AUTOMAKE
++AC_CONFIG_HEADERS(config.h)
+ 
+ dnl Initialize libtool
+-AC_PROG_LIBTOOL
++LT_INIT
+ 
+ dnl Initialize maintainer mode
+ AM_MAINTAINER_MODE
diff --git a/data/flatpak/id3lib-3.8.3-fix-utf16-stringlists.patch 
b/data/flatpak/id3lib-3.8.3-fix-utf16-stringlists.patch
new file mode 100644
index 0000000..c7c7506
--- /dev/null
+++ b/data/flatpak/id3lib-3.8.3-fix-utf16-stringlists.patch
@@ -0,0 +1,23 @@
+Based on a Debian patch by Urs Fleisch <urs fleisch 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/data/flatpak/id3lib-3.8.3-includes.patch b/data/flatpak/id3lib-3.8.3-includes.patch
new file mode 100644
index 0000000..14a3fea
--- /dev/null
+++ b/data/flatpak/id3lib-3.8.3-includes.patch
@@ -0,0 +1,95 @@
+diff -up id3lib-3.8.3/include/id3/id3lib_strings.h~ id3lib-3.8.3/include/id3/id3lib_strings.h
+--- id3lib-3.8.3/include/id3/id3lib_strings.h~ 2003-03-02 02:23:00.000000000 +0200
++++ id3lib-3.8.3/include/id3/id3lib_strings.h  2008-01-04 01:30:52.000000000 +0200
+@@ -29,6 +29,7 @@
+ #ifndef _ID3LIB_STRINGS_H_
+ #define _ID3LIB_STRINGS_H_
+ 
++#include <cstring>
+ #include <string>
+ 
+ #if (defined(__GNUC__) && (__GNUC__ >= 3) || (defined(_MSC_VER) && _MSC_VER > 1000))
+diff -up id3lib-3.8.3/configure.in~ id3lib-3.8.3/configure.in
+--- id3lib-3.8.3/configure.in~ 2008-01-04 11:39:01.000000000 +0100
++++ id3lib-3.8.3/configure.in  2008-01-04 11:39:01.000000000 +0100
+@@ -227,7 +227,6 @@ AC_CHECK_HEADERS(fstream iostream iomani
+ )
+ AC_CHECK_HEADERS(               \
+   string                        \
+-  iomanip.h                     \
+   ,,AC_MSG_ERROR([Missing a vital header file for id3lib])
+ )
+ 
+diff -up id3lib-3.8.3/configure~ id3lib-3.8.3/configure
+--- id3lib-3.8.3/configure~    2008-01-04 11:39:10.000000000 +0100
++++ id3lib-3.8.3/configure     2008-01-04 11:39:10.000000000 +0100
+@@ -22976,7 +22976,6 @@ done
+ 
+ for ac_header in \
+   string                        \
+-  iomanip.h                     \
+ 
+ do
+ as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+diff -up id3lib-3.8.3/include/id3/writers.h~ id3lib-3.8.3/include/id3/writers.h
+--- id3lib-3.8.3/include/id3/writers.h~        2008-01-04 11:59:39.000000000 +0100
++++ id3lib-3.8.3/include/id3/writers.h 2008-01-04 11:59:39.000000000 +0100
+@@ -28,9 +28,9 @@
+ #ifndef _ID3LIB_WRITERS_H_
+ #define _ID3LIB_WRITERS_H_
+ 
++#include <cstring>
+ #include "id3/writer.h"
+ #include "id3/id3lib_streams.h"
+-//#include <string.h>
+ 
+ class ID3_CPP_EXPORT ID3_OStreamWriter : public ID3_Writer
+ {
+diff -up id3lib-3.8.3/examples/demo_info.cpp~ id3lib-3.8.3/examples/demo_info.cpp
+--- id3lib-3.8.3/examples/demo_info.cpp~       2008-01-04 12:00:56.000000000 +0100
++++ id3lib-3.8.3/examples/demo_info.cpp        2008-01-04 12:00:56.000000000 +0100
+@@ -309,7 +309,7 @@ void PrintInformation(const ID3_Tag &myT
+ 
+ #define DEBUG
+ 
+-int main( unsigned int argc, char * const argv[])
++int main(int argc, char * const argv[])
+ {
+   ID3D_INIT_DOUT();
+ 
+diff -up id3lib-3.8.3/examples/demo_copy.cpp~ id3lib-3.8.3/examples/demo_copy.cpp
+--- id3lib-3.8.3/examples/demo_copy.cpp~       2008-01-04 12:01:26.000000000 +0100
++++ id3lib-3.8.3/examples/demo_copy.cpp        2008-01-04 12:01:26.000000000 +0100
+@@ -81,7 +81,7 @@ void DisplayTags(ostream &os, luint nTag
+   }
+ }
+ 
+-int main( unsigned int argc, char * const argv[])
++int main(int argc, char * const argv[])
+ {
+   int ulFlag = ID3TT_ID3;
+   ID3D_INIT_DOUT();
+diff -up id3lib-3.8.3/examples/demo_convert.cpp~ id3lib-3.8.3/examples/demo_convert.cpp
+--- id3lib-3.8.3/examples/demo_convert.cpp~    2008-01-04 12:01:20.000000000 +0100
++++ id3lib-3.8.3/examples/demo_convert.cpp     2008-01-04 12:01:20.000000000 +0100
+@@ -84,7 +84,7 @@ void DisplayTags(ostream &os, luint nTag
+   }
+ }
+ 
+-int main( unsigned int argc, char * const argv[])
++int main(int argc, char * const argv[])
+ {
+   flags_t ulFlag = ID3TT_ALL;
+   gengetopt_args_info args;
+diff -up id3lib-3.8.3/examples/demo_tag.cpp~ id3lib-3.8.3/examples/demo_tag.cpp
+--- id3lib-3.8.3/examples/demo_tag.cpp~        2008-01-04 12:01:41.000000000 +0100
++++ id3lib-3.8.3/examples/demo_tag.cpp 2008-01-04 12:01:41.000000000 +0100
+@@ -46,7 +46,7 @@ void DisplayTags(ostream &os, luint nTag
+     os << "v2";
+ }
+ 
+-int main( unsigned int argc, char * const argv[])
++int main(int argc, char * const argv[])
+ {
+   int ulFlag = ID3TT_ID3;
+   ID3D_INIT_DOUT();
diff --git a/data/flatpak/id3lib-3.8.3-io_helpers-163101.patch 
b/data/flatpak/id3lib-3.8.3-io_helpers-163101.patch
new file mode 100644
index 0000000..7327c3e
--- /dev/null
+++ b/data/flatpak/id3lib-3.8.3-io_helpers-163101.patch
@@ -0,0 +1,15 @@
+diff -Nur id3lib-3.8.3-orig/src/io_helpers.cpp id3lib-3.8.3/src/io_helpers.cpp
+--- id3lib-3.8.3-orig/src/io_helpers.cpp       2003-03-02 01:23:00.000000000 +0100
++++ id3lib-3.8.3/src/io_helpers.cpp    2005-07-16 12:47:11.000000000 +0200
+@@ -363,9 +363,10 @@
+     // Write the BOM: 0xFEFF
+     unicode_t BOM = 0xFEFF;
+     writer.writeChars((const unsigned char*) &BOM, 2);
++    const unsigned char* pdata = (const unsigned char*)data.c_str();
+     for (size_t i = 0; i < size; i += 2)
+     {
+-      unicode_t ch = (data[i] << 8) | data[i+1];
++      unicode_t ch = (pdata[i] << 8) | pdata[i+1];
+       writer.writeChars((const unsigned char*) &ch, 2);
+     }
+   }
diff --git a/data/flatpak/id3lib-3.8.3-missing-nullpointer-check.patch 
b/data/flatpak/id3lib-3.8.3-missing-nullpointer-check.patch
new file mode 100644
index 0000000..d4ca5d2
--- /dev/null
+++ b/data/flatpak/id3lib-3.8.3-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/data/flatpak/id3lib-3.8.3-mkstemp.patch b/data/flatpak/id3lib-3.8.3-mkstemp.patch
new file mode 100644
index 0000000..7fb284b
--- /dev/null
+++ b/data/flatpak/id3lib-3.8.3-mkstemp.patch
@@ -0,0 +1,49 @@
+--- id3lib3.8.3-3.8.3.orig/src/tag_file.cpp
++++ id3lib3.8.3-3.8.3/src/tag_file.cpp
+@@ -242,8 +242,8 @@
+     strcpy(sTempFile, filename.c_str());
+     strcat(sTempFile, sTmpSuffix.c_str());
+ 
+-#if ((defined(__GNUC__) && __GNUC__ >= 3  ) || !defined(HAVE_MKSTEMP))
+-    // This section is for Windows folk && gcc 3.x folk
++#if !defined(HAVE_MKSTEMP)
++    // This section is for Windows folk
+     fstream tmpOut;
+     createFile(sTempFile, tmpOut);
+ 
+@@ -257,7 +257,7 @@
+       tmpOut.write((char *)tmpBuffer, nBytes);
+     }
+ 
+-#else //((defined(__GNUC__) && __GNUC__ >= 3  ) || !defined(HAVE_MKSTEMP))
++#else //!defined(HAVE_MKSTEMP)
+ 
+     // else we gotta make a temp file, copy the tag into it, copy the
+     // rest of the old file after the tag, delete the old file, rename
+@@ -270,7 +270,7 @@
+       //ID3_THROW_DESC(ID3E_NoFile, "couldn't open temp file");
+     }
+ 
+-    ofstream tmpOut(fd);
++    ofstream tmpOut(sTempFile);
+     if (!tmpOut)
+     {
+       tmpOut.close();
+@@ -285,14 +285,14 @@
+     uchar tmpBuffer[BUFSIZ];
+     while (file)
+     {
+-      file.read(tmpBuffer, BUFSIZ);
++      file.read((char *)tmpBuffer, BUFSIZ);
+       size_t nBytes = file.gcount();
+-      tmpOut.write(tmpBuffer, nBytes);
++      tmpOut.write((char *)tmpBuffer, nBytes);
+     }
+ 
+     close(fd); //closes the file
+ 
+-#endif ////((defined(__GNUC__) && __GNUC__ >= 3  ) || !defined(HAVE_MKSTEMP))
++#endif ////!defined(HAVE_MKSTEMP)
+ 
+     tmpOut.close();
+     file.close();
diff --git a/data/flatpak/id3lib-vbr_buffer_overflow.patch b/data/flatpak/id3lib-vbr_buffer_overflow.patch
new file mode 100644
index 0000000..f54edf2
--- /dev/null
+++ b/data/flatpak/id3lib-vbr_buffer_overflow.patch
@@ -0,0 +1,12 @@
+diff -ru id3lib3.8.3-3.8.3.orig/src/mp3_parse.cpp id3lib3.8.3-3.8.3/src/mp3_parse.cpp
+--- id3lib3.8.3-3.8.3.orig/src/mp3_parse.cpp   2003-03-02 01:23:00.000000000 +0100
++++ id3lib3.8.3-3.8.3/src/mp3_parse.cpp        2009-10-06 11:45:37.897681290 +0200
+@@ -465,7 +465,7 @@
+   // from http://www.xingtech.com/developer/mp3/
+ 
+   const size_t VBR_HEADER_MIN_SIZE = 8;     // "xing" + flags are fixed
+-  const size_t VBR_HEADER_MAX_SIZE = 116;   // frames, bytes, toc and scale are optional
++  const size_t VBR_HEADER_MAX_SIZE = 120;   // frames, bytes, toc and scale are optional
+ 
+   if (mp3size >= vbr_header_offest + VBR_HEADER_MIN_SIZE) 
+   {
diff --git a/data/flatpak/libid3tag-0.15.1b-fix_overflow.patch 
b/data/flatpak/libid3tag-0.15.1b-fix_overflow.patch
new file mode 100644
index 0000000..26c54c5
--- /dev/null
+++ b/data/flatpak/libid3tag-0.15.1b-fix_overflow.patch
@@ -0,0 +1,11 @@
+--- field.c.orig       2008-05-05 09:49:15.000000000 -0400
++++ field.c    2008-05-05 09:49:25.000000000 -0400
+@@ -291,7 +291,7 @@
+ 
+       end = *ptr + length;
+ 
+-      while (end - *ptr > 0) {
++      while (end - *ptr > 0 && **ptr != '\0') {
+       ucs4 = id3_parse_string(ptr, end - *ptr, *encoding, 0);
+       if (ucs4 == 0)
+         goto fail;
diff --git a/data/flatpak/libid3tag-0.15.1b-pkgconfig.patch b/data/flatpak/libid3tag-0.15.1b-pkgconfig.patch
new file mode 100644
index 0000000..c6a5d21
--- /dev/null
+++ b/data/flatpak/libid3tag-0.15.1b-pkgconfig.patch
@@ -0,0 +1,45 @@
+diff -urN libid3tag-0.15.1b/configure.ac libid3tag-0.15.1b.new/configure.ac
+--- libid3tag-0.15.1b/configure.ac     2004-01-23 23:22:46.000000000 +0000
++++ libid3tag-0.15.1b.new/configure.ac 2016-05-12 13:59:10.457870513 +0100
+@@ -26,7 +26,7 @@
+ 
+ AC_CONFIG_SRCDIR([id3tag.h])
+ 
+-AM_INIT_AUTOMAKE
++AM_INIT_AUTOMAKE([foreign])
+ 
+ AM_CONFIG_HEADER([config.h])
+ 
+@@ -201,5 +201,5 @@
+ dnl AC_SUBST(LTLIBOBJS)
+ 
+ AC_CONFIG_FILES([Makefile msvc++/Makefile  \
+-      libid3tag.list])
++      libid3tag.list id3tag.pc])
+ AC_OUTPUT
+diff -urN libid3tag-0.15.1b/id3tag.pc.in libid3tag-0.15.1b.new/id3tag.pc.in
+--- libid3tag-0.15.1b/id3tag.pc.in     1970-01-01 01:00:00.000000000 +0100
++++ libid3tag-0.15.1b.new/id3tag.pc.in 2016-05-12 13:57:40.249785719 +0100
+@@ -0,0 +1,11 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: id3tag
++Description: ID3 tag manipulation library
++Requires:
++Version: @PACKAGE_VERSION@
++Libs: -lid3tag
++Cflags:
+diff -urN libid3tag-0.15.1b/Makefile.am libid3tag-0.15.1b.new/Makefile.am
+--- libid3tag-0.15.1b/Makefile.am      2004-02-17 02:11:28.000000000 +0000
++++ libid3tag-0.15.1b.new/Makefile.am  2016-05-12 13:56:42.898460276 +0100
+@@ -120,4 +120,7 @@
+       $(MAKE) clean
+       $(MAKE)
+ 
++pkgconfigdir = $(libdir)/pkgconfig
++pkgconfig_DATA = id3tag.pc
++
+ .PHONY: again


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]