[mingw-flac] Initial import (#1051836).
František Dvořák
valtri at fedoraproject.org
Tue Jan 14 21:45:53 UTC 2014
commit 158b4bc6cdd4b317503b68ff1acf6ecbc023cbab
Author: František Dvořák <valtri at civ.zcu.cz>
Date: Tue Jan 14 22:47:20 2014 +0100
Initial import (#1051836).
.gitignore | 1 +
flac-metaflac_strcat.patch | 29 +++++++++
flac-no_rice_asm.patch | 27 +++++++++
mingw-flac.spec | 136 ++++++++++++++++++++++++++++++++++++++++++++
sources | 1 +
5 files changed, 194 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..19eae18 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/flac-1.3.0.tar.xz
diff --git a/flac-metaflac_strcat.patch b/flac-metaflac_strcat.patch
new file mode 100644
index 0000000..78f534e
--- /dev/null
+++ b/flac-metaflac_strcat.patch
@@ -0,0 +1,29 @@
+From 78055800dd8fd2563e9248fcafda81a211fcc4d2 Mon Sep 17 00:00:00 2001
+From: Miroslav Lichvar <mlichvar at redhat.com>
+Date: Mon, 3 Jun 2013 12:54:59 +0200
+Subject: [PATCH 1/2] metaflac : Fix local_strcat() to terminate string
+ correctly.
+
+The NUL char is written at incorrect place when the destination string
+is longer than 0, which causes memory corruption. It was broken by
+commit 2d6354ff2a618a79d40edbd4f208b4b07c5422f1.
+---
+ src/metaflac/utils.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/metaflac/utils.c b/src/metaflac/utils.c
+index 097537b..8a31daa 100644
+--- a/src/metaflac/utils.c
++++ b/src/metaflac/utils.c
+@@ -75,7 +75,7 @@ void local_strcat(char **dest, const char *source)
+ *dest = safe_realloc_add_3op_(*dest, ndest, /*+*/nsource, /*+*/1);
+ if(0 == *dest)
+ die("out of memory growing string");
+- safe_strncpy((*dest)+ndest, source, ndest + nsource + 1);
++ safe_strncpy((*dest)+ndest, source, nsource + 1);
+ }
+
+ static inline int local_isprint(int c)
+--
+1.8.1.4
+
diff --git a/flac-no_rice_asm.patch b/flac-no_rice_asm.patch
new file mode 100644
index 0000000..18d4fdb
--- /dev/null
+++ b/flac-no_rice_asm.patch
@@ -0,0 +1,27 @@
+From 4e5a0bacf021737fb1a8366ad07dc66f3286b1be Mon Sep 17 00:00:00 2001
+From: Miroslav Lichvar <mlichvar at redhat.com>
+Date: Mon, 3 Jun 2013 13:25:47 +0200
+Subject: [PATCH 2/2] Don't use
+ FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap.
+
+It seems to be slower than the C function.
+---
+ src/libFLAC/stream_decoder.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c
+index f987c27..bc9c715 100644
+--- a/src/libFLAC/stream_decoder.c
++++ b/src/libFLAC/stream_decoder.c
+@@ -400,7 +400,7 @@ static FLAC__StreamDecoderInitStatus init_stream_internal_(
+ #ifdef FLAC__CPU_IA32
+ FLAC__ASSERT(decoder->private_->cpuinfo.type == FLAC__CPUINFO_TYPE_IA32);
+ #ifdef FLAC__HAS_NASM
+-#if 1 /*@@@@@@ OPT: not clearly faster, needs more testing */
++#if 0 /*@@@@@@ OPT: not clearly faster, needs more testing */
+ if(decoder->private_->cpuinfo.data.ia32.bswap)
+ decoder->private_->local_bitreader_read_rice_signed_block = FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap;
+ #endif
+--
+1.8.1.4
+
diff --git a/mingw-flac.spec b/mingw-flac.spec
new file mode 100644
index 0000000..84493d3
--- /dev/null
+++ b/mingw-flac.spec
@@ -0,0 +1,136 @@
+%{?mingw_package_header}
+
+Name: mingw-flac
+Version: 1.3.0
+Release: 1%{?dist}
+Summary: Encoder/decoder for the Free Lossless Audio Codec
+
+License: BSD and GPLv2+
+URL: http://xiph.org/flac/
+Source0: http://downloads.xiph.org/releases/flac/flac-%{version}.tar.xz
+# https://git.xiph.org/?p=flac.git;a=commitdiff;h=606fdfcaece19d3e05434bde57c289102a369069
+Patch1: flac-metaflac_strcat.patch
+# https://git.xiph.org/?p=flac.git;a=commitdiff;h=4eab6313cd2198b5647d925bdb3847590505fa21
+Patch2: flac-no_rice_asm.patch
+
+BuildArch: noarch
+
+BuildRequires: mingw32-filesystem >= 95
+BuildRequires: mingw32-gcc
+BuildRequires: mingw32-gcc-c++
+BuildRequires: mingw32-libogg
+BuildRequires: mingw32-win-iconv
+
+BuildRequires: mingw64-filesystem >= 95
+BuildRequires: mingw64-gcc
+BuildRequires: mingw64-gcc-c++
+BuildRequires: mingw64-libogg
+BuildRequires: mingw64-win-iconv
+
+BuildRequires: automake autoconf libtool gettext-devel
+BuildRequires: nasm
+
+%description
+FLAC stands for Free Lossless Audio Codec. Grossly oversimplified, FLAC
+is similar to Ogg Vorbis, but lossless. The FLAC project consists of
+the stream format, reference encoders and decoders in library form,
+flac, a command-line program to encode and decode FLAC files, metaflac,
+a command-line metadata editor for FLAC files and input plugins for
+various music players.
+
+
+%package -n mingw32-flac
+Summary: %{summary}
+
+%description -n mingw32-flac
+FLAC stands for Free Lossless Audio Codec. Grossly oversimplified, FLAC
+is similar to Ogg Vorbis, but lossless. The FLAC project consists of
+the stream format, reference encoders and decoders in library form,
+flac, a command-line program to encode and decode FLAC files, metaflac,
+a command-line metadata editor for FLAC files and input plugins for
+various music players.
+
+This package is MinGW compiled flac library for the Win32 target.
+
+
+%package -n mingw64-flac
+Summary: %{summary}
+
+%description -n mingw64-flac
+FLAC stands for Free Lossless Audio Codec. Grossly oversimplified, FLAC
+is similar to Ogg Vorbis, but lossless. The FLAC project consists of
+the stream format, reference encoders and decoders in library form,
+flac, a command-line program to encode and decode FLAC files, metaflac,
+a command-line metadata editor for FLAC files and input plugins for
+various music players.
+
+This package is MinGW compiled flac library for the Win64 target.
+
+
+%{?mingw_debug_package}
+
+
+%prep
+%setup -q -n flac-%{version}
+%patch1 -p1 -b .metaflac-strcat
+%patch2 -p1 -b .no_rice_asm
+
+
+%build
+# use our libtool to avoid problems with RPATH
+./autogen.sh -V
+
+# -funroll-loops makes encoding about 10% faster
+export CFLAGS="%{optflags} -funroll-loops"
+%mingw_configure \
+ --disable-xmms-plugin \
+ --disable-silent-rules \
+ --disable-thorough-tests
+
+%mingw_make %{?_smp_mflags}
+
+
+%install
+%mingw_make install DESTDIR=%{buildroot}
+
+# documentation in native package
+rm -rf %{buildroot}%{mingw32_docdir}/flac*
+rm -rf %{buildroot}%{mingw64_docdir}/flac*
+rm -rf %{buildroot}%{mingw32_mandir}
+rm -rf %{buildroot}%{mingw64_mandir}
+
+rm %{buildroot}%{mingw32_bindir}/*.exe
+rm %{buildroot}%{mingw64_bindir}/*.exe
+rm %{buildroot}%{mingw32_libdir}/*.la
+rm %{buildroot}%{mingw64_libdir}/*.la
+
+
+%files -n mingw32-flac
+%doc AUTHORS COPYING* README
+%{mingw32_bindir}/libFLAC-8.dll
+%{mingw32_bindir}/libFLAC++-6.dll
+%{mingw32_includedir}/*
+%{mingw32_libdir}/libFLAC.dll.a
+%{mingw32_libdir}/libFLAC++.dll.a
+%{mingw32_libdir}/pkgconfig/flac.pc
+%{mingw32_libdir}/pkgconfig/flac++.pc
+%{mingw32_datadir}/aclocal/libFLAC.m4
+%{mingw32_datadir}/aclocal/libFLAC++.m4
+
+
+%files -n mingw64-flac
+%doc AUTHORS COPYING* README
+%{mingw64_bindir}/libFLAC-8.dll
+%{mingw64_bindir}/libFLAC++-6.dll
+%{mingw64_includedir}/*
+%{mingw64_libdir}/libFLAC.dll.a
+%{mingw64_libdir}/libFLAC++.dll.a
+%{mingw64_libdir}/pkgconfig/flac.pc
+%{mingw64_libdir}/pkgconfig/flac++.pc
+%{mingw64_datadir}/aclocal/libFLAC.m4
+%{mingw64_datadir}/aclocal/libFLAC++.m4
+
+
+%changelog
+* Sat Jan 11 2014 František Dvořák <valtri at civ.zcu.cz> - 1.3.0-1
+- Initial package, based on the native flac
diff --git a/sources b/sources
index e69de29..b80377a 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+13b5c214cee8373464d3d65dee362cdd flac-1.3.0.tar.xz
More information about the scm-commits
mailing list