* [gentoo-commits] proj/hardened-dev:musl commit in: media-libs/alsa-lib/, media-libs/alsa-lib/files/
@ 2014-02-22 14:27 Anthony G. Basile
0 siblings, 0 replies; only message in thread
From: Anthony G. Basile @ 2014-02-22 14:27 UTC (permalink / raw
To: gentoo-commits
commit: ebd50f054246ca05a7e3c0452ee261ac5bb82127
Author: Felix Janda <felix.janda <AT> posteo <DOT> de>
AuthorDate: Sun Feb 16 21:39:07 2014 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sat Feb 22 14:28:04 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=ebd50f05
media-libs/alsa-lib: move to tree
---
media-libs/alsa-lib/alsa-lib-1.0.27.1-r99.ebuild | 79 ++++++++++++++++++++++
.../alsa-lib/files/alsa-lib-1.0.25-pcm-h.patch | 27 ++++++++
.../alsa-lib/files/alsa-lib-1.0.27.1-musl.patch | 24 +++++++
.../alsa-lib/files/alsa-lib-1.0.27.1-rewind.patch | 40 +++++++++++
.../files/alsa-lib-1.0.27.2-portable-mutex.patch | 35 ++++++++++
media-libs/alsa-lib/metadata.xml | 14 ++++
6 files changed, 219 insertions(+)
diff --git a/media-libs/alsa-lib/alsa-lib-1.0.27.1-r99.ebuild b/media-libs/alsa-lib/alsa-lib-1.0.27.1-r99.ebuild
new file mode 100644
index 0000000..7f8b983
--- /dev/null
+++ b/media-libs/alsa-lib/alsa-lib-1.0.27.1-r99.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/alsa-lib/alsa-lib-1.0.27.1.ebuild,v 1.15 2013/09/01 18:36:03 ago Exp $
+
+EAPI=5
+
+# no support for python3_2 or above yet wrt #471326
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools eutils multilib python-single-r1
+
+DESCRIPTION="Advanced Linux Sound Architecture Library"
+HOMEPAGE="http://www.alsa-project.org/"
+SRC_URI="mirror://alsaproject/lib/${P}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 arm x86"
+IUSE="doc debug alisp python"
+
+RDEPEND="python? ( ${PYTHON_DEPS} )"
+DEPEND="${RDEPEND}
+ doc? ( >=app-doc/doxygen-1.2.6 )"
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ find . -name Makefile.am -exec sed -i -e '/CFLAGS/s:-g -O2::' {} + || die
+ # force use of correct python-config wrt #478802
+ if [[ ${ABI} == ${DEFAULT_ABI} ]]; then
+ use python && { sed -i -e "s:python-config:$EPYTHON-config:" configure.in || die; }
+ fi
+ epatch "${FILESDIR}"/${P}-rewind.patch #477282
+ epatch "${FILESDIR}"/${P}-musl.patch
+ epatch "${FILESDIR}"/${PN}-1.0.25-pcm-h.patch
+ epatch "${FILESDIR}"/${PN}-1.0.27.2-portable-mutex.patch
+ epatch_user
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+ use elibc_uclibc && myconf="--without-versioned"
+
+ ECONF_SOURCE=${S} \
+ econf \
+ --disable-maintainer-mode \
+ --enable-shared \
+ --disable-resmgr \
+ --enable-rawmidi \
+ --enable-seq \
+ --enable-aload \
+ $(use_with debug) \
+ $(use_enable alisp) \
+ $(use_enable python) \
+ ${myconf}
+}
+
+src_compile() {
+ emake
+
+ if use doc; then
+ emake doc
+ fgrep -Zrl "${S}" doc/doxygen/html | \
+ xargs -0 sed -i -e "s:${S}::"
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ if use doc; then
+ dohtml -r doc/doxygen/html/.
+ fi
+ prune_libtool_files --all
+ find "${ED}"/usr/$(get_libdir)/alsa-lib -name '*.a' -exec rm -f {} +
+ dodoc ChangeLog doc/asoundrc.txt NOTES TODO
+}
diff --git a/media-libs/alsa-lib/files/alsa-lib-1.0.25-pcm-h.patch b/media-libs/alsa-lib/files/alsa-lib-1.0.25-pcm-h.patch
new file mode 100644
index 0000000..7d6dc13
--- /dev/null
+++ b/media-libs/alsa-lib/files/alsa-lib-1.0.25-pcm-h.patch
@@ -0,0 +1,27 @@
+taken from sabotage linux
+
+--- alsa-lib-1.0.25/include/pcm.h
++++ alsa-lib-1.0.25.patched/include/pcm.h
+@@ -33,6 +33,7 @@
+ extern "C" {
+ #endif
+
++#include <stdint.h>
+ /**
+ * \defgroup PCM PCM Interface
+ * See the \ref pcm page for more details.
+@@ -941,10 +942,10 @@
+ int snd_pcm_format_physical_width(snd_pcm_format_t format); /* in bits */
+ snd_pcm_format_t snd_pcm_build_linear_format(int width, int pwidth, int unsignd, int big_endian);
+ ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples);
+-u_int8_t snd_pcm_format_silence(snd_pcm_format_t format);
+-u_int16_t snd_pcm_format_silence_16(snd_pcm_format_t format);
+-u_int32_t snd_pcm_format_silence_32(snd_pcm_format_t format);
+-u_int64_t snd_pcm_format_silence_64(snd_pcm_format_t format);
++uint8_t snd_pcm_format_silence(snd_pcm_format_t format);
++uint16_t snd_pcm_format_silence_16(snd_pcm_format_t format);
++uint32_t snd_pcm_format_silence_32(snd_pcm_format_t format);
++uint64_t snd_pcm_format_silence_64(snd_pcm_format_t format);
+ int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int samples);
+
+ snd_pcm_sframes_t snd_pcm_bytes_to_frames(snd_pcm_t *pcm, ssize_t bytes);
diff --git a/media-libs/alsa-lib/files/alsa-lib-1.0.27.1-musl.patch b/media-libs/alsa-lib/files/alsa-lib-1.0.27.1-musl.patch
new file mode 100644
index 0000000..0521fe0
--- /dev/null
+++ b/media-libs/alsa-lib/files/alsa-lib-1.0.27.1-musl.patch
@@ -0,0 +1,24 @@
+diff -ur a/alsa-lib-1.0.27.1/configure.in b/alsa-lib-1.0.27.1/configure.in
+--- a/alsa-lib-1.0.27.1/configure.in 2013-05-21 08:48:28.000000000 +0000
++++ b/alsa-lib-1.0.27.1/configure.in 2014-02-16 21:04:29.833236371 +0000
+@@ -64,7 +64,7 @@
+
+ dnl Checks for library functions.
+ AC_PROG_GCC_TRADITIONAL
+-AC_CHECK_FUNC([hsearch_r], [HAVE_HSEARCH_R=yes])
++AC_CHECK_FUNC([hsearch], [HAVE_HSEARCH_R=yes])
+ AM_CONDITIONAL([ALSA_HSEARCH_R], [test "x$HAVE_HSEARCH_R" != xyes])
+ AC_CHECK_FUNCS([uselocale])
+
+diff -ur a/alsa-lib-1.0.27.1/include/global.h b/alsa-lib-1.0.27.1/include/global.h
+--- a/alsa-lib-1.0.27.1/include/global.h 2013-05-21 08:48:28.000000000 +0000
++++ b/alsa-lib-1.0.27.1/include/global.h 2014-02-16 20:08:10.954478169 +0000
+@@ -133,7 +133,7 @@
+
+ int snd_user_file(const char *file, char **result);
+
+-#if !defined(_POSIX_C_SOURCE) && !defined(_POSIX_SOURCE)
++#if 0
+ struct timeval {
+ time_t tv_sec; /* seconds */
+ long tv_usec; /* microseconds */
diff --git a/media-libs/alsa-lib/files/alsa-lib-1.0.27.1-rewind.patch b/media-libs/alsa-lib/files/alsa-lib-1.0.27.1-rewind.patch
new file mode 100644
index 0000000..f585645
--- /dev/null
+++ b/media-libs/alsa-lib/files/alsa-lib-1.0.27.1-rewind.patch
@@ -0,0 +1,40 @@
+From f2d39afe6139ab16aa2aeea0f51f32db79ab1262 Mon Sep 17 00:00:00 2001
+From: David Henningsson <david.henningsson@canonical.com>
+Date: Thu, 30 May 2013 12:26:34 +0200
+Subject: [PATCH] pcm_plugin: Fix return value of snd_pcm_rewind
+
+In case the rewind did not rewind as much as expected, e g due to
+time delay between the latest avail update and the rewind, we must
+properly account for that in the plugin layer.
+
+Otherwise, the plugin's appl ptr and the hw's appl ptr become
+unsynchronised, which is very bad, especially in mmap_shadow plugins,
+e g, this could cause the overlapping memcpy in the softvol plugin
+as seen here:
+https://bugs.freedesktop.org/show_bug.cgi?id=64299
+
+Signed-off-by: David Henningsson <david.henningsson@canonical.com>
+Signed-off-by: Jaroslav Kysela <perex@perex.cz>
+---
+ src/pcm/pcm_plugin.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c
+index 96218a8..17157e8 100644
+--- a/src/pcm/pcm_plugin.c
++++ b/src/pcm/pcm_plugin.c
+@@ -219,9 +219,9 @@ static snd_pcm_sframes_t snd_pcm_plugin_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t
+ snd_atomic_write_end(&plugin->watom);
+ return sframes;
+ }
+- snd_pcm_mmap_appl_backward(pcm, (snd_pcm_uframes_t) frames);
++ snd_pcm_mmap_appl_backward(pcm, (snd_pcm_uframes_t) sframes);
+ snd_atomic_write_end(&plugin->watom);
+- return (snd_pcm_sframes_t) frames;
++ return (snd_pcm_sframes_t) sframes;
+ }
+
+ static snd_pcm_sframes_t snd_pcm_plugin_forwardable(snd_pcm_t *pcm)
+--
+1.7.11.7
+
diff --git a/media-libs/alsa-lib/files/alsa-lib-1.0.27.2-portable-mutex.patch b/media-libs/alsa-lib/files/alsa-lib-1.0.27.2-portable-mutex.patch
new file mode 100644
index 0000000..c4f90d2
--- /dev/null
+++ b/media-libs/alsa-lib/files/alsa-lib-1.0.27.2-portable-mutex.patch
@@ -0,0 +1,35 @@
+taken from sabotage linux
+
+--- alsa-lib-1.0.27.2.orig/src/conf.c
++++ alsa-lib-1.0.27.2/src/conf.c
+@@ -427,8 +427,8 @@
+ #ifndef DOC_HIDDEN
+
+ #ifdef HAVE_LIBPTHREAD
+-static pthread_mutex_t snd_config_update_mutex =
+- PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
++static pthread_mutex_t snd_config_update_mutex;
++static pthread_once_t snd_config_update_mutex_once = PTHREAD_ONCE_INIT;
+ #endif
+
+ struct _snd_config {
+@@ -472,8 +472,19 @@
+
+ #ifdef HAVE_LIBPTHREAD
+
++static void snd_config_init_mutex(void)
++{
++ pthread_mutexattr_t attr;
++
++ pthread_mutexattr_init(&attr);
++ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
++ pthread_mutex_init(&snd_config_update_mutex, &attr);
++ pthread_mutexattr_destroy(&attr);
++}
++
+ static inline void snd_config_lock(void)
+ {
++ pthread_once(&snd_config_update_mutex_once, snd_config_init_mutex);
+ pthread_mutex_lock(&snd_config_update_mutex);
+ }
+
diff --git a/media-libs/alsa-lib/metadata.xml b/media-libs/alsa-lib/metadata.xml
new file mode 100644
index 0000000..0ea67ae
--- /dev/null
+++ b/media-libs/alsa-lib/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>alsa</herd>
+ <maintainer>
+ <email>alsa-bugs@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="alisp">Enable support for ALISP (ALSA LISP) interpreter for advanced features.</flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:alsa-project:alsa-lib</remote-id>
+ </upstream>
+</pkgmetadata>
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-02-22 14:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-22 14:27 [gentoo-commits] proj/hardened-dev:musl commit in: media-libs/alsa-lib/, media-libs/alsa-lib/files/ Anthony G. Basile
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox