summaryrefslogtreecommitdiff
path: root/media-libs/flac
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /media-libs/flac
reinit the tree, so we can have metadata
Diffstat (limited to 'media-libs/flac')
-rw-r--r--media-libs/flac/Manifest11
-rw-r--r--media-libs/flac/files/flac-1.3.0-dontbuild-tests.patch66
-rw-r--r--media-libs/flac/files/flac-1.3.2-asneeded.patch39
-rw-r--r--media-libs/flac/files/flac-1.3.2-cflags.patch398
-rw-r--r--media-libs/flac/files/flac-1.3.2-dontbuild-examples.patch46
-rw-r--r--media-libs/flac/files/flac-1.3.2-fortify-sources.patch15
-rw-r--r--media-libs/flac/files/flac-1.3.2-honor-htmldir.patch75
-rw-r--r--media-libs/flac/flac-1.3.2-r1.ebuild69
-rw-r--r--media-libs/flac/metadata.xml11
9 files changed, 730 insertions, 0 deletions
diff --git a/media-libs/flac/Manifest b/media-libs/flac/Manifest
new file mode 100644
index 000000000000..341907192def
--- /dev/null
+++ b/media-libs/flac/Manifest
@@ -0,0 +1,11 @@
+AUX flac-1.3.0-dontbuild-tests.patch 2111 SHA256 31d1a8bb80d623db4cbac8182e3b2027b8498f9bf77d5baf38acea9558dea970 SHA512 50329cdb766111dbda41856363cbba74dc92e7348605e086697778e7004cce514ff9452c1d5bd72e327c9d7182af218e74d82625f6cdcb977a7dad1cf3d07995 WHIRLPOOL 4ab0ea936c6d4f9e28684f806c86dbe94bd082892ecdf4c5b4917cf3a738ad544e9f2336b678f904c2614b8e8c33aadf1326583605e5a6917e7fd87f1f5f4b00
+AUX flac-1.3.2-asneeded.patch 1149 SHA256 99c13a85e4e97458e88a785f4aa3aa239441edc56b65060b46cf4f42428df572 SHA512 63cffa69c84a62121877a5b58f20f2bba32a6cb52e771f6d100debb5f125476a6acb9bc70f718721909898e4117f93c2f3c9c2638f90c1386cf31aa813be0e96 WHIRLPOOL 5aea611f6d4a9c5b0a926e773deec64113a67fa0fa831acf83df17cfe7edccb8c594d94fbaabe123e7600fd8b6686b79faefe390fd3b65951ade1bc821f17e24
+AUX flac-1.3.2-cflags.patch 14526 SHA256 6a7777f4873df18f16703981eb23be688e38a3ba035af08d3fd77660a87cf619 SHA512 f93fcceaa0b962fb0f7e7c9f54ea9c96be363f22a9b5147cc65795e65884ed7058825d90371f21c2e10aeeec3da87a27501306fe5835f899cf3ec22c436aa65a WHIRLPOOL 723ec087d1f34d4e49db9e6e5f47a83ba9c9db87c628b7875bc3c31da50b1823c2d420276516110a9d54f13872ef472904002eb84e67ebc07b6ea87698e5279f
+AUX flac-1.3.2-dontbuild-examples.patch 1251 SHA256 aa67184e370f212d0529c13f4fa455a778f3f44661b319d51d7c380219740d9e SHA512 d29fbb2eeb696b9c7868c3c6343d90fb7760bec527a5f17fac9531336f2aac6b2206af0369edfa529dfcd25e689261646f0fdab80f28d20c728f5bbdf2ede24d WHIRLPOOL c88f93384769f0bb913c78a49a80307b12fae18d51dd33644102a32946c9c785188cd1539213be92d11272bfc55921d9ec4b3e9e1168a8261b4729582d08f884
+AUX flac-1.3.2-fortify-sources.patch 619 SHA256 837a952a6a3fec4616816e015d33fcdb393a46f24fb24373e199ace774a848f2 SHA512 6eb197af0a945f2ee9ff54a7f35ee0fefe09ad0b3eff32b4a653d917f51bc8d4cb16cc5fec06980d9b6ea58e4488e28893ddeb5a454d32e1afaff1c1bd656518 WHIRLPOOL 41bea36057c3ab963b6b8c29b07977ef6e5447a82cc2d4f2e5abe58c172d68c5e9b3ad440ca819e7b1420ee3e55d6125671b5813752ebdfb73c9ae6c32e4227e
+AUX flac-1.3.2-honor-htmldir.patch 2088 SHA256 d46d1032eeadc4ed154a83d8891feeb5288d6af51f6edef1d9bf33670cee1d7a SHA512 1617f13c469eaa71bd8c99833c50bc99eeebe37e5ccbb96d55ebd9b1b88587ae00d577e23dc11802d651a962ac1fa1ebf173fc8879270409a87ca3e2cf96aaec WHIRLPOOL 5c229e82e7378d27a02761390eba86029c76c3df81e504805e98053bbc560365cc7d75902c898b3102ae959f496d92c08a1d45d0c9c27fcbd95430e34789d195
+DIST flac-1.3.2.tar.xz 776192 SHA256 91cfc3ed61dc40f47f050a109b08610667d73477af6ef36dcad31c31a4a8d53f SHA512 63910e8ebbe508316d446ffc9eb6d02efbd5f47d29d2ea7864da9371843c8e671854db6e89ba043fe08aef1845b8ece70db80f1cce853f591ca30d56ef7c3a15 WHIRLPOOL 158a3dbb621aab556388a7e46f0b760934011ae9f20d4921927d1c62fee9be0434294b3afcf93db355704c24822cfcfc24dc2d4b2b32ef13447633671e20fe7c
+EBUILD flac-1.3.2-r1.ebuild 1851 SHA256 df39e9f441f124d097fa8f3c75ee67ef77d9a7ef241020438256575e87b892c0 SHA512 ab6155ed6dcc923a5cd2a8cce8cd977cb537a104466989ad2d6dd7fb9abc461eb43656be8cd3c3936d6ea0b4a33f0332eba5f57047d6b7f599551924b9c93abc WHIRLPOOL 5779db7ca026f06c38f23abd09242fc37f6d02f6a4a0ec763049dde9dd1518a90c29b2bfee86994c3d50eabc0a416015d4414965d00ae4f25491bfde1be0defe
+MISC ChangeLog 3275 SHA256 6348e3e3c37dbdaf2063f5e3bd9016b00e4be507b6dae6625cc6d10c02aa0a7c SHA512 742ebfb77dc5e568e878b1a1bdbf69d806b792320da8476218189be1a7058e65edbd551fde6035331104797be92b38f8ea3ad9a37cbf0dfe50980380c1c3f2f5 WHIRLPOOL 9383c973e5f8901b557aaa833ac97567787669e5251698c8b557530037b3d3690d3e2bce2ce653db9d7d2d93ffd4d2d269847ade9c0f70062a0b4398b76f083e
+MISC ChangeLog-2015 27668 SHA256 3e45e74b5ad5f82a40dd474be8ff6c1f699145e3bb8a8f33dc5b32ae274372ab SHA512 e247b80eaa7317ac8b08a2ff7cae221a035fafd4601aa390117abb1be830455a5b4161d8c5fc3bc72dbd2b11a19ae71f92936d46a387ae7fa6d1c94ff77df67c WHIRLPOOL b2ecdc5291111c7878b2d6caddd3550fa4249b9903e3b8e3a6d430176268006fbb816e59d42fb717e761f45bfbef6a121318cca4e192db5a04021358317d627f
+MISC metadata.xml 327 SHA256 bb29374be314d4d9f66da82bcdabe36bddb0f899ba90eb4b7043b526243594b9 SHA512 a4e6ad50d3089ff980a07a6ea6f7fcc22e3efc4da4c5721492aae001861fa185f12d68fc5effb55ccce8d67042b7a605c28096f4bca88f2ba9d5b4eb2593d14c WHIRLPOOL 34816e5ae73aee84e56f2e6529b26620a05c2a94716e14ff63d13f4d51f884807d3773877cc17d817120720df96d2ddee1c22cfad37e264736b511cba9afd10f
diff --git a/media-libs/flac/files/flac-1.3.0-dontbuild-tests.patch b/media-libs/flac/files/flac-1.3.0-dontbuild-tests.patch
new file mode 100644
index 000000000000..0915a5976609
--- /dev/null
+++ b/media-libs/flac/files/flac-1.3.0-dontbuild-tests.patch
@@ -0,0 +1,66 @@
+--- flac-1.3.0/src/test_grabbag/cuesheet/Makefile.am
++++ flac-1.3.0/src/test_grabbag/cuesheet/Makefile.am
+@@ -21,7 +21,7 @@
+ test_cuesheet.vcproj
+
+ AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
+-noinst_PROGRAMS = test_cuesheet
++check_PROGRAMS = test_cuesheet
+ test_cuesheet_SOURCES = \
+ main.c
+ test_cuesheet_LDADD = \
+--- flac-1.3.0/src/test_grabbag/picture/Makefile.am
++++ flac-1.3.0/src/test_grabbag/picture/Makefile.am
+@@ -21,7 +21,7 @@
+ test_picture.vcproj
+
+ AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
+-noinst_PROGRAMS = test_picture
++check_PROGRAMS = test_picture
+ test_picture_SOURCES = \
+ main.c
+
+--- flac-1.3.0/src/test_libFLAC/Makefile.am
++++ flac-1.3.0/src/test_libFLAC/Makefile.am
+@@ -22,7 +22,7 @@
+
+ AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include -I$(top_srcdir)/src/libFLAC/include
+
+-noinst_PROGRAMS = test_libFLAC
++check_PROGRAMS = test_libFLAC
+
+ if OS_IS_WINDOWS
+ win_utf8_lib = $(top_builddir)/src/share/win_utf8_io/libwin_utf8_io.la
+--- flac-1.3.0/src/test_libFLAC++/Makefile.am
++++ flac-1.3.0/src/test_libFLAC++/Makefile.am
+@@ -21,7 +21,7 @@
+ test_libFLAC++.vcproj
+
+ AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
+-noinst_PROGRAMS = test_libFLAC++
++check_PROGRAMS = test_libFLAC++
+ test_libFLAC___LDADD = \
+ $(top_builddir)/src/share/grabbag/libgrabbag.la \
+ $(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
+--- flac-1.3.0/src/test_seeking/Makefile.am
++++ flac-1.3.0/src/test_seeking/Makefile.am
+@@ -24,7 +24,7 @@
+
+ AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
+
+-noinst_PROGRAMS = test_seeking
++check_PROGRAMS = test_seeking
+ test_seeking_LDADD = \
+ $(top_builddir)/src/libFLAC/libFLAC.la
+
+--- flac-1.3.0/src/test_streams/Makefile.am
++++ flac-1.3.0/src/test_streams/Makefile.am
+@@ -21,7 +21,7 @@
+ test_streams.vcproj
+
+ AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
+-noinst_PROGRAMS = test_streams
++check_PROGRAMS = test_streams
+ test_streams_SOURCES = \
+ main.c
+
diff --git a/media-libs/flac/files/flac-1.3.2-asneeded.patch b/media-libs/flac/files/flac-1.3.2-asneeded.patch
new file mode 100644
index 000000000000..f506f243c44f
--- /dev/null
+++ b/media-libs/flac/files/flac-1.3.2-asneeded.patch
@@ -0,0 +1,39 @@
+From 8606b0f418c08aaba7f2565b005f9c00f8681ca1 Mon Sep 17 00:00:00 2001
+From: David Seifert <soap@gentoo.org>
+Date: Fri, 13 Jan 2017 16:14:01 +0100
+Subject: [PATCH 4/4] When using libtool, use LTLIBICONV instead.
+
+* This is required, as otherwise -Wl,--as-needed could fail.
+---
+ src/flac/Makefile.am | 2 +-
+ src/metaflac/Makefile.am | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/flac/Makefile.am b/src/flac/Makefile.am
+index bf3bf468..fe6fa489 100644
+--- a/src/flac/Makefile.am
++++ b/src/flac/Makefile.am
+@@ -60,7 +60,7 @@ flac_LDADD = \
+ $(top_builddir)/src/share/replaygain_synthesis/libreplaygain_synthesis.la \
+ $(top_builddir)/src/libFLAC/libFLAC.la \
+ $(win_utf8_lib) \
+- @LIBICONV@ \
++ @LTLIBICONV@ \
+ -lm
+
+ CLEANFILES = flac.exe
+diff --git a/src/metaflac/Makefile.am b/src/metaflac/Makefile.am
+index 7a4ec6b6..ec201ddf 100644
+--- a/src/metaflac/Makefile.am
++++ b/src/metaflac/Makefile.am
+@@ -55,6 +55,6 @@ metaflac_LDADD = \
+ $(top_builddir)/src/share/utf8/libutf8.la \
+ $(top_builddir)/src/libFLAC/libFLAC.la \
+ $(win_utf8_lib) \
+- @LIBICONV@
++ @LTLIBICONV@
+
+ CLEANFILES = metaflac.exe
+--
+2.11.0
+
diff --git a/media-libs/flac/files/flac-1.3.2-cflags.patch b/media-libs/flac/files/flac-1.3.2-cflags.patch
new file mode 100644
index 000000000000..e4159a41d2a2
--- /dev/null
+++ b/media-libs/flac/files/flac-1.3.2-cflags.patch
@@ -0,0 +1,398 @@
+From eab60f424ae4810a8b3b07cf2d429be2905c9655 Mon Sep 17 00:00:00 2001
+From: David Seifert <soap@gentoo.org>
+Date: Fri, 13 Jan 2017 16:03:47 +0100
+Subject: [PATCH 1/4] Do not override CFLAGS, as CFLAGS is a user flag.
+
+* Furthermore, use NDEBUG globally to detect the presence
+ of building with more debug output information.
+ AX_CHECK_ENABLE_DEBUG is easier to use, and nowadays
+ Gnome has also switched to it from its own custom solution.
+---
+ configure.ac | 19 +------
+ include/FLAC/assert.h | 2 +-
+ m4/ax_check_enable_debug.m4 | 124 ++++++++++++++++++++++++++++++++++++++++++
+ src/libFLAC/cpu.c | 2 +-
+ src/libFLAC/lpc.c | 4 +-
+ src/libFLAC/stream_encoder.c | 10 ++--
+ src/plugin_common/Makefile.am | 6 --
+ src/plugin_common/charset.c | 4 +-
+ src/plugin_xmms/http.c | 12 ++--
+ src/share/Makefile.am | 6 --
+ 10 files changed, 142 insertions(+), 47 deletions(-)
+ create mode 100644 m4/ax_check_enable_debug.m4
+
+diff --git a/configure.ac b/configure.ac
+index 235d2717..ba97bac0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -205,14 +205,8 @@ AC_DEFINE(FLAC__ALIGN_MALLOC_DATA)
+ AH_TEMPLATE(FLAC__ALIGN_MALLOC_DATA, [define to align allocated memory on 32-byte boundaries])
+ fi
+
+-AC_ARG_ENABLE(debug,
+-AC_HELP_STRING([--enable-debug], [Turn on debugging]),
+-[case "${enableval}" in
+- yes) debug=true ;;
+- no) debug=false ;;
+- *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
+-esac],[debug=false])
+-AM_CONDITIONAL(DEBUG, test "x$debug" = xtrue)
++AX_CHECK_ENABLE_DEBUG
++AM_CONDITIONAL([DEBUG], [test "x$ax_enable_debug" = "xyes" -o "x$ax_enable_debug" = "xinfo"])
+
+ AC_ARG_ENABLE(sse,
+ AC_HELP_STRING([--disable-sse], [Disable passing of -msse2 to the compiler]),
+@@ -384,15 +378,6 @@ AC_DEFINE(FLAC__HAS_NASM)
+ AH_TEMPLATE(FLAC__HAS_NASM, [define if you are compiling for x86 and have the NASM assembler])
+ fi
+
+-if test "x$debug" = xtrue; then
+- CPPFLAGS="-DDEBUG $CPPFLAGS"
+- CFLAGS="-g $CFLAGS"
+-else
+- CPPFLAGS="-DNDEBUG $CPPFLAGS"
+- CFLAGS=$(echo "$CFLAGS" | sed 's/-O2//')
+- CFLAGS="-O3 -funroll-loops $CFLAGS"
+-fi
+-
+ XIPH_GCC_VERSION
+
+ if test x$ac_cv_c_compiler_gnu = xyes ; then
+diff --git a/include/FLAC/assert.h b/include/FLAC/assert.h
+index b546fd07..55b34777 100644
+--- a/include/FLAC/assert.h
++++ b/include/FLAC/assert.h
+@@ -34,7 +34,7 @@
+ #define FLAC__ASSERT_H
+
+ /* we need this since some compilers (like MSVC) leave assert()s on release code (and we don't want to use their ASSERT) */
+-#ifdef DEBUG
++#ifndef NDEBUG
+ #include <assert.h>
+ #define FLAC__ASSERT(x) assert(x)
+ #define FLAC__ASSERT_DECLARATION(x) x
+diff --git a/m4/ax_check_enable_debug.m4 b/m4/ax_check_enable_debug.m4
+new file mode 100644
+index 00000000..f99d75fe
+--- /dev/null
++++ b/m4/ax_check_enable_debug.m4
+@@ -0,0 +1,124 @@
++# ===========================================================================
++# http://www.gnu.org/software/autoconf-archive/ax_check_enable_debug.html
++# ===========================================================================
++#
++# SYNOPSIS
++#
++# AX_CHECK_ENABLE_DEBUG([enable by default=yes/info/profile/no], [ENABLE DEBUG VARIABLES ...], [DISABLE DEBUG VARIABLES NDEBUG ...], [IS-RELEASE])
++#
++# DESCRIPTION
++#
++# Check for the presence of an --enable-debug option to configure, with
++# the specified default value used when the option is not present. Return
++# the value in the variable $ax_enable_debug.
++#
++# Specifying 'yes' adds '-g -O0' to the compilation flags for all
++# languages. Specifying 'info' adds '-g' to the compilation flags.
++# Specifying 'profile' adds '-g -pg' to the compilation flags and '-pg' to
++# the linking flags. Otherwise, nothing is added.
++#
++# Define the variables listed in the second argument if debug is enabled,
++# defaulting to no variables. Defines the variables listed in the third
++# argument if debug is disabled, defaulting to NDEBUG. All lists of
++# variables should be space-separated.
++#
++# If debug is not enabled, ensure AC_PROG_* will not add debugging flags.
++# Should be invoked prior to any AC_PROG_* compiler checks.
++#
++# IS-RELEASE can be used to change the default to 'no' when making a
++# release. Set IS-RELEASE to 'yes' or 'no' as appropriate. By default, it
++# uses the value of $ax_is_release, so if you are using the AX_IS_RELEASE
++# macro, there is no need to pass this parameter.
++#
++# AX_IS_RELEASE([git-directory])
++# AX_CHECK_ENABLE_DEBUG()
++#
++# LICENSE
++#
++# Copyright (c) 2011 Rhys Ulerich <rhys.ulerich@gmail.com>
++# Copyright (c) 2014, 2015 Philip Withnall <philip@tecnocode.co.uk>
++#
++# Copying and distribution of this file, with or without modification, are
++# permitted in any medium without royalty provided the copyright notice
++# and this notice are preserved.
++
++#serial 5
++
++AC_DEFUN([AX_CHECK_ENABLE_DEBUG],[
++ AC_BEFORE([$0],[AC_PROG_CC])dnl
++ AC_BEFORE([$0],[AC_PROG_CXX])dnl
++ AC_BEFORE([$0],[AC_PROG_F77])dnl
++ AC_BEFORE([$0],[AC_PROG_FC])dnl
++
++ AC_MSG_CHECKING(whether to enable debugging)
++
++ ax_enable_debug_default=m4_tolower(m4_normalize(ifelse([$1],,[no],[$1])))
++ ax_enable_debug_is_release=m4_tolower(m4_normalize(ifelse([$4],,
++ [$ax_is_release],
++ [$4])))
++
++ # If this is a release, override the default.
++ AS_IF([test "$ax_enable_debug_is_release" = "yes"],
++ [ax_enable_debug_default="no"])
++
++ m4_define(ax_enable_debug_vars,[m4_normalize(ifelse([$2],,,[$2]))])
++ m4_define(ax_disable_debug_vars,[m4_normalize(ifelse([$3],,[NDEBUG],[$3]))])
++
++ AC_ARG_ENABLE(debug,
++ [AS_HELP_STRING([--enable-debug=]@<:@yes/info/profile/no@:>@,[compile with debugging])],
++ [],enable_debug=$ax_enable_debug_default)
++
++ # empty mean debug yes
++ AS_IF([test "x$enable_debug" = "x"],
++ [enable_debug="yes"])
++
++ # case of debug
++ AS_CASE([$enable_debug],
++ [yes],[
++ AC_MSG_RESULT(yes)
++ CFLAGS="${CFLAGS} -g -O0"
++ CXXFLAGS="${CXXFLAGS} -g -O0"
++ FFLAGS="${FFLAGS} -g -O0"
++ FCFLAGS="${FCFLAGS} -g -O0"
++ OBJCFLAGS="${OBJCFLAGS} -g -O0"
++ ],
++ [info],[
++ AC_MSG_RESULT(info)
++ CFLAGS="${CFLAGS} -g"
++ CXXFLAGS="${CXXFLAGS} -g"
++ FFLAGS="${FFLAGS} -g"
++ FCFLAGS="${FCFLAGS} -g"
++ OBJCFLAGS="${OBJCFLAGS} -g"
++ ],
++ [profile],[
++ AC_MSG_RESULT(profile)
++ CFLAGS="${CFLAGS} -g -pg"
++ CXXFLAGS="${CXXFLAGS} -g -pg"
++ FFLAGS="${FFLAGS} -g -pg"
++ FCFLAGS="${FCFLAGS} -g -pg"
++ OBJCFLAGS="${OBJCFLAGS} -g -pg"
++ LDFLAGS="${LDFLAGS} -pg"
++ ],
++ [
++ AC_MSG_RESULT(no)
++ dnl Ensure AC_PROG_CC/CXX/F77/FC/OBJC will not enable debug flags
++ dnl by setting any unset environment flag variables
++ AS_IF([test "x${CFLAGS+set}" != "xset"],
++ [CFLAGS=""])
++ AS_IF([test "x${CXXFLAGS+set}" != "xset"],
++ [CXXFLAGS=""])
++ AS_IF([test "x${FFLAGS+set}" != "xset"],
++ [FFLAGS=""])
++ AS_IF([test "x${FCFLAGS+set}" != "xset"],
++ [FCFLAGS=""])
++ AS_IF([test "x${OBJCFLAGS+set}" != "xset"],
++ [OBJCFLAGS=""])
++ ])
++
++ dnl Define various variables if debugging is disabled.
++ dnl assert.h is a NOP if NDEBUG is defined, so define it by default.
++ AS_IF([test "x$enable_debug" = "xyes"],
++ [m4_map_args_w(ax_enable_debug_vars, [AC_DEFINE(], [,,[Define if debugging is enabled])])],
++ [m4_map_args_w(ax_disable_debug_vars, [AC_DEFINE(], [,,[Define if debugging is disabled])])])
++ ax_enable_debug=$enable_debug
++])
+diff --git a/src/libFLAC/cpu.c b/src/libFLAC/cpu.c
+index 12d46191..8bcdee82 100644
+--- a/src/libFLAC/cpu.c
++++ b/src/libFLAC/cpu.c
+@@ -47,7 +47,7 @@
+ # include <cpuid.h> /* for __get_cpuid() and __get_cpuid_max() */
+ #endif
+
+-#ifdef DEBUG
++#ifndef NDEBUG
+ #include <stdio.h>
+
+ #define dfprintf fprintf
+diff --git a/src/libFLAC/lpc.c b/src/libFLAC/lpc.c
+index 531247b5..b59419da 100644
+--- a/src/libFLAC/lpc.c
++++ b/src/libFLAC/lpc.c
+@@ -42,7 +42,7 @@
+ #include "private/bitmath.h"
+ #include "private/lpc.h"
+ #include "private/macros.h"
+-#if defined DEBUG || defined FLAC__OVERFLOW_DETECT || defined FLAC__OVERFLOW_DETECT_VERBOSE
++#if !defined(NDEBUG) || defined FLAC__OVERFLOW_DETECT || defined FLAC__OVERFLOW_DETECT_VERBOSE
+ #include <stdio.h>
+ #endif
+
+@@ -234,7 +234,7 @@ int FLAC__lpc_quantize_coefficients(const FLAC__real lp_coeff[], unsigned order,
+ const int nshift = -(*shift);
+ double error = 0.0;
+ FLAC__int32 q;
+-#ifdef DEBUG
++#ifndef NDEBUG
+ fprintf(stderr,"FLAC__lpc_quantize_coefficients: negative shift=%d order=%u cmax=%f\n", *shift, order, cmax);
+ #endif
+ for(i = 0; i < order; i++) {
+diff --git a/src/libFLAC/stream_encoder.c b/src/libFLAC/stream_encoder.c
+index e1cba75e..c22974fc 100644
+--- a/src/libFLAC/stream_encoder.c
++++ b/src/libFLAC/stream_encoder.c
+@@ -3452,7 +3452,7 @@ FLAC__bool process_subframe_(
+ #endif
+ rice_parameter++; /* to account for the signed->unsigned conversion during rice coding */
+ if(rice_parameter >= rice_parameter_limit) {
+-#ifdef DEBUG_VERBOSE
++#ifndef NDEBUG
+ fprintf(stderr, "clipping rice_parameter (%u -> %u) @0\n", rice_parameter, rice_parameter_limit - 1);
+ #endif
+ rice_parameter = rice_parameter_limit - 1;
+@@ -3524,7 +3524,7 @@ FLAC__bool process_subframe_(
+ rice_parameter = (lpc_residual_bits_per_sample > 0.0)? (unsigned)(lpc_residual_bits_per_sample+0.5) : 0; /* 0.5 is for rounding */
+ rice_parameter++; /* to account for the signed->unsigned conversion during rice coding */
+ if(rice_parameter >= rice_parameter_limit) {
+-#ifdef DEBUG_VERBOSE
++#ifndef NDEBUG
+ fprintf(stderr, "clipping rice_parameter (%u -> %u) @1\n", rice_parameter, rice_parameter_limit - 1);
+ #endif
+ rice_parameter = rice_parameter_limit - 1;
+@@ -4156,7 +4156,7 @@ FLAC__bool set_partitioned_rice_(
+ min_rice_parameter = suggested_rice_parameter - rice_parameter_search_dist;
+ max_rice_parameter = suggested_rice_parameter + rice_parameter_search_dist;
+ if(max_rice_parameter >= rice_parameter_limit) {
+-#ifdef DEBUG_VERBOSE
++#ifndef NDEBUG
+ fprintf(stderr, "clipping rice_parameter (%u -> %u) @5\n", max_rice_parameter, rice_parameter_limit - 1);
+ #endif
+ max_rice_parameter = rice_parameter_limit - 1;
+@@ -4246,7 +4246,7 @@ FLAC__bool set_partitioned_rice_(
+ }
+ #endif
+ if(rice_parameter >= rice_parameter_limit) {
+-#ifdef DEBUG_VERBOSE
++#ifndef NDEBUG
+ fprintf(stderr, "clipping rice_parameter (%u -> %u) @6\n", rice_parameter, rice_parameter_limit - 1);
+ #endif
+ rice_parameter = rice_parameter_limit - 1;
+@@ -4261,7 +4261,7 @@ FLAC__bool set_partitioned_rice_(
+ min_rice_parameter = rice_parameter - rice_parameter_search_dist;
+ max_rice_parameter = rice_parameter + rice_parameter_search_dist;
+ if(max_rice_parameter >= rice_parameter_limit) {
+-#ifdef DEBUG_VERBOSE
++#ifndef NDEBUG
+ fprintf(stderr, "clipping rice_parameter (%u -> %u) @7\n", max_rice_parameter, rice_parameter_limit - 1);
+ #endif
+ max_rice_parameter = rice_parameter_limit - 1;
+diff --git a/src/plugin_common/Makefile.am b/src/plugin_common/Makefile.am
+index 6e9e3ed3..a528fb45 100644
+--- a/src/plugin_common/Makefile.am
++++ b/src/plugin_common/Makefile.am
+@@ -37,9 +37,3 @@ libplugin_common_la_SOURCES = \
+ EXTRA_DIST = \
+ Makefile.lite \
+ README
+-
+-debug:
+- $(MAKE) all CFLAGS="@DEBUG@"
+-
+-profile:
+- $(MAKE) all CFLAGS="@PROFILE@"
+diff --git a/src/plugin_common/charset.c b/src/plugin_common/charset.c
+index 5dded8a0..85e574bc 100644
+--- a/src/plugin_common/charset.c
++++ b/src/plugin_common/charset.c
+@@ -75,7 +75,7 @@ char* FLAC_plugin__charset_convert_string (const char *string, char *from, char
+
+ if ((cd = iconv_open(to, from)) == (iconv_t)-1)
+ {
+-#ifdef DEBUG
++#ifndef NDEBUG
+ fprintf(stderr, "convert_string(): Conversion not supported. Charsets: %s -> %s", from, to);
+ #endif
+ return strdup(string);
+@@ -115,7 +115,7 @@ retry:
+ length = strlen(input);
+ goto retry;
+ default:
+-#ifdef DEBUG
++#ifndef NDEBUG
+ fprintf(stderr, "convert_string(): Conversion failed. Inputstring: %s; Error: %s", string, strerror(errno));
+ #endif
+ break;
+diff --git a/src/plugin_xmms/http.c b/src/plugin_xmms/http.c
+index 2f31576c..4bb81870 100644
+--- a/src/plugin_xmms/http.c
++++ b/src/plugin_xmms/http.c
+@@ -61,8 +61,6 @@ static gint icy_metaint = 0;
+
+ extern InputPlugin flac_ip;
+
+-#undef DEBUG_UDP
+-
+ /* Static udp channel functions */
+ static int udp_establish_listener (gint *sock);
+ static int udp_check_for_data(gint sock);
+@@ -573,7 +571,7 @@ static int http_connect (gchar *url_, gboolean head, guint64 offset)
+ if (!strncmp(line, "icy-metaint:", 12))
+ icy_metaint = atoi(line + 12);
+ if (!strncmp(line, "x-audiocast-udpport:", 20)) {
+-#ifdef DEBUG_UDP
++#ifndef NDEBUG
+ fprintf (stderr, "Server wants udp messages on port %d\n", atoi (line + 20));
+ #endif
+ /*udp_serverport = atoi (line + 20);*/
+@@ -752,7 +750,7 @@ static int udp_establish_listener(int *sock)
+ struct sockaddr_in sin;
+ socklen_t sinlen = sizeof (struct sockaddr_in);
+
+-#ifdef DEBUG_UDP
++#ifndef NDEBUG
+ fprintf (stderr,"Establishing udp listener\n");
+ #endif
+
+@@ -791,7 +789,7 @@ static int udp_establish_listener(int *sock)
+ return -1;
+ }
+
+-#ifdef DEBUG_UDP
++#ifndef NDEBUG
+ fprintf (stderr,"Listening on local %s:%d\n", inet_ntoa(sin.sin_addr), g_ntohs(sin.sin_port));
+ #endif
+
+@@ -820,7 +818,7 @@ static int udp_check_for_data(int sock)
+ return 0;
+ }
+ buf[len] = '\0';
+-#ifdef DEBUG_UDP
++#ifndef NDEBUG
+ fprintf (stderr,"Received: [%s]\n", buf);
+ #endif
+ lines = g_strsplit(buf, "\n", 0);
+@@ -889,7 +887,7 @@ static int udp_check_for_data(int sock)
+ g_log(NULL, G_LOG_LEVEL_WARNING,
+ "udp_check_for_data(): Unable to send ack to server: %s", strerror(errno));
+ }
+-#ifdef DEBUG_UDP
++#ifndef NDEBUG
+ else
+ fprintf(stderr,"Sent ack: %s", obuf);
+ fprintf (stderr,"Remote: %s:%d\n", inet_ntoa(from.sin_addr), g_ntohs(from.sin_port));
+diff --git a/src/share/Makefile.am b/src/share/Makefile.am
+index 82d0fc96..8e3984a1 100644
+--- a/src/share/Makefile.am
++++ b/src/share/Makefile.am
+@@ -92,9 +92,3 @@ replaygain_analysis_libreplaygain_analysis_la_SOURCES = replaygain_analysis/repl
+
+ replaygain_synthesis_libreplaygain_synthesis_la_CFLAGS = -I $(top_srcdir)/src/share/replaygain_synthesis/include
+ replaygain_synthesis_libreplaygain_synthesis_la_SOURCES = replaygain_synthesis/replaygain_synthesis.c
+-
+-debug:
+- $(MAKE) all CFLAGS="@DEBUG@"
+-
+-profile:
+- $(MAKE) all CFLAGS="@PROFILE@"
+--
+2.11.0
+
diff --git a/media-libs/flac/files/flac-1.3.2-dontbuild-examples.patch b/media-libs/flac/files/flac-1.3.2-dontbuild-examples.patch
new file mode 100644
index 000000000000..65d072f1c326
--- /dev/null
+++ b/media-libs/flac/files/flac-1.3.2-dontbuild-examples.patch
@@ -0,0 +1,46 @@
+From 04fa72caeae0f8dd7accb623d7f672fc3b190708 Mon Sep 17 00:00:00 2001
+From: David Seifert <soap@gentoo.org>
+Date: Fri, 13 Jan 2017 16:11:08 +0100
+Subject: [PATCH 2/4] Make building/installing examples optional
+
+---
+ Makefile.am | 6 +++++-
+ configure.ac | 5 +++++
+ 2 files changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index a325e3a9..38aea04a 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -31,7 +31,11 @@
+
+ ACLOCAL_AMFLAGS = -I m4
+
+-SUBDIRS = doc include m4 man src examples test build objs microbench
++SUBDIRS = doc include m4 man src test build objs microbench
++
++if EXAMPLES
++SUBDIRS += examples
++endif
+
+ EXTRA_DIST = \
+ COPYING.FDL \
+diff --git a/configure.ac b/configure.ac
+index ba97bac0..9eb2c243 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -353,6 +353,11 @@ AC_DEFINE_UNQUOTED([FLAC__HAS_OGG],$FLAC__HAS_OGG,[define if you have the ogg li
+ AC_SUBST(FLAC__HAS_OGG)
+ AC_SUBST(OGG_PACKAGE)
+
++dnl Build examples?
++AC_ARG_ENABLE([examples],
++ AS_HELP_STRING([--disable-examples], [Don't build and install examples]))
++AM_CONDITIONAL([EXAMPLES], [test "x$enable_examples" != "xno"])
++
+ dnl check for i18n(internationalization); these are from libiconv/gettext
+ AM_ICONV
+ AM_LANGINFO_CODESET
+--
+2.11.0
+
diff --git a/media-libs/flac/files/flac-1.3.2-fortify-sources.patch b/media-libs/flac/files/flac-1.3.2-fortify-sources.patch
new file mode 100644
index 000000000000..cfc0b5a93659
--- /dev/null
+++ b/media-libs/flac/files/flac-1.3.2-fortify-sources.patch
@@ -0,0 +1,15 @@
+Remove setting -D_FORTIFY_SOURCE=2, as Gentoo's GCC already
+enables it by default, causing unnecessary churn:
+
+* <command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -400,7 +393,6 @@
+ CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wcast-align -Wshadow -Wwrite-strings -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder -Wsign-promo -Wundef " # -Wcast-qual -Wbad-function-cast -Wwrite-strings -Woverloaded-virtual -Wmissing-declarations
+
+ XIPH_ADD_CFLAGS([-Wdeclaration-after-statement])
+- XIPH_ADD_CFLAGS([-D_FORTIFY_SOURCE=2])
+
+ AC_LANG_PUSH([C++])
+ XIPH_ADD_CXXFLAGS([-Weffc++])
diff --git a/media-libs/flac/files/flac-1.3.2-honor-htmldir.patch b/media-libs/flac/files/flac-1.3.2-honor-htmldir.patch
new file mode 100644
index 000000000000..c5ab67c0b60e
--- /dev/null
+++ b/media-libs/flac/files/flac-1.3.2-honor-htmldir.patch
@@ -0,0 +1,75 @@
+From a6b26535bb0b94309377479ccd4ad43d074ef9ae Mon Sep 17 00:00:00 2001
+From: David Seifert <soap@gentoo.org>
+Date: Fri, 13 Jan 2017 16:12:42 +0100
+Subject: [PATCH 3/4] Honor user's $(htmldir) and do not override GNU defaults
+ for $(docdir)
+
+* HTML files should be installed to $(htmldir), and $(docdir) should
+ not be changed, as this is a user flag in the GNU conventions.
+---
+ doc/Makefile.am | 2 --
+ doc/html/Makefile.am | 10 ++++------
+ doc/html/images/Makefile.am | 4 ++--
+ 3 files changed, 6 insertions(+), 10 deletions(-)
+
+diff --git a/doc/Makefile.am b/doc/Makefile.am
+index fb79e3a7..bc9ae52a 100644
+--- a/doc/Makefile.am
++++ b/doc/Makefile.am
+@@ -31,8 +31,6 @@ FLAC.tag:
+ mkdir -p html/api
+ endif
+
+-docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)
+-
+ doc_DATA = \
+ FLAC.tag
+
+diff --git a/doc/html/Makefile.am b/doc/html/Makefile.am
+index 813b55f2..ef4a12d8 100644
+--- a/doc/html/Makefile.am
++++ b/doc/html/Makefile.am
+@@ -18,9 +18,7 @@
+
+ SUBDIRS = images
+
+-docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)/html
+-
+-doc_DATA = \
++html_DATA = \
+ changelog.html \
+ developers.html \
+ documentation.html \
+@@ -46,10 +44,10 @@ if FLaC__HAS_DOXYGEN
+ # The install targets don't copy whole directories so we have to
+ # handle 'api/' specially:
+ install-data-local:
+- $(mkinstalldirs) $(DESTDIR)$(docdir)/api
+- (cd $(builddir)/api && $(INSTALL_DATA) * $(DESTDIR)$(docdir)/api)
++ $(mkinstalldirs) $(DESTDIR)$(htmldir)/api
++ (cd $(builddir)/api && $(INSTALL_DATA) * $(DESTDIR)$(htmldir)/api)
+ uninstall-local:
+- rm -rf $(DESTDIR)$(docdir)/api
++ rm -rf $(DESTDIR)$(htmldir)/api
+ distclean-local:
+ -rm -rf api
+ endif
+diff --git a/doc/html/images/Makefile.am b/doc/html/images/Makefile.am
+index 33485f3a..f8f551da 100644
+--- a/doc/html/images/Makefile.am
++++ b/doc/html/images/Makefile.am
+@@ -16,9 +16,9 @@
+ # restrictive of those mentioned above. See the file COPYING.Xiph in this
+ # distribution.
+
+-docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)/html/images
++logosdir = $(htmldir)/images
+
+-doc_DATA = \
++logos_DATA = \
+ logo.svg \
+ logo130.gif
+
+--
+2.11.0
+
diff --git a/media-libs/flac/flac-1.3.2-r1.ebuild b/media-libs/flac/flac-1.3.2-r1.ebuild
new file mode 100644
index 000000000000..5c43c541d2c7
--- /dev/null
+++ b/media-libs/flac/flac-1.3.2-r1.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools multilib-minimal
+
+DESCRIPTION="free lossless audio encoder and decoder"
+HOMEPAGE="https://xiph.org/flac/"
+SRC_URI="https://downloads.xiph.org/releases/${PN}/${P}.tar.xz"
+
+LICENSE="BSD FDL-1.2 GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+IUSE="altivec +cxx debug ogg cpu_flags_x86_sse static-libs"
+
+RDEPEND="ogg? ( >=media-libs/libogg-1.3.0[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ abi_x86_32? ( dev-lang/nasm )
+ !elibc_uclibc? ( sys-devel/gettext )
+ virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.3.2-cflags.patch
+ "${FILESDIR}"/${PN}-1.3.2-asneeded.patch
+ "${FILESDIR}"/${PN}-1.3.0-dontbuild-tests.patch
+ "${FILESDIR}"/${PN}-1.3.2-dontbuild-examples.patch
+ "${FILESDIR}"/${PN}-1.3.2-honor-htmldir.patch
+ "${FILESDIR}"/${PN}-1.3.2-fortify-sources.patch
+)
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+multilib_src_configure() {
+ local myeconfargs=(
+ --disable-doxygen-docs
+ --disable-examples
+ --disable-xmms-plugin
+ $([[ ${CHOST} == *-darwin* ]] && echo "--disable-asm-optimizations")
+ $(use_enable altivec)
+ $(use_enable cpu_flags_x86_sse sse)
+ $(use_enable cxx cpplibs)
+ $(use_enable debug)
+ $(use_enable ogg)
+ $(use_enable static-libs static)
+
+ # cross-compile fix (bug #521446)
+ # no effect if ogg support is disabled
+ --with-ogg
+ )
+ ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
+}
+
+multilib_src_test() {
+ if [[ ${UID} != 0 ]]; then
+ emake -j1 check
+ else
+ ewarn "Tests will fail if ran as root, skipping."
+ fi
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ find "${D}" -name '*.la' -delete || die
+}
diff --git a/media-libs/flac/metadata.xml b/media-libs/flac/metadata.xml
new file mode 100644
index 000000000000..ca43654a0a1e
--- /dev/null
+++ b/media-libs/flac/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sound@gentoo.org</email>
+ <name>Gentoo Sound project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">flac</remote-id>
+ </upstream>
+</pkgmetadata>