summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Koloska2015-07-07 23:35:34 +0200
committerUwe Koloska2015-07-07 23:35:34 +0200
commit12477a764b35716c7aba8270992b3b4ca284df6d (patch)
tree90bb475a24748f848c4cc109428401a9f5b94af3
downloadaur-snack.tar.gz
Initial import
-rw-r--r--.SRCINFO23
-rw-r--r--PKGBUILD44
-rw-r--r--alsa.patch49
-rw-r--r--configure.patch15
-rw-r--r--deprecated-functions.patch13
5 files changed, 144 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..d7210d53ffe
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,23 @@
+pkgbase = snack
+ pkgdesc = a sound toolkit for scripting languages (Tcl, Python, Ruby, ...)
+ pkgver = 2.2.10
+ pkgrel = 11
+ url = http://www.speech.kth.se/snack/
+ arch = i686
+ arch = x86_64
+ license = GPL
+ depends = tk
+ depends = alsa-lib
+ depends = libxft
+ depends = libxss
+ source = http://www.speech.kth.se/snack/dist/snack2.2.10.tar.gz
+ source = configure.patch
+ source = alsa.patch
+ source = deprecated-functions.patch
+ md5sums = 98da0dc73599b3a039cba1b7ff169399
+ md5sums = 330da66b5e9763933a8d8262af914a9a
+ md5sums = 5d92710f4515f70861fd45312c7372bb
+ md5sums = 3167282bd079291792337bd7f0ad8997
+
+pkgname = snack
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..06403372e03
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,44 @@
+# Maintainer: Uwe Koloska <kolewu [at] koloro [dot] de>
+# Contributor: William Díaz <wdiaz [at] archlinux [dot] us>
+
+pkgname=snack
+pkgver=2.2.10
+pkgrel=11
+pkgdesc="a sound toolkit for scripting languages (Tcl, Python, Ruby, ...)"
+url="http://www.speech.kth.se/snack/"
+arch=('i686' 'x86_64')
+license=('GPL')
+depends=('tk' 'alsa-lib' 'libxft' 'libxss')
+source=(http://www.speech.kth.se/snack/dist/${pkgname}${pkgver}.tar.gz
+ configure.patch
+ alsa.patch
+ deprecated-functions.patch)
+md5sums=('98da0dc73599b3a039cba1b7ff169399'
+ '330da66b5e9763933a8d8262af914a9a'
+ '5d92710f4515f70861fd45312c7372bb'
+ '3167282bd079291792337bd7f0ad8997')
+
+build() {
+ cd ${pkgname}${pkgver}
+
+ # bug from glib - error from /usr/include/bits/mathcalls.h:310
+ sed -i -e 's|^\(#define roundf(.*\)|//\1|' generic/jkFormatMP3.c
+
+ patch -p0 -i ../configure.patch
+ patch -p0 -i ../alsa.patch
+ patch -p0 -i ../deprecated-functions.patch
+
+ cd unix
+
+ ./configure --prefix=/usr \
+ --with-tcl=/usr/lib \
+ --with-tk=/usr/lib \
+ --enable-alsa
+ make
+}
+
+package() {
+ cd ${pkgname}${pkgver}/unix
+
+ make DESTDIR=${pkgdir} install
+}
diff --git a/alsa.patch b/alsa.patch
new file mode 100644
index 00000000000..30a2c4ee8f9
--- /dev/null
+++ b/alsa.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
diff --git a/configure.patch b/configure.patch
new file mode 100644
index 00000000000..9305db96773
--- /dev/null
+++ b/configure.patch
@@ -0,0 +1,15 @@
+--- configure.orig 2006-09-27 00:26:04.000000000 +0400
++++ unix/configure 2006-09-27 00:27:49.000000000 +0400
+@@ -1467,10 +1467,10 @@
+ exec_prefix=$prefix
+ fi
+
+-#SNACK_INSTALL_PATH=${exec_prefix}/lib
++SNACK_INSTALL_PATH=${exec_prefix}/lib
+ #SNACK_HINSTALL_PATH=${exec_prefix}/inc
+ #SNACK_LIB_SPEC="-L${exec_prefix}/lib -lsnack"
+-SNACK_INSTALL_PATH=${libdir}
++#SNACK_INSTALL_PATH=${libdir}
+ SNACK_HINSTALL_PATH=${includedir}
+ SNACK_LIB_SPEC="-L${libdir} -lsnack"
+
diff --git a/deprecated-functions.patch b/deprecated-functions.patch
new file mode 100644
index 00000000000..8c55e3eecf1
--- /dev/null
+++ b/deprecated-functions.patch
@@ -0,0 +1,13 @@
+--- generic/jkSound-orig.h 2014-03-16 02:02:05.079275634 +0100
++++ generic/jkSound.h 2014-03-16 02:03:02.567202228 +0100
+@@ -607,8 +607,8 @@
+ #define TCL_SEEK Tcl_Seek
+ #define TCL_TELL Tcl_Tell
+ #else
+-#define TCL_SEEK Tcl_SeekOld
+-#define TCL_TELL Tcl_TellOld
++#define TCL_SEEK (tclStubsPtr->tcl_SeekOld)
++#define TCL_TELL (tclStubsPtr->tcl_TellOld)
+ #endif
+
+ #define SNACK_DB 4.34294481903251830000000 /* = 10 / ln(10) */