summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Seifert <soap@gentoo.org>2016-02-12 22:17:21 +0100
committerDavid Seifert <soap@gentoo.org>2016-02-12 22:17:35 +0100
commitc3f25a35664cfe0d06ff946157e2302fed763710 (patch)
tree1c6d1720df207d3a52712cd292e976c67c951e22 /media-sound/linuxsampler
parentdev-php/pecl-mailparse: Version bump (diff)
downloadgentoo-c3f25a35664cfe0d06ff946157e2302fed763710.tar.gz
gentoo-c3f25a35664cfe0d06ff946157e2302fed763710.tar.bz2
gentoo-c3f25a35664cfe0d06ff946157e2302fed763710.zip
media-sound/linuxsampler: Fix undefined behaviour in NPTL test
Gentoo-Bug: 537516 * EAPI=6 * Replace PTHREAD_CANCEL_ASYNCHRONOUS, which is undefined behaviour when used for a non-pure function Package-Manager: portage-2.2.27
Diffstat (limited to 'media-sound/linuxsampler')
-rw-r--r--media-sound/linuxsampler/files/linuxsampler-2.0.0-nptl-hardened.patch15
-rw-r--r--media-sound/linuxsampler/linuxsampler-2.0.0-r1.ebuild58
2 files changed, 73 insertions, 0 deletions
diff --git a/media-sound/linuxsampler/files/linuxsampler-2.0.0-nptl-hardened.patch b/media-sound/linuxsampler/files/linuxsampler-2.0.0-nptl-hardened.patch
new file mode 100644
index 000000000000..0c61f096c213
--- /dev/null
+++ b/media-sound/linuxsampler/files/linuxsampler-2.0.0-nptl-hardened.patch
@@ -0,0 +1,15 @@
+Fix breakage caused by undefined behaviour. Using PTHREAD_CANCEL_ASYNCHRONOUS
+is only allowed in pure functions.
+See also: https://bugs.gentoo.org/show_bug.cgi?id=537516
+
+--- linuxsampler-2.0.0/m4/nptl_bug.m4
++++ linuxsampler-2.0.0/m4/nptl_bug.m4
+@@ -47,7 +47,7 @@
+ void* __pthread_launcher(void* p) {
+ // let the thread be killable under any circumstances
+ // (without this function call, this test always succeeds !)
+- pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
++ pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
+
+ // this will block this 2nd thread, since we already
+ // locked this mutex by the main thread
diff --git a/media-sound/linuxsampler/linuxsampler-2.0.0-r1.ebuild b/media-sound/linuxsampler/linuxsampler-2.0.0-r1.ebuild
new file mode 100644
index 000000000000..4806c00cf796
--- /dev/null
+++ b/media-sound/linuxsampler/linuxsampler-2.0.0-r1.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit autotools eutils
+
+DESCRIPTION="LinuxSampler is a software audio sampler engine with professional grade features"
+HOMEPAGE="http://www.linuxsampler.org/"
+SRC_URI="http://download.linuxsampler.org/packages/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc jack sqlite static-libs"
+
+RDEPEND="sqlite? ( >=dev-db/sqlite-3.3 )
+ >=media-libs/libgig-4.0.0
+ media-libs/alsa-lib
+ jack? ( media-sound/jack-audio-connection-kit )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )"
+PATCHES=(
+ "${FILESDIR}/${P}-nptl-hardened.patch"
+)
+
+src_prepare() {
+ default
+ # Force regeneration of the file to let it build with all bison
+ # versions, bug #556204
+ rm src/network/lscpparser.cpp || die
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --enable-alsa-driver \
+ --disable-arts-driver \
+ $(use_enable jack jack-driver) \
+ $(use_enable sqlite instruments-db) \
+ $(use_enable static-libs static)
+}
+
+src_compile() {
+ default
+ use doc && emake docs
+}
+
+src_install() {
+ default
+
+ docinto html
+ use doc && dodoc -r doc/html/*
+
+ prune_libtool_files
+}