From b590638a18341068954c14f545f4910a899b9731 Mon Sep 17 00:00:00 2001 From: Martin Lund Date: Fri, 18 May 2018 20:35:05 +0200 Subject: [PATCH] Add faad2, flac, libmp4v2, libogg, libsndfile, libvorbis --- faad2/Buildfile | 24 ++++++++ flac/Buildfile | 26 +++++++++ id3lib/Buildfile | 39 +++++++++++++ id3lib/CVE-2007-4460.diff | 51 +++++++++++++++++ id3lib/id3lib-3.8.3-autoconf259.patch | 31 ++++++++++ id3lib/id3lib-3.8.3-gcc-4.3.patch | 82 +++++++++++++++++++++++++++ id3lib/id3lib-3.8.3-test_io.patch | 10 ++++ id3lib/id3lib-3.8.3-unicode16.patch | 39 +++++++++++++ id3lib/id3lib-3.8.3-zlib.patch | 23 ++++++++ libmp4v2/Buildfile | 25 ++++++++ libogg/Buildfile | 23 ++++++++ libsndfile/Buildfile | 28 +++++++++ libvorbis/Buildfile | 24 ++++++++ 13 files changed, 425 insertions(+) create mode 100644 faad2/Buildfile create mode 100644 flac/Buildfile create mode 100644 id3lib/Buildfile create mode 100644 id3lib/CVE-2007-4460.diff create mode 100644 id3lib/id3lib-3.8.3-autoconf259.patch create mode 100644 id3lib/id3lib-3.8.3-gcc-4.3.patch create mode 100644 id3lib/id3lib-3.8.3-test_io.patch create mode 100644 id3lib/id3lib-3.8.3-unicode16.patch create mode 100644 id3lib/id3lib-3.8.3-zlib.patch create mode 100644 libmp4v2/Buildfile create mode 100644 libogg/Buildfile create mode 100644 libsndfile/Buildfile create mode 100644 libvorbis/Buildfile diff --git a/faad2/Buildfile b/faad2/Buildfile new file mode 100644 index 0000000..83e2ae7 --- /dev/null +++ b/faad2/Buildfile @@ -0,0 +1,24 @@ +# Description: An HE, LC, MAIN and LTP profile MPEG2 and MPEG-4 AAC decoder +# URL: http://www.audiocoding.com/ + +name=faad2 +version=2.7 +release=1 +source=(http://download.sourceforge.net/faac/$name-$version.tar.bz2) +depends=(libsndfile id3lib libmp4v2) + +build() { + cd $name-$version + ./configure --build=$BUILD \ + --host=$HOST \ + --prefix=/usr \ + --enable-mp4v2 + + (cd libfaad && make -j $JOBS DESTDIR=$PKG install) + (cd common && make -j $JOBS DESTDIR=$PKG install) + + install -m 0644 common/mp4ff/mp4ff_int_types.h $PKG/usr/include + + # Fix libtool files + fix_la_files $PKG +} diff --git a/flac/Buildfile b/flac/Buildfile new file mode 100644 index 0000000..0b05b49 --- /dev/null +++ b/flac/Buildfile @@ -0,0 +1,26 @@ +# Description: Free Lossless Audio Codec. +# URL: http://flac.sourceforge.net/ + +name=flac +version=1.3.2 +release=1 +source=(http://downloads.xiph.org/releases/$name/$name-$version.tar.xz) +depends=(libogg) + +build() { + cd $name-$version + + ./configure --build=$BUILD \ + --host=$HOST \ + --prefix=/usr \ + --with-ogg=$SYSROOT/usr/lib \ + --disable-xmms-plugin + + make -j $JOBS + make DESTDIR=$PKG install + + rm -rf $PKG/usr/share/doc + + # Fix libtool files + fix_la_files $PKG +} diff --git a/id3lib/Buildfile b/id3lib/Buildfile new file mode 100644 index 0000000..ff51765 --- /dev/null +++ b/id3lib/Buildfile @@ -0,0 +1,39 @@ +# Description: An open-source, cross-platform library for reading/writing/manipulating ID3 tags. +# URL: http://id3lib.sourceforge.net/ + +name=id3lib +version=3.8.3 +release=2 +source=(http://downloads.sourceforge.net/project/$name/$name/$version/$name-$version.tar.gz + $name-3.8.3-zlib.patch + $name-3.8.3-test_io.patch + $name-3.8.3-autoconf259.patch + $name-3.8.3-unicode16.patch + $name-3.8.3-gcc-4.3.patch + CVE-2007-4460.diff) +depends=(zlib) + +build() { + cd $name-$version + + patch -p 1 -i $SRC/$name-3.8.3-zlib.patch + patch -p 1 -i $SRC/$name-3.8.3-test_io.patch + patch -p 1 -i $SRC/$name-3.8.3-autoconf259.patch + patch -p 1 -i $SRC/$name-3.8.3-unicode16.patch + patch -p 1 -i $SRC/$name-3.8.3-gcc-4.3.patch + patch -p 1 -i $SRC/CVE-2007-4460.diff + autoreconf -ivfs # buggy configure + + ./configure --build=$BUILD \ + --host=$HOST \ + --prefix=/usr \ + --disable-static \ + --disable-assert \ + --enable-debug=no + + make -j $JOBS + make DESTDIR=$PKG install + + # Fix libtool files + fix_la_files $PKG +} diff --git a/id3lib/CVE-2007-4460.diff b/id3lib/CVE-2007-4460.diff new file mode 100644 index 0000000..6734210 --- /dev/null +++ b/id3lib/CVE-2007-4460.diff @@ -0,0 +1,51 @@ +--- 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(); +only in patch2: +unchanged: diff --git a/id3lib/id3lib-3.8.3-autoconf259.patch b/id3lib/id3lib-3.8.3-autoconf259.patch new file mode 100644 index 0000000..16921e1 --- /dev/null +++ b/id3lib/id3lib-3.8.3-autoconf259.patch @@ -0,0 +1,31 @@ +Index: id3lib-3.8.3/configure.in +=================================================================== +--- id3lib-3.8.3.orig/configure.in ++++ id3lib-3.8.3/configure.in +@@ -168,7 +168,7 @@ if test $has_iconv = 1; then + 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, [], [Unknown]) + #we'll check out the need of + #typecast in the call of iconv_open + AC_MSG_CHECKING(whether to typecast in iconv) +@@ -184,7 +184,7 @@ if test $has_iconv = 1; then + 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, [], [Unknown]) + else + AC_MSG_RESULT(no) + fi +@@ -206,7 +206,7 @@ if test $has_iconv = 1; then + 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, [], [Unknown]) + else + AC_MSG_RESULT(no) + fi diff --git a/id3lib/id3lib-3.8.3-gcc-4.3.patch b/id3lib/id3lib-3.8.3-gcc-4.3.patch new file mode 100644 index 0000000..090dc0b --- /dev/null +++ b/id3lib/id3lib-3.8.3-gcc-4.3.patch @@ -0,0 +1,82 @@ +diff -Naur id3lib-3.8.3-orig/configure.in id3lib-3.8.3/configure.in +--- id3lib-3.8.3-orig/configure.in 2008-03-05 18:03:25.000000000 -0600 ++++ id3lib-3.8.3/configure.in 2008-03-05 18:15:42.000000000 -0600 +@@ -227,7 +227,6 @@ + ) + AC_CHECK_HEADERS( \ + string \ +- iomanip.h \ + ,,AC_MSG_ERROR([Missing a vital header file for id3lib]) + ) + +diff -Naur id3lib-3.8.3-orig/include/id3/id3lib_strings.h id3lib-3.8.3/include/id3/id3lib_strings.h +--- id3lib-3.8.3-orig/include/id3/id3lib_strings.h 2008-03-05 18:19:46.000000000 -0600 ++++ id3lib-3.8.3/include/id3/id3lib_strings.h 2008-03-05 18:19:38.000000000 -0600 +@@ -30,6 +30,7 @@ + #define _ID3LIB_STRINGS_H_ + + #include ++#include + + #if (defined(__GNUC__) && (__GNUC__ >= 3) || (defined(_MSC_VER) && _MSC_VER > 1000)) + namespace std +diff -Naur id3lib-3.8.3-orig/include/id3/writers.h id3lib-3.8.3/include/id3/writers.h +--- id3lib-3.8.3-orig/include/id3/writers.h 2003-03-01 18:23:00.000000000 -0600 ++++ id3lib-3.8.3/include/id3/writers.h 2008-03-05 18:23:05.000000000 -0600 +@@ -30,7 +30,7 @@ + + #include "id3/writer.h" + #include "id3/id3lib_streams.h" +-//#include ++#include + + class ID3_CPP_EXPORT ID3_OStreamWriter : public ID3_Writer + { +diff -Naur id3lib-3.8.3-orig/examples/demo_convert.cpp id3lib-3.8.3/examples/demo_convert.cpp +--- id3lib-3.8.3-orig/examples/demo_convert.cpp 2003-03-01 18:23:00.000000000 -0600 ++++ id3lib-3.8.3/examples/demo_convert.cpp 2008-03-05 18:26:50.000000000 -0600 +@@ -84,7 +84,7 @@ + } + } + +-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 -Naur id3lib-3.8.3-orig/examples/demo_info.cpp id3lib-3.8.3/examples/demo_info.cpp +--- id3lib-3.8.3-orig/examples/demo_info.cpp 2003-03-01 18:23:00.000000000 -0600 ++++ id3lib-3.8.3/examples/demo_info.cpp 2008-03-05 18:27:40.000000000 -0600 +@@ -309,7 +309,7 @@ + + #define DEBUG + +-int main( unsigned int argc, char * const argv[]) ++int main( int argc, char * const argv[]) + { + ID3D_INIT_DOUT(); + +diff -Naur id3lib-3.8.3-orig/examples/demo_tag.cpp id3lib-3.8.3/examples/demo_tag.cpp +--- id3lib-3.8.3-orig/examples/demo_tag.cpp 2003-03-01 18:23:00.000000000 -0600 ++++ id3lib-3.8.3/examples/demo_tag.cpp 2008-03-05 18:31:20.000000000 -0600 +@@ -46,7 +46,7 @@ + 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 -Naur id3lib-3.8.3-orig/examples/demo_copy.cpp id3lib-3.8.3/examples/demo_copy.cpp +--- id3lib-3.8.3-orig/examples/demo_copy.cpp 2003-03-01 18:23:00.000000000 -0600 ++++ id3lib-3.8.3/examples/demo_copy.cpp 2008-03-05 18:32:44.000000000 -0600 +@@ -81,7 +81,7 @@ + } + } + +-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/id3lib/id3lib-3.8.3-test_io.patch b/id3lib/id3lib-3.8.3-test_io.patch new file mode 100644 index 0000000..b4a0d24 --- /dev/null +++ b/id3lib/id3lib-3.8.3-test_io.patch @@ -0,0 +1,10 @@ +--- id3lib-3.8.3/examples/test_io.cpp.orig 2004-09-21 23:40:48.398826320 +0200 ++++ id3lib-3.8.3/examples/test_io.cpp 2004-09-21 23:40:55.408760648 +0200 +@@ -16,6 +16,7 @@ + using std::cerr; + + using namespace dami; ++using namespace std; + + int + main(size_t argc, const char** argv) diff --git a/id3lib/id3lib-3.8.3-unicode16.patch b/id3lib/id3lib-3.8.3-unicode16.patch new file mode 100644 index 0000000..b05d2cf --- /dev/null +++ b/id3lib/id3lib-3.8.3-unicode16.patch @@ -0,0 +1,39 @@ +diff -ruN id3lib-3.8.3.orig/ChangeLog id3lib-3.8.3/ChangeLog +--- id3lib-3.8.3.orig/ChangeLog 2003-03-02 01:23:00.000000000 +0100 ++++ id3lib-3.8.3/ChangeLog 2006-02-22 00:33:59.946214472 +0100 +@@ -1,3 +1,8 @@ ++2006-02-17 Jerome Couderc ++ ++ * Patch from Spoon to fix UTF-16 writing bug ++ http://sourceforge.net/tracker/index.php?func=detail&aid=1016290&group_id=979&atid=300979 ++ + 2003-03-02 Sunday 17:38 Thijmen Klok + + * THANKS (1.20): added more people +diff -ruN 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 2006-02-22 00:35:02.926639992 +0100 +@@ -363,11 +363,22 @@ + // Write the BOM: 0xFEFF + unicode_t BOM = 0xFEFF; + writer.writeChars((const unsigned char*) &BOM, 2); ++ // Patch from Spoon : 2004-08-25 14:17 ++ // http://sourceforge.net/tracker/index.php?func=detail&aid=1016290&group_id=979&atid=300979 ++ // Wrong code ++ //for (size_t i = 0; i < size; i += 2) ++ //{ ++ // unicode_t ch = (data[i] << 8) | data[i+1]; ++ // writer.writeChars((const unsigned char*) &ch, 2); ++ //} ++ // Right code ++ unsigned char *pdata = (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); + } ++ // End patch + } + return writer.getCur() - beg; + } diff --git a/id3lib/id3lib-3.8.3-zlib.patch b/id3lib/id3lib-3.8.3-zlib.patch new file mode 100644 index 0000000..177320b --- /dev/null +++ b/id3lib/id3lib-3.8.3-zlib.patch @@ -0,0 +1,23 @@ +diff -Naur id3lib-3.8.3.orig/Makefile.am id3lib-3.8.3/Makefile.am +--- id3lib-3.8.3.orig/Makefile.am 2003-03-01 16:23:00.000000000 -0800 ++++ id3lib-3.8.3/Makefile.am 2004-09-12 19:05:39.564456828 -0700 +@@ -28,7 +28,7 @@ + endif + + SUBDIRS = . m4 $(zlib_subdir) doc include id3com src examples +-DIST_SUBDIRS = . m4 zlib doc include id3com src examples prj libprj ++DIST_SUBDIRS = . m4 $(zlib_subdir) doc include id3com src examples prj libprj + + INCLUDES = @ID3LIB_DEBUG_FLAGS@ + +diff -Naur id3lib-3.8.3.orig/src/Makefile.am id3lib-3.8.3/src/Makefile.am +--- id3lib-3.8.3.orig/src/Makefile.am 2003-03-01 16:23:00.000000000 -0800 ++++ id3lib-3.8.3/src/Makefile.am 2004-09-12 19:08:30.814149521 -0700 +@@ -77,6 +77,7 @@ + endif + + libid3_la_LDFLAGS = \ ++ -lz \ + -version-info $(LT_VERSION) \ + -release $(LT_RELEASE) \ + -export-dynamic diff --git a/libmp4v2/Buildfile b/libmp4v2/Buildfile new file mode 100644 index 0000000..71079a8 --- /dev/null +++ b/libmp4v2/Buildfile @@ -0,0 +1,25 @@ +# Description: A library to provide an API to MPEG-4 files. +# URL: http://code.google.com/p/mp4v2/ + +name=libmp4v2 +version=2.0.0 +release=1 +source=(https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/mp4v2/mp4v2-$version.tar.bz2) + +build() { + cd mp4v2-$version + + ./configure --build=$BUILD \ + --host=$HOST \ + --prefix=/usr \ + --mandir=/usr/share/man \ + --disable-static \ + --disable-gch \ + ac_cv_prog_FOUND_HELP2MAN="no" + + make -j $JOBS + make DESTDIR=$PKG install + + # Fix libtool files + fix_la_files $PKG +} diff --git a/libogg/Buildfile b/libogg/Buildfile new file mode 100644 index 0000000..ac4cbc9 --- /dev/null +++ b/libogg/Buildfile @@ -0,0 +1,23 @@ +# Description: Ogg bitstream and framing library +# URL: http://www.xiph.org/ogg/ + +name=libogg +version=1.3.3 +release=1 +source=(http://downloads.xiph.org/releases/ogg/$name-$version.tar.xz) + +build() { + cd $name-$version + + ./configure --build=$BUILD \ + --host=$HOST \ + --prefix=/usr + + make -j $JOBS + make DESTDIR=$PKG install + + rm -rf $PKG/usr/share/doc + + # Fix libtool files + fix_la_files $PKG +} diff --git a/libsndfile/Buildfile b/libsndfile/Buildfile new file mode 100644 index 0000000..630b705 --- /dev/null +++ b/libsndfile/Buildfile @@ -0,0 +1,28 @@ +# Description: Library for manipulating sound files. +# URL: http://www.mega-nerd.com/libsndfile + +name=libsndfile +version=1.0.28 +release=1 +source=(http://www.mega-nerd.com/$name/files/$name-$version.tar.gz) +depends=(flac + alsa-lib + libvorbis) + +build() { + cd $name-$version + + ./configure \ + --build=$BUILD \ + --host=$HOST \ + --prefix=/usr \ + --disable-static + + make -j $JOBS + make DESTDIR=$PKG install + + rm -r $PKG/usr/share/doc + + # Fix libtool files + fix_la_files $PKG +} diff --git a/libvorbis/Buildfile b/libvorbis/Buildfile new file mode 100644 index 0000000..19d7b2e --- /dev/null +++ b/libvorbis/Buildfile @@ -0,0 +1,24 @@ +# Description: Vorbis codec library +# URL: http://www.xiph.org/vorbis + +name=libvorbis +version=1.3.6 +release=1 +source=(http://downloads.xiph.org/releases/vorbis/$name-$version.tar.xz) +depends=(libogg) + +build() { + cd $name-$version + + ./configure --build=$BUILD \ + --host=$HOST \ + --prefix=/usr + + make -j $JOBS + make DESTDIR=$PKG install + + rm -rf $PKG/usr/share/doc + + # Fix libtool files + fix_la_files $PKG +}