summaryrefslogtreecommitdiff
path: root/dev-tcltk/snack
diff options
context:
space:
mode:
Diffstat (limited to 'dev-tcltk/snack')
-rw-r--r--dev-tcltk/snack/Manifest6
-rw-r--r--dev-tcltk/snack/files/alsa-undef-sym.patch49
-rw-r--r--dev-tcltk/snack/files/snack-2.2.10-CVE-2012-6303-fix.patch19
-rw-r--r--dev-tcltk/snack/files/snack-2.2.10-darwin.patch28
-rw-r--r--dev-tcltk/snack/metadata.xml8
-rw-r--r--dev-tcltk/snack/snack-2.2.10-r6.ebuild97
6 files changed, 207 insertions, 0 deletions
diff --git a/dev-tcltk/snack/Manifest b/dev-tcltk/snack/Manifest
new file mode 100644
index 000000000000..c4dceb3a8ce9
--- /dev/null
+++ b/dev-tcltk/snack/Manifest
@@ -0,0 +1,6 @@
+AUX alsa-undef-sym.patch 1225 BLAKE2B 330c8e3da69aebe63fff74cdf32ab5fce303d6f2ffc2f5a06d9d2e406064e2758527cf3891a43d9971509c52a2fdcb30a1c1798f41a9c6f7d12004cceb53d68b SHA512 2f925029ca7ebcf0028beb2c303d07831879d9750b5f4f463a8d463964301d0182650b9ad50b103be6c0e5eb4cb58a19e02496b7afee8531dcb2c132a292ff97
+AUX snack-2.2.10-CVE-2012-6303-fix.patch 778 BLAKE2B f6f34248825da751e81f4079d70fa7dec4dcbc5e63931aee58ad1f021e0a47f0bfdc7a52e69693bf32bae618a49f5c35c757694dd14984ebc79cd62acce2bda7 SHA512 6e2f7fcf8ca0c2792cf52432340f2319b8c82677a3568c9e382f91758f5e6bf26c3a05939d4a748c4198c4e50f27141ebd2cb298d8363765ed6582192d64d3e8
+AUX snack-2.2.10-darwin.patch 1108 BLAKE2B 862cd6a36363b45c9a27af08fa4bf347fc3e1a8fbbf972b72dfb4faf4cb135365fbe06377a20a2b77e02126e27de723b642067d8ccedb9947b9aa873069152ce SHA512 0d82270d830c8b7d15dcbead05d80c15666d1bac164f26c045859f7f4dc4c098961b48272ecd0b059a1b36ba8d560c563fe8e40add822f311026faf5f7eeaf0a
+DIST snack2.2.10.tar.gz 1798252 BLAKE2B e27b8e7d6082cdcfc06e7eea5ab832fb78ba104de9e56a69c6c9cd688183f7d4c6bdb974e4d5d2bf5ef2bc5518a913ddf17c90db8d10cef4dbee533307cc7718 SHA512 c17ad332fa4f3ded006b97ceca85cada079e4c7cd933768b289c13dadca1b8803fccaf709ec2def5af4abe92c307f25597ebfa6f94df2d681e40815cd7eccb9b
+EBUILD snack-2.2.10-r6.ebuild 2012 BLAKE2B db70db5649537e2a4fb3d4484eafd6366e016b384415ec40330c4ff345c934c8554fdd34a91734c074d37096401ae883ad8d359deeeb6fb465950c16157cb0bf SHA512 30849b4e77e6177d41d32004ad1026ef44a57d654d25e583ebe6e7a16a08d0224ea3a79e0df62c7238b19b3d92fb1ab51325404e7f1e5e324208e3ccbeb13d62
+MISC metadata.xml 259 BLAKE2B 174c3c7b4292350e73a38b09d473abba172ee6e82ca1b5bcb6815a9927609a7fbac063a19498e7c5deaa32530d10d8c493760ff5b6e489f821410cfeccadf566 SHA512 5943f2c9dc9a55862bae4c01be9e1f27304ffc1ce48d67341b4a19793c0bb11fe3d1a419af924ac360aeeafbce28018971602019a559a8a6c5939e05e3567639
diff --git a/dev-tcltk/snack/files/alsa-undef-sym.patch b/dev-tcltk/snack/files/alsa-undef-sym.patch
new file mode 100644
index 000000000000..77a222754fe1
--- /dev/null
+++ b/dev-tcltk/snack/files/alsa-undef-sym.patch
@@ -0,0 +1,49 @@
+--- unix/jkAudIO_alsa.c 2005-12-14 12:29:38.000000000 +0100
++++ unix/jkAudIO_alsa.c 2008-09-01 22:51:20.000000000 +0200
+@@ -49,6 +49,8 @@
+
+ static int minNumChan = 1;
+
++static snd_pcm_uframes_t hw_bufsize = 0;
++
+ int
+ SnackAudioOpen(ADesc *A, Tcl_Interp *interp, char *device, int mode, int freq,
+ int nchannels, int encoding)
+@@ -135,6 +137,9 @@
+ Tcl_AppendResult(interp, "Failed setting HW params.", NULL);
+ return TCL_ERROR;
+ }
++
++ snd_pcm_hw_params_get_buffer_size (hw_params, &hw_bufsize);
++
+ snd_pcm_hw_params_free(hw_params);
+ snd_pcm_prepare(A->handle);
+ if (A->mode == RECORD) {
+@@ -202,6 +207,8 @@
+ int i;
+ static char buf[64];
+
++ return;
++
+ if (A->debug > 1) Snack_WriteLog(" Enter SnackAudioPost\n");
+
+ for (i = 0; i < 1000; i++) {
+@@ -267,12 +274,14 @@
+ long
+ SnackAudioPlayed(ADesc *A)
+ {
+- long avail = _snd_pcm_mmap_hw_ptr(A->handle);
++ // FIX Here, _snd_pcm_mmap_hw_ptr is deprecated in new alsalib
++ long played = A->nWritten - (hw_bufsize - SnackAudioWriteable(A));
++ // long avail = _snd_pcm_mmap_hw_ptr(A->handle);
+
+- if (avail < 0)
+- avail = 0;
++ if (played < 0)
++ return 0;
+
+- return (avail+A->nPlayed);
++ return (played);
+ }
+
+ void \ No newline at end of file
diff --git a/dev-tcltk/snack/files/snack-2.2.10-CVE-2012-6303-fix.patch b/dev-tcltk/snack/files/snack-2.2.10-CVE-2012-6303-fix.patch
new file mode 100644
index 000000000000..6326e8a48d04
--- /dev/null
+++ b/dev-tcltk/snack/files/snack-2.2.10-CVE-2012-6303-fix.patch
@@ -0,0 +1,19 @@
+diff -up snack2.2.10/generic/jkSoundFile.c.CVE20126303 snack2.2.10/generic/jkSoundFile.c
+--- snack2.2.10/generic/jkSoundFile.c.CVE20126303 2013-01-02 11:26:15.496231056 -0500
++++ snack2.2.10/generic/jkSoundFile.c 2013-01-02 11:27:26.134250662 -0500
+@@ -1798,7 +1798,14 @@ static int
+ GetHeaderBytes(Sound *s, Tcl_Interp *interp, Tcl_Channel ch, char *buf,
+ int len)
+ {
+- int rlen = Tcl_Read(ch, &buf[s->firstNRead], len - s->firstNRead);
++ int rlen;
++
++ if (len > max(CHANNEL_HEADER_BUFFER, HEADBUF)){
++ Tcl_AppendResult(interp, "Excessive header size", NULL);
++ return TCL_ERROR;
++ }
++
++ rlen = Tcl_Read(ch, &buf[s->firstNRead], len - s->firstNRead);
+
+ if (rlen < len - s->firstNRead){
+ Tcl_AppendResult(interp, "Failed reading header bytes", NULL);
diff --git a/dev-tcltk/snack/files/snack-2.2.10-darwin.patch b/dev-tcltk/snack/files/snack-2.2.10-darwin.patch
new file mode 100644
index 000000000000..8c6dc5285863
--- /dev/null
+++ b/dev-tcltk/snack/files/snack-2.2.10-darwin.patch
@@ -0,0 +1,28 @@
+* grobian@gentoo.org: need all symbols to be satisfied, need
+ install_name for actual usage
+
+--- unix/Makefile.in
++++ unix/Makefile.in
+@@ -35,7 +35,7 @@
+
+ LIBSO = -lc @ALIB@ @TCL_LIB_SPEC@
+
+-LIBSN = -lc @TK_LIBS@ @ALIB@ @TCL_LIB_SPEC@ @TK_LIB_SPEC@
++LIBSN = -lc -lX11 -ltk @TK_LIBS@ @ALIB@ @TCL_LIB_SPEC@ @TK_LIB_SPEC@
+
+ SHLIB_LD = @SHLIB_LD@
+ SHLIB_SUFFIX = @SHLIB_SUFFIX@
+@@ -158,11 +158,11 @@
+ $(CC) -c $(CFLAGS) $(GENERIC_DIR)/snackStubLib.c
+
+ libsound${SHLIB_SUFFIX}: ${OBJSO}
+- ${SHLIB_LD} ${OBJSO} ${LIBSO} -o libsound${SHLIB_SUFFIX}
++ ${SHLIB_LD} ${OBJSO} ${LIBSO} -install_name $(SNACK_INSTALL_PATH)/snack${VERSION}/libsound${SHLIB_SUFFIX} -o libsound${SHLIB_SUFFIX}
+ sed s/.dll/${SHLIB_SUFFIX}/ < $(UNIX_DIR)/pkgIndex.tcl.dll > pkgIndex.tcl
+
+ libsnack${SHLIB_SUFFIX}: ${OBJSN}
+- ${SHLIB_LD} ${OBJSN} ${LIBSN} -o libsnack${SHLIB_SUFFIX}
++ ${SHLIB_LD} ${OBJSN} ${LIBSN} -install_name $(SNACK_INSTALL_PATH)/snack${VERSION}/libsnack${SHLIB_SUFFIX} -o libsnack${SHLIB_SUFFIX}
+ sed s/.dll/${SHLIB_SUFFIX}/ < $(UNIX_DIR)/pkgIndex.tcl.dll > pkgIndex.tcl
+
+ stublib: ${OBJSNST}
diff --git a/dev-tcltk/snack/metadata.xml b/dev-tcltk/snack/metadata.xml
new file mode 100644
index 000000000000..227dda5ba584
--- /dev/null
+++ b/dev-tcltk/snack/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>tcltk@gentoo.org</email>
+ <name>Gentoo Tcltk Project</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-tcltk/snack/snack-2.2.10-r6.ebuild b/dev-tcltk/snack/snack-2.2.10-r6.ebuild
new file mode 100644
index 000000000000..d7af7b86d79e
--- /dev/null
+++ b/dev-tcltk/snack/snack-2.2.10-r6.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 pypy )
+
+inherit autotools autotools-utils distutils-r1 multilib
+
+DESCRIPTION="The Snack Sound Toolkit (Tcl)"
+HOMEPAGE="http://www.speech.kth.se/snack/"
+SRC_URI="http://www.speech.kth.se/snack/dist/${PN}${PV}.tar.gz"
+
+LICENSE="GPL-2"
+KEYWORDS="alpha amd64 hppa ppc ppc64 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
+SLOT="0"
+IUSE="alsa examples python threads vorbis"
+
+RESTRICT="test" # Bug 78354
+
+DEPEND="
+ dev-lang/tcl:0=
+ dev-lang/tk:0=
+ alsa? ( media-libs/alsa-lib )
+ python? ( ${PYTHON_DEPS} )
+ vorbis? ( media-libs/libvorbis )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${PN}${PV}/unix"
+
+#PYTHON_MODNAME="tkSnack.py"
+
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+PATCHES=(
+ "${FILESDIR}"/alsa-undef-sym.patch
+ "${FILESDIR}"/${P}-CVE-2012-6303-fix.patch
+ )
+
+src_prepare() {
+ # adds -install_name (soname on Darwin)
+ [[ ${CHOST} == *-darwin* ]] && PATCHES+=( "${FILESDIR}"/${P}-darwin.patch )
+
+ sed \
+ -e "s:ar cr:$(tc-getAR) cr:g" \
+ -e "s:-O:${CFLAGS}:g" \
+ -i Makefile.in || die
+
+ cd .. || die
+
+ autotools-utils_src_prepare
+
+ sed \
+ -e 's|^\(#define roundf(.*\)|//\1|' \
+ -i generic/jkFormatMP3.c || die
+}
+
+src_configure() {
+ local myeconfargs=(
+ --libdir="${EPREFIX}"/usr/$(get_libdir)
+ --includedir="${EPREFIX}"/usr/include
+ )
+
+ use alsa && myconf+=( --enable-alsa )
+ use threads && myconf+=( --enable-threads )
+
+ use vorbis && \
+ myconf+=( --with-ogg-include="${EPREFIX}"/usr/include ) && \
+ myconf+=( --with-ogg-lib="${EPREFIX}"/usr/$(get_libdir) )
+
+ autotools-utils_src_configure
+}
+
+src_compile() {
+ autotools-utils_src_compile
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ if use python ; then
+ cd "${S}"/../python || die
+ distutils-r1_src_install
+ fi
+
+ cd "${S}"/.. || die
+
+ dohtml doc/*
+
+ if use examples ; then
+ docinto examples
+ sed -i -e 's/wish[0-9.]+/wish/g' demos/tcl/* || die
+ dodoc -r demos/tcl
+
+ use python && dodoc -r demos/python
+ fi
+}