summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlain Kalker2015-08-19 23:01:19 +0200
committerAlain Kalker2015-08-19 23:01:19 +0200
commitd966700fb6967142271727e0ddce3c23c48d4eac (patch)
treef334ea7cc64e231899b3568074c021208f3894fe
parent352013147901944b5f0f66c6e901a7450a8e9d21 (diff)
downloadaur-d966700fb6967142271727e0ddce3c23c48d4eac.tar.gz
Update package
- Add new and missing dependencies - Add patch to support cmuclmtk - Small fixes
-rw-r--r--.SRCINFO15
-rw-r--r--PKGBUILD21
-rw-r--r--confdir.patch30
-rw-r--r--fix-paths.patch33
-rw-r--r--setup.py.in13
-rw-r--r--text2idngram.patch25
6 files changed, 83 insertions, 54 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 73d8266e6f82..9b9292c66ad6 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,8 @@
pkgbase = freespeech-vr
pkgdesc = Free streaming voice recognition with dynamic language learning
pkgver = 0.120
- pkgrel = 1
- url = https://code.google.com/p/freespeech-vr/
+ pkgrel = 2
+ url = https://thenerdshow.com/freespeech.html
arch = any
license = GPL3
depends = python2
@@ -11,14 +11,17 @@ pkgbase = freespeech-vr
depends = python2-simplejson
depends = gstreamer0.10-python
depends = pocketsphinx
- depends = cmu-sml-toolkit
+ depends = cmuclmtk
+ depends = python2-appdirs
options = !emptydirs
source = https://freespeech-vr.googlecode.com/files/freespeech-vr_r120.zip
source = setup.py.in
- source = fix-paths.patch
+ source = confdir.patch
+ source = text2idngram.patch
md5sums = 033aeddcaf3b21c693016f6017260480
- md5sums = 68061c33e5bff6d8b1aed4d433ce555c
- md5sums = 1a7a33b9a68c648f77fe66ee5e17bc25
+ md5sums = b9b63900c73b4c03d88c2946fd17668a
+ md5sums = 4dbd98a88871f69742d82bf72ce86fbe
+ md5sums = 4c56a2a3bc3b006e0ea36166045ce75c
pkgname = freespeech-vr
diff --git a/PKGBUILD b/PKGBUILD
index 0c11a9ae2a5a..7b6eecce1f9c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,26 +1,31 @@
# Maintainer: Alain Kalker <a {dot} c {dot} kalker "at" gmail {dot} com>
pkgname=freespeech-vr
pkgver=0.120
-pkgrel=1
+pkgrel=2
pkgdesc="Free streaming voice recognition with dynamic language learning"
arch=('any')
-url="https://code.google.com/p/freespeech-vr/"
+url="https://thenerdshow.com/freespeech.html"
license=('GPL3')
depends=('python2' 'pygtk' 'python2-xlib' 'python2-simplejson'
- 'gstreamer0.10-python' 'pocketsphinx' 'cmu-sml-toolkit')
+ 'gstreamer0.10-python' 'pocketsphinx' 'cmuclmtk'
+ 'python2-appdirs')
options=(!emptydirs)
source=("https://freespeech-vr.googlecode.com/files/${pkgname}_r${pkgver#0.}.zip"
'setup.py.in'
- 'fix-paths.patch')
+ 'confdir.patch'
+ 'text2idngram.patch')
md5sums=('033aeddcaf3b21c693016f6017260480'
- '68061c33e5bff6d8b1aed4d433ce555c'
- '1a7a33b9a68c648f77fe66ee5e17bc25')
+ 'b9b63900c73b4c03d88c2946fd17668a'
+ '4dbd98a88871f69742d82bf72ce86fbe'
+ '4c56a2a3bc3b006e0ea36166045ce75c')
prepare() {
cd "$srcdir/$pkgname"
- # Fix paths
- patch -p1 -i ../fix-paths.patch
+ # Fix location of configuration directory
+ patch -p1 -i ../confdir.patch
+ # Fix text2idngram invocation
+ patch -p1 -i ../text2idngram.patch
# Use python2
sed -i -e '1s/python$/python2/' *.py
diff --git a/confdir.patch b/confdir.patch
new file mode 100644
index 000000000000..20907f2f3cd9
--- /dev/null
+++ b/confdir.patch
@@ -0,0 +1,30 @@
+diff --git a/freespeech.py b/freespeech.py
+index a487bec..5ad57f7 100755
+--- a/freespeech.py
++++ b/freespeech.py
+@@ -28,22 +28,15 @@ gobject.threads_init()
+ import gst
+ import subprocess
+ import platform, os, shutil, sys, codecs
++import appdirs
+ import re
+ import json
+ from send_key import *
+
+ """ global variables """
+ appname = 'FreeSpeech'
+-refdir = 'lm'
+-
+-# hmmm, where to put files? How about XDG_CONFIG_HOME?
+-# This will work on most Linux
+-if os.environ.has_key('XDG_CONFIG_HOME'):
+- confhome = os.environ['XDG_CONFIG_HOME']
+- confdir = os.path.join(confhome, appname)
+-else:
+- # todo: determine suitable writable location for other os
+- confdir = refdir
++refdir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'lm')
++confdir = appdirs.user_config_dir(appname)
+
+ # reference files written by this application
+ lang_ref= os.path.join(confdir, 'freespeech.ref.txt')
diff --git a/fix-paths.patch b/fix-paths.patch
deleted file mode 100644
index 37b999b003fc..000000000000
--- a/fix-paths.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-diff -uprN freespeech-vr.orig/freespeech.py freespeech-vr/freespeech.py
---- freespeech-vr.orig/freespeech.py 2013-11-06 01:58:51.342161535 +0100
-+++ freespeech-vr/freespeech.py 2013-11-06 02:17:00.516072433 +0100
-@@ -34,16 +34,15 @@ from send_key import *
-
- """ global variables """
- appname = 'FreeSpeech'
--refdir = 'lm'
-+refdir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'lm')
-
- # hmmm, where to put files? How about XDG_CONFIG_HOME?
- # This will work on most Linux
--if os.environ.has_key('XDG_CONFIG_HOME'):
-+if os.environ.get('XDG_CONFIG_HOME'):
- confhome = os.environ['XDG_CONFIG_HOME']
-- confdir = os.path.join(confhome, appname)
- else:
-- # todo: determine suitable writable location for other os
-- confdir = refdir
-+ confhome = os.path.join(os.environ['HOME'], '.config')
-+confdir = os.path.join(confhome, appname)
-
- # reference files written by this application
- lang_ref= os.path.join(confdir, 'freespeech.ref.txt')
-@@ -294,7 +293,7 @@ If new commands don't work click the lea
- self.err('Trouble writing ' + vocab)
- # update the idngram\
- # http://www.speech.cs.cmu.edu/SLM/toolkit_documentation.html#text2idngram
-- if subprocess.call('text2idngram -vocab ' + vocab + \
-+ if subprocess.call('text2idngram -temp /tmp -vocab ' + vocab + \
- ' -n 3 < ' + lang_ref + ' > ' + idngram, shell=True):
- self.err('Trouble writing ' + idngram)
-
diff --git a/setup.py.in b/setup.py.in
index d2f5ec197fe6..a2e0d4d82027 100644
--- a/setup.py.in
+++ b/setup.py.in
@@ -1,9 +1,8 @@
from distutils.core import setup
setup(name='freespeech-vr',
- version='@PKGVER@',
- packages=['freespeech-vr'],
- package_dir={'freespeech-vr': ''},
- package_data={'freespeech-vr': ['FreeSpeech.png', 'custom.dic', 'lm/*']},
- data_files=[('share/pixmaps', ['FreeSpeech.png']),
- ('share/applications', ['FreeSpeech.desktop'])]
- )
+ version='@PKGVER@',
+ packages=['freespeech-vr'],
+ package_dir={'freespeech-vr': ''},
+ package_data={'freespeech-vr': ['FreeSpeech.png', 'custom.dic', 'lm/*']},
+ data_files=[('share/pixmaps', ['FreeSpeech.png']),
+ ('share/applications', ['FreeSpeech.desktop'])])
diff --git a/text2idngram.patch b/text2idngram.patch
new file mode 100644
index 000000000000..368177b2de2b
--- /dev/null
+++ b/text2idngram.patch
@@ -0,0 +1,25 @@
+diff --git a/freespeech.py b/freespeech.py
+index 5ad57f7..69ff99b 100755
+--- a/freespeech.py
++++ b/freespeech.py
+@@ -27,7 +27,7 @@ import gobject
+ gobject.threads_init()
+ import gst
+ import subprocess
+-import platform, os, shutil, sys, codecs
++import platform, os, shutil, sys, codecs, tempfile
+ import appdirs
+ import re
+ import json
+@@ -287,8 +287,9 @@ If new commands don't work click the learn button to train them.")
+ self.err('Trouble writing ' + vocab)
+ # update the idngram\
+ # http://www.speech.cs.cmu.edu/SLM/toolkit_documentation.html#text2idngram
+- if subprocess.call('text2idngram -vocab ' + vocab + \
+- ' -n 3 < ' + lang_ref + ' > ' + idngram, shell=True):
++ if subprocess.call('cd ' + tempfile.gettempdir() + '; ' + \
++ 'text2idngram -vocab ' + vocab + ' -idngram ' + idngram + \
++ ' -n 3 < ' + lang_ref, shell=True):
+ self.err('Trouble writing ' + idngram)
+
+ # (re)build arpa language model