summaryrefslogtreecommitdiff
path: root/development/snack
diff options
context:
space:
mode:
Diffstat (limited to 'development/snack')
-rw-r--r--development/snack/01-mathinc.patch11
-rw-r--r--development/snack/02-alsarelated.patch47
-rw-r--r--development/snack/README11
-rw-r--r--development/snack/slack-desc19
-rw-r--r--development/snack/snack.SlackBuild90
-rw-r--r--development/snack/snack.info10
6 files changed, 188 insertions, 0 deletions
diff --git a/development/snack/01-mathinc.patch b/development/snack/01-mathinc.patch
new file mode 100644
index 0000000000..7ec1e91f60
--- /dev/null
+++ b/development/snack/01-mathinc.patch
@@ -0,0 +1,11 @@
+diff -Nur snack2.2.10/generic/jkFormatMP3.c snack2.2.10.new/generic/jkFormatMP3.c
+--- snack2.2.10/generic/jkFormatMP3.c 2005-12-14 11:29:38.000000000 +0000
++++ snack2.2.10.new/generic/jkFormatMP3.c 2011-01-01 01:24:04.723341697 +0000
+@@ -29,6 +29,7 @@
+ #include "snack.h"
+ #include "jkFormatMP3.h"
+ #include <string.h>
++#include <math.h>
+ #define FRAS2(is,a) ((is) > 0 ? t_43[(is)]*(a):-t_43[-(is)]*(a))
+ #define MAXFRAMESIZE 2106 /* frame size starting at header */
+ #define roundf(x) (floor((x)+(float )0.5f))
diff --git a/development/snack/02-alsarelated.patch b/development/snack/02-alsarelated.patch
new file mode 100644
index 0000000000..4bc5416a9e
--- /dev/null
+++ b/development/snack/02-alsarelated.patch
@@ -0,0 +1,47 @@
+--- 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);
+ }
diff --git a/development/snack/README b/development/snack/README
new file mode 100644
index 0000000000..2f4425e0f7
--- /dev/null
+++ b/development/snack/README
@@ -0,0 +1,11 @@
+The Snack sound extension adds commands to play and record audio.
+Snack supports in-memory sound objects, file based audio, and
+streaming audio, with background audio processing. It handles
+fileformats such as AIFF, AU, MP3, NIST/Sphere, and WAV.
+Snack is extensible; new commands and sound file formats can
+be added using the Snack C-library. Snack also does sound visualization,
+e.g. waveforms and spectrograms. The visualization canvas item types update
+in real time and can output postscript. Works with Tcl 8.0.3 and later,
+as well as is stubs enabled. Works with the Tcl plug-in.
+
+Platforms: HP-UX, Irix, Linux, Solaris, Windows 95/98/NT/2000/XP.
diff --git a/development/snack/slack-desc b/development/snack/slack-desc
new file mode 100644
index 0000000000..173f1a03b4
--- /dev/null
+++ b/development/snack/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+snack: snack (sound extensions for TCL)
+snack:
+snack: The Snack sound extension adds commands to play and record audio.
+snack: Snack supports in-memory sound objects, file based audio, and
+snack: streaming audio, with background audio processing. It handles file
+snack: formats such as AIFF, AU, MP3, NIST/Sphere, and WAV.
+snack:
+snack: http://www.speech.kth.se/snack/
+snack:
+snack:
+snack:
diff --git a/development/snack/snack.SlackBuild b/development/snack/snack.SlackBuild
new file mode 100644
index 0000000000..21067d59b6
--- /dev/null
+++ b/development/snack/snack.SlackBuild
@@ -0,0 +1,90 @@
+#!/bin/sh
+
+# Slackware build script for Snack
+
+# Written by Zbigniew Baniewski, zb@ispid.com.pl
+
+PRGNAM=snack
+VERSION=2.2.10
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM$VERSION
+tar xvf $CWD/${PRGNAM}${VERSION}.tar.gz
+cd $PRGNAM$VERSION
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+cat $CWD/01-mathinc.patch | patch -p1 || exit
+cat $CWD/02-alsarelated.patch | patch -p0 || exit
+
+cd unix
+
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --with-tcl=/usr/lib${LIBDIRSUFFIX} \
+ --with-tk=/usr/lib${LIBDIRSUFFIX} \
+ --with-ogg-include=/usr/include \
+ --with-ogg-lib=/usr/lib${LIBDIRSUFFIX} \
+ --build=$ARCH-slackware-linux
+
+make
+make install DESTDIR=$PKG
+
+cd ..
+
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a BSD.txt COPYING README changes demos doc ext tests \
+ $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/development/snack/snack.info b/development/snack/snack.info
new file mode 100644
index 0000000000..6413bbf566
--- /dev/null
+++ b/development/snack/snack.info
@@ -0,0 +1,10 @@
+PRGNAM="snack"
+VERSION="2.2.10"
+HOMEPAGE="http://www.speech.kth.se/snack/"
+DOWNLOAD="http://www.speech.kth.se/snack/dist/snack2.2.10.tar.gz"
+MD5SUM="98da0dc73599b3a039cba1b7ff169399"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+MAINTAINER="Zbigniew Baniewski"
+EMAIL="zb@ispid.com.pl"
+APPROVED="Niels Horn"