gnu: Add kaldi-gstreamer-server.
[jackhill/guix/guix.git] / gnu / packages / machine-learning.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
5 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
6 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2018 Kei Kebreau <kkebreau@posteo.net>
8 ;;; Copyright © 2018 Mark Meyer <mark@ofosos.org>
9 ;;; Copyright © 2018 Ben Woodcroft <donttrustben@gmail.com>
10 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
11 ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
12 ;;; Copyright © 2018 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
13 ;;;
14 ;;; This file is part of GNU Guix.
15 ;;;
16 ;;; GNU Guix is free software; you can redistribute it and/or modify it
17 ;;; under the terms of the GNU General Public License as published by
18 ;;; the Free Software Foundation; either version 3 of the License, or (at
19 ;;; your option) any later version.
20 ;;;
21 ;;; GNU Guix is distributed in the hope that it will be useful, but
22 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 ;;; GNU General Public License for more details.
25 ;;;
26 ;;; You should have received a copy of the GNU General Public License
27 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28
29 (define-module (gnu packages machine-learning)
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module (guix packages)
32 #:use-module (guix utils)
33 #:use-module (guix download)
34 #:use-module (guix svn-download)
35 #:use-module (guix build-system cmake)
36 #:use-module (guix build-system gnu)
37 #:use-module (guix build-system ocaml)
38 #:use-module (guix build-system python)
39 #:use-module (guix build-system r)
40 #:use-module (guix git-download)
41 #:use-module (gnu packages)
42 #:use-module (gnu packages algebra)
43 #:use-module (gnu packages audio)
44 #:use-module (gnu packages autotools)
45 #:use-module (gnu packages base)
46 #:use-module (gnu packages bash)
47 #:use-module (gnu packages boost)
48 #:use-module (gnu packages check)
49 #:use-module (gnu packages compression)
50 #:use-module (gnu packages cran)
51 #:use-module (gnu packages dejagnu)
52 #:use-module (gnu packages gcc)
53 #:use-module (gnu packages glib)
54 #:use-module (gnu packages gstreamer)
55 #:use-module (gnu packages image)
56 #:use-module (gnu packages linux)
57 #:use-module (gnu packages maths)
58 #:use-module (gnu packages mpi)
59 #:use-module (gnu packages ocaml)
60 #:use-module (gnu packages onc-rpc)
61 #:use-module (gnu packages perl)
62 #:use-module (gnu packages pkg-config)
63 #:use-module (gnu packages python)
64 #:use-module (gnu packages python-web)
65 #:use-module (gnu packages python-xyz)
66 #:use-module (gnu packages statistics)
67 #:use-module (gnu packages swig)
68 #:use-module (gnu packages web)
69 #:use-module (gnu packages xml)
70 #:use-module (gnu packages xorg))
71
72 (define-public fann
73 ;; The last release is >100 commits behind, so we package from git.
74 (let ((commit "d71d54788bee56ba4cf7522801270152da5209d7"))
75 (package
76 (name "fann")
77 (version (string-append "2.2.0-1." (string-take commit 8)))
78 (source (origin
79 (method git-fetch)
80 (uri (git-reference
81 (url "https://github.com/libfann/fann.git")
82 (commit commit)))
83 (file-name (string-append name "-" version "-checkout"))
84 (sha256
85 (base32
86 "0ibwpfrjs6q2lijs8slxjgzb2llcl6rk3v2ski4r6215g5jjhg3x"))))
87 (build-system cmake-build-system)
88 (arguments
89 `(#:phases
90 (modify-phases %standard-phases
91 (replace 'check
92 (lambda* (#:key outputs #:allow-other-keys)
93 (let* ((out (assoc-ref outputs "out")))
94 (with-directory-excursion (string-append (getcwd) "/tests")
95 (invoke "./fann_tests"))))))))
96 (home-page "http://leenissen.dk/fann/wp/")
97 (synopsis "Fast Artificial Neural Network")
98 (description
99 "FANN is a free open source neural network library, which implements
100 multilayer artificial neural networks in C with support for both fully
101 connected and sparsely connected networks.")
102 (license license:lgpl2.1))))
103
104 (define-public libsvm
105 (package
106 (name "libsvm")
107 (version "3.22")
108 (source
109 (origin
110 (method url-fetch)
111 (uri (string-append "https://www.csie.ntu.edu.tw/~cjlin/libsvm/"
112 name "-" version ".tar.gz"))
113 (sha256
114 (base32
115 "0zd7s19y5vb7agczl6456bn45cj1y64739sslaskw1qk7dywd0bd"))))
116 (build-system gnu-build-system)
117 (arguments
118 `(#:tests? #f ;no "check" target
119 #:phases (modify-phases %standard-phases
120 (delete 'configure)
121 (replace
122 'install ; no ‘install’ target
123 (lambda* (#:key outputs #:allow-other-keys)
124 (let* ((out (assoc-ref outputs "out"))
125 (bin (string-append out "/bin/")))
126 (mkdir-p bin)
127 (for-each (lambda (file)
128 (copy-file file (string-append bin file)))
129 '("svm-train"
130 "svm-predict"
131 "svm-scale")))
132 #t)))))
133 (home-page "http://www.csie.ntu.edu.tw/~cjlin/libsvm/")
134 (synopsis "Library for Support Vector Machines")
135 (description
136 "LIBSVM is a machine learning library for support vector
137 classification, (C-SVC, nu-SVC), regression (epsilon-SVR, nu-SVR) and
138 distribution estimation (one-class SVM). It supports multi-class
139 classification.")
140 (license license:bsd-3)))
141
142 (define-public python-libsvm
143 (package (inherit libsvm)
144 (name "python-libsvm")
145 (build-system gnu-build-system)
146 (arguments
147 `(#:tests? #f ;no "check" target
148 #:make-flags '("-C" "python")
149 #:phases
150 (modify-phases %standard-phases
151 (delete 'configure)
152 (replace
153 'install ; no ‘install’ target
154 (lambda* (#:key inputs outputs #:allow-other-keys)
155 (let ((site (string-append (assoc-ref outputs "out")
156 "/lib/python"
157 (string-take
158 (string-take-right
159 (assoc-ref inputs "python") 5) 3)
160 "/site-packages/")))
161 (substitute* "python/svm.py"
162 (("../libsvm.so.2") "libsvm.so.2"))
163 (mkdir-p site)
164 (for-each (lambda (file)
165 (copy-file file (string-append site (basename file))))
166 (find-files "python" "\\.py"))
167 (copy-file "libsvm.so.2"
168 (string-append site "libsvm.so.2")))
169 #t)))))
170 (inputs
171 `(("python" ,python)))
172 (synopsis "Python bindings of libSVM")))
173
174 (define-public ghmm
175 ;; The latest release candidate is several years and a couple of fixes have
176 ;; been published since. This is why we download the sources from the SVN
177 ;; repository.
178 (let ((svn-revision 2341))
179 (package
180 (name "ghmm")
181 (version (string-append "0.9-rc3-0." (number->string svn-revision)))
182 (source (origin
183 (method svn-fetch)
184 (uri (svn-reference
185 (url "http://svn.code.sf.net/p/ghmm/code/trunk")
186 (revision svn-revision)))
187 (file-name (string-append name "-" version))
188 (sha256
189 (base32
190 "0qbq1rqp94l530f043qzp8aw5lj7dng9wq0miffd7spd1ff638wq"))))
191 (build-system gnu-build-system)
192 (arguments
193 `(#:imported-modules (,@%gnu-build-system-modules
194 (guix build python-build-system))
195 #:phases
196 (modify-phases %standard-phases
197 (add-after 'unpack 'enter-dir
198 (lambda _ (chdir "ghmm") #t))
199 (delete 'check)
200 (add-after 'install 'check
201 (assoc-ref %standard-phases 'check))
202 (add-before 'check 'fix-PYTHONPATH
203 (lambda* (#:key inputs outputs #:allow-other-keys)
204 (let ((python-version ((@@ (guix build python-build-system)
205 get-python-version)
206 (assoc-ref inputs "python"))))
207 (setenv "PYTHONPATH"
208 (string-append (getenv "PYTHONPATH")
209 ":" (assoc-ref outputs "out")
210 "/lib/python" python-version
211 "/site-packages")))
212 #t))
213 (add-after 'enter-dir 'fix-runpath
214 (lambda* (#:key outputs #:allow-other-keys)
215 (substitute* "ghmmwrapper/setup.py"
216 (("^(.*)extra_compile_args = \\[" line indent)
217 (string-append indent
218 "extra_link_args = [\"-Wl,-rpath="
219 (assoc-ref outputs "out") "/lib\"],\n"
220 line
221 "\"-Wl,-rpath="
222 (assoc-ref outputs "out")
223 "/lib\", ")))
224 #t))
225 (add-after 'enter-dir 'disable-broken-tests
226 (lambda _
227 (substitute* "tests/Makefile.am"
228 ;; GHMM_SILENT_TESTS is assumed to be a command.
229 (("TESTS_ENVIRONMENT.*") "")
230 ;; Do not build broken tests.
231 (("chmm .*") "")
232 (("read_fa .*") "")
233 (("mcmc .*") "")
234 (("label_higher_order_test.*$")
235 "label_higher_order_test\n"))
236
237 ;; These Python unittests are broken as there is no gato.
238 ;; See https://sourceforge.net/p/ghmm/support-requests/3/
239 (substitute* "ghmmwrapper/ghmmunittests.py"
240 (("^(.*)def (testNewXML|testMultipleTransitionClasses|testNewXML)"
241 line indent)
242 (string-append indent
243 "@unittest.skip(\"Disabled by Guix\")\n"
244 line)))
245 #t))
246 (add-after 'disable-broken-tests 'autogen
247 (lambda _
248 (invoke "bash" "autogen.sh"))))))
249 (inputs
250 `(("python" ,python-2) ; only Python 2 is supported
251 ("libxml2" ,libxml2)))
252 (native-inputs
253 `(("pkg-config" ,pkg-config)
254 ("dejagnu" ,dejagnu)
255 ("swig" ,swig)
256 ("autoconf" ,autoconf)
257 ("automake" ,automake)
258 ("libtool" ,libtool)))
259 (home-page "http://ghmm.org")
260 (synopsis "Hidden Markov Model library")
261 (description
262 "The General Hidden Markov Model library (GHMM) is a C library with
263 additional Python bindings implementing a wide range of types of @dfn{Hidden
264 Markov Models} (HMM) and algorithms: discrete, continuous emissions, basic
265 training, HMM clustering, HMM mixtures.")
266 (license license:lgpl2.0+))))
267
268 (define-public mcl
269 (package
270 (name "mcl")
271 (version "14.137")
272 (source (origin
273 (method url-fetch)
274 (uri (string-append
275 "http://micans.org/mcl/src/mcl-"
276 (string-replace-substring version "." "-")
277 ".tar.gz"))
278 (sha256
279 (base32
280 "15xlax3z31lsn62vlg94hkm75nm40q4679amnfg13jm8m2bnhy5m"))))
281 (build-system gnu-build-system)
282 (arguments
283 `(#:configure-flags (list "--enable-blast")))
284 (inputs
285 `(("perl" ,perl)))
286 (home-page "http://micans.org/mcl/")
287 (synopsis "Clustering algorithm for graphs")
288 (description
289 "The MCL algorithm is short for the @dfn{Markov Cluster Algorithm}, a
290 fast and scalable unsupervised cluster algorithm for graphs (also known as
291 networks) based on simulation of (stochastic) flow in graphs.")
292 ;; In the LICENCE file and web page it says "The software is licensed
293 ;; under the GNU General Public License, version 3.", but in several of
294 ;; the source code files it suggests GPL3 or later.
295 ;; http://listserver.ebi.ac.uk/pipermail/mcl-users/2016/000376.html
296 (license license:gpl3)))
297
298 (define-public ocaml-mcl
299 (package
300 (name "ocaml-mcl")
301 (version "12-068oasis4")
302 (source
303 (origin
304 (method url-fetch)
305 (uri (string-append
306 "https://github.com/fhcrc/mcl/archive/"
307 version ".tar.gz"))
308 (file-name (string-append name "-" version ".tar.gz"))
309 (sha256
310 (base32
311 "1l5jbhwjpsj38x8b9698hfpkv75h8hn3kj0gihjhn8ym2cwwv110"))))
312 (build-system ocaml-build-system)
313 (arguments
314 `(#:ocaml ,ocaml-4.02
315 #:findlib ,ocaml4.02-findlib
316 #:phases
317 (modify-phases %standard-phases
318 (add-before 'configure 'patch-paths
319 (lambda _
320 (substitute* "configure"
321 (("SHELL = /bin/sh") (string-append "SHELL = "(which "sh"))))
322 (substitute* "setup.ml"
323 (("LDFLAGS=-fPIC")
324 (string-append "LDFLAGS=-fPIC\"; \"SHELL=" (which "sh"))))
325 #t)))))
326 (home-page "https://github.com/fhcrc/mcl")
327 (synopsis "OCaml wrappers around MCL")
328 (description
329 "This package provides OCaml bindings for the MCL graph clustering
330 algorithm.")
331 (license license:gpl3)))
332
333 (define-public randomjungle
334 (package
335 (name "randomjungle")
336 (version "2.1.0")
337 (source
338 (origin
339 (method url-fetch)
340 (uri (string-append
341 "https://www.imbs.uni-luebeck.de/fileadmin/files/Software"
342 "/randomjungle/randomjungle-" version ".tar_.gz"))
343 (patches (search-patches "randomjungle-disable-static-build.patch"))
344 (sha256
345 (base32
346 "12c8rf30cla71swx2mf4ww9mfd8jbdw5lnxd7dxhyw1ygrvg6y4w"))))
347 (build-system gnu-build-system)
348 (arguments
349 `(#:configure-flags
350 (list "--disable-static"
351 (string-append "--with-boost="
352 (assoc-ref %build-inputs "boost")))
353 #:phases
354 (modify-phases %standard-phases
355 (add-before
356 'configure 'set-CXXFLAGS
357 (lambda _
358 (setenv "CXXFLAGS" "-fpermissive ")
359 #t)))))
360 (inputs
361 `(("boost" ,boost)
362 ("gsl" ,gsl)
363 ("libxml2" ,libxml2)
364 ("zlib" ,zlib)))
365 (native-inputs
366 `(("gfortran" ,gfortran)
367 ("gfortran:lib" ,gfortran "lib")))
368 ;; Non-portable assembly instructions are used so building fails on
369 ;; platforms other than x86_64 or i686.
370 (supported-systems '("x86_64-linux" "i686-linux"))
371 (home-page "https://www.imbs.uni-luebeck.de/forschung/software/details.html#c224")
372 (synopsis "Implementation of the Random Forests machine learning method")
373 (description
374 "Random Jungle is an implementation of Random Forests. It is supposed to
375 analyse high dimensional data. In genetics, it can be used for analysing big
376 Genome Wide Association (GWA) data. Random Forests is a powerful machine
377 learning method. Most interesting features are variable selection, missing
378 value imputation, classifier creation, generalization error estimation and
379 sample proximities between pairs of cases.")
380 (license license:gpl3+)))
381
382 (define-public openfst
383 (package
384 (name "openfst")
385 (version "1.7.1")
386 (source (origin
387 (method url-fetch)
388 (uri (string-append "http://www.openfst.org/twiki/pub/FST/"
389 "FstDownload/openfst-" version ".tar.gz"))
390 (sha256
391 (base32
392 "0x9wfcqd8hq4h349s7j77sr60h8xjdfshqw1m3a2n6z5bdr9qkm1"))))
393 (build-system gnu-build-system)
394 (home-page "http://www.openfst.org")
395 (synopsis "Library for weighted finite-state transducers")
396 (description "OpenFst is a library for constructing, combining,
397 optimizing, and searching weighted finite-state transducers (FSTs).")
398 (license license:asl2.0)))
399
400 (define-public shogun
401 (package
402 (name "shogun")
403 (version "6.1.3")
404 (source
405 (origin
406 (method url-fetch)
407 (uri (string-append
408 "ftp://shogun-toolbox.org/shogun/releases/"
409 (version-major+minor version)
410 "/sources/shogun-" version ".tar.bz2"))
411 (sha256
412 (base32
413 "1rn9skm3nw6hr7mr3lgp2gfqhi7ii0lyxck7qmqnf8avq349s5jp"))
414 (modules '((guix build utils)
415 (ice-9 rdelim)))
416 (snippet
417 '(begin
418 ;; Remove non-free sources and files referencing them
419 (for-each delete-file
420 (find-files "src/shogun/classifier/svm/"
421 "SVMLight\\.(cpp|h)"))
422 (for-each delete-file
423 (find-files "examples/undocumented/libshogun/"
424 (string-append
425 "(classifier_.*svmlight.*|"
426 "evaluation_cross_validation_locked_comparison).cpp")))
427 ;; Remove non-free functions.
428 (define (delete-ifdefs file)
429 (with-atomic-file-replacement file
430 (lambda (in out)
431 (let loop ((line (read-line in 'concat))
432 (skipping? #f))
433 (if (eof-object? line)
434 #t
435 (let ((skip-next?
436 (or (and skipping?
437 (not (string-prefix?
438 "#endif //USE_SVMLIGHT" line)))
439 (string-prefix?
440 "#ifdef USE_SVMLIGHT" line))))
441 (when (or (not skipping?)
442 (and skipping? (not skip-next?)))
443 (display line out))
444 (loop (read-line in 'concat) skip-next?)))))))
445 (for-each delete-ifdefs
446 (append
447 (find-files "src/shogun/classifier/mkl"
448 "^MKLClassification\\.cpp")
449 (find-files "src/shogun/classifier/svm"
450 "^SVMLightOneClass\\.(cpp|h)")
451 (find-files "src/shogun/multiclass"
452 "^ScatterSVM\\.(cpp|h)")
453 (find-files "src/shogun/kernel/"
454 "^(Kernel|CombinedKernel|ProductKernel)\\.(cpp|h)")
455 (find-files "src/shogun/regression/svr"
456 "^(MKLRegression|SVRLight)\\.(cpp|h)")
457 (find-files "src/shogun/transfer/domain_adaptation"
458 "^DomainAdaptationSVM\\.(cpp|h)")))
459 #t))))
460 (build-system cmake-build-system)
461 (arguments
462 '(#:tests? #f ;no check target
463 #:phases
464 (modify-phases %standard-phases
465 (add-after 'unpack 'delete-broken-symlinks
466 (lambda _
467 (for-each delete-file '("applications/arts/data"
468 "applications/asp/data"
469 "applications/easysvm/data"
470 "applications/msplicer/data"
471 "applications/ocr/data"
472 "examples/meta/data"
473 "examples/undocumented/data"))
474 #t))
475 (add-after 'unpack 'change-R-target-path
476 (lambda* (#:key outputs #:allow-other-keys)
477 (substitute* '("src/interfaces/r/CMakeLists.txt"
478 "examples/meta/r/CMakeLists.txt")
479 (("\\$\\{R_COMPONENT_LIB_PATH\\}")
480 (string-append (assoc-ref outputs "out")
481 "/lib/R/library/")))
482 #t))
483 (add-after 'unpack 'fix-octave-modules
484 (lambda* (#:key outputs #:allow-other-keys)
485 (substitute* "src/interfaces/octave/CMakeLists.txt"
486 (("^include_directories\\(\\$\\{OCTAVE_INCLUDE_DIRS\\}")
487 "include_directories(${OCTAVE_INCLUDE_DIRS} ${OCTAVE_INCLUDE_DIRS}/octave")
488 ;; change target directory
489 (("\\$\\{OCTAVE_OCT_LOCAL_API_FILE_DIR\\}")
490 (string-append (assoc-ref outputs "out")
491 "/share/octave/packages")))
492 (substitute* '("src/interfaces/octave/swig_typemaps.i"
493 "src/interfaces/octave/sg_print_functions.cpp")
494 ;; "octave/config.h" and "octave/oct-obj.h" deprecated in Octave.
495 (("octave/config\\.h") "octave/octave-config.h")
496 (("octave/oct-obj.h") "octave/ovl.h"))
497 #t))
498 (add-after 'unpack 'move-rxcpp
499 (lambda* (#:key inputs #:allow-other-keys)
500 (let ((rxcpp-dir "shogun/third-party/rxcpp"))
501 (mkdir-p rxcpp-dir)
502 (install-file (assoc-ref inputs "rxcpp") rxcpp-dir)
503 #t)))
504 (add-before 'build 'set-HOME
505 ;; $HOME needs to be set at some point during the build phase
506 (lambda _ (setenv "HOME" "/tmp") #t)))
507 #:configure-flags
508 (list "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
509 "-DUSE_SVMLIGHT=OFF" ;disable proprietary SVMLIGHT
510 "-DBUILD_META_EXAMPLES=OFF" ;requires unpackaged ctags
511 ;;"-DINTERFACE_JAVA=ON" ;requires unpackaged jblas
512 ;;"-DINTERFACE_RUBY=ON" ;requires unpackaged ruby-narray
513 ;;"-DINTERFACE_PERL=ON" ;"FindPerlLibs" does not exist
514 ;;"-DINTERFACE_LUA=ON" ;fails because lua doesn't build pkgconfig file
515 "-DINTERFACE_OCTAVE=ON"
516 "-DINTERFACE_PYTHON=ON"
517 "-DINTERFACE_R=ON")))
518 (inputs
519 `(("python" ,python)
520 ("numpy" ,python-numpy)
521 ("r-minimal" ,r-minimal)
522 ("octave" ,octave-cli)
523 ("swig" ,swig)
524 ("eigen" ,eigen)
525 ("hdf5" ,hdf5)
526 ("atlas" ,atlas)
527 ("arpack" ,arpack-ng)
528 ("lapack" ,lapack)
529 ("glpk" ,glpk)
530 ("libxml2" ,libxml2)
531 ("lzo" ,lzo)
532 ("zlib" ,zlib)))
533 (native-inputs
534 `(("pkg-config" ,pkg-config)
535 ("rxcpp" ,rxcpp)))
536 ;; Non-portable SSE instructions are used so building fails on platforms
537 ;; other than x86_64.
538 (supported-systems '("x86_64-linux"))
539 (home-page "http://shogun-toolbox.org/")
540 (synopsis "Machine learning toolbox")
541 (description
542 "The Shogun Machine learning toolbox provides a wide range of unified and
543 efficient Machine Learning (ML) methods. The toolbox seamlessly allows to
544 combine multiple data representations, algorithm classes, and general purpose
545 tools. This enables both rapid prototyping of data pipelines and extensibility
546 in terms of new algorithms.")
547 (license license:gpl3+)))
548
549 (define-public rxcpp
550 (package
551 (name "rxcpp")
552 (version "4.0.0")
553 (source
554 (origin
555 (method url-fetch)
556 (uri (string-append "https://github.com/ReactiveX/RxCpp/archive/v"
557 version ".tar.gz"))
558 (sha256
559 (base32
560 "0y2isr8dy2n1yjr9c5570kpc9lvdlch6jv0jvw000amwn5d3krsh"))
561 (file-name (string-append name "-" version ".tar.gz"))))
562 (build-system cmake-build-system)
563 (arguments
564 `(#:phases
565 (modify-phases %standard-phases
566 (add-after 'unpack 'remove-werror
567 (lambda _
568 (substitute* (find-files ".")
569 (("-Werror") ""))
570 #t))
571 (replace 'check
572 (lambda _
573 (invoke "ctest"))))))
574 (native-inputs
575 `(("catch" ,catch-framework)))
576 (home-page "http://reactivex.io/")
577 (synopsis "Reactive Extensions for C++")
578 (description
579 "The Reactive Extensions for C++ (RxCpp) is a library of algorithms for
580 values-distributed-in-time. ReactiveX is a library for composing asynchronous
581 and event-based programs by using observable sequences.
582
583 It extends the observer pattern to support sequences of data and/or events and
584 adds operators that allow you to compose sequences together declaratively while
585 abstracting away concerns about things like low-level threading,
586 synchronization, thread-safety, concurrent data structures, and non-blocking
587 I/O.")
588 (license license:asl2.0)))
589
590 (define-public r-adaptivesparsity
591 (package
592 (name "r-adaptivesparsity")
593 (version "1.6")
594 (source (origin
595 (method url-fetch)
596 (uri (cran-uri "AdaptiveSparsity" version))
597 (sha256
598 (base32
599 "0imr5m8mll9j6n4icsv6z9rl5kbnwsp9wvzrg7n90nnmcxq2cz91"))))
600 (properties
601 `((upstream-name . "AdaptiveSparsity")))
602 (build-system r-build-system)
603 (arguments
604 `(#:phases
605 (modify-phases %standard-phases
606 (add-after 'unpack 'link-against-armadillo
607 (lambda _
608 (substitute* "src/Makevars"
609 (("PKG_LIBS=" prefix)
610 (string-append prefix "-larmadillo"))))))))
611 (propagated-inputs
612 `(("r-mass" ,r-mass)
613 ("r-matrix" ,r-matrix)
614 ("r-rcpp" ,r-rcpp)
615 ("r-rcpparmadillo" ,r-rcpparmadillo)))
616 (inputs
617 `(("armadillo" ,armadillo)))
618 (home-page "https://cran.r-project.org/web/packages/AdaptiveSparsity")
619 (synopsis "Adaptive sparsity models")
620 (description
621 "This package implements the Figueiredo machine learning algorithm for
622 adaptive sparsity and the Wong algorithm for adaptively sparse gaussian
623 geometric models.")
624 (license license:lgpl3+)))
625
626 (define-public r-kernlab
627 (package
628 (name "r-kernlab")
629 (version "0.9-27")
630 (source
631 (origin
632 (method url-fetch)
633 (uri (cran-uri "kernlab" version))
634 (sha256
635 (base32
636 "1m0xqf6gyvwayz7w3c83y32ayvnlz0jicj8ijk808zq9sh7dbbgn"))))
637 (build-system r-build-system)
638 (home-page "https://cran.r-project.org/web/packages/kernlab")
639 (synopsis "Kernel-based machine learning tools")
640 (description
641 "This package provides kernel-based machine learning methods for
642 classification, regression, clustering, novelty detection, quantile regression
643 and dimensionality reduction. Among other methods @code{kernlab} includes
644 Support Vector Machines, Spectral Clustering, Kernel PCA, Gaussian Processes
645 and a QP solver.")
646 (license license:gpl2)))
647
648 (define-public dlib
649 (package
650 (name "dlib")
651 (version "19.7")
652 (source (origin
653 (method url-fetch)
654 (uri (string-append
655 "http://dlib.net/files/dlib-" version ".tar.bz2"))
656 (sha256
657 (base32
658 "1mljz02kwkrbggyncxv5fpnyjdybw2qihaacb3js8yfkw12vwpc2"))
659 (modules '((guix build utils)))
660 (snippet
661 '(begin
662 ;; Delete ~13MB of bundled dependencies.
663 (delete-file-recursively "dlib/external")
664 (delete-file-recursively "docs/dlib/external")
665 #t))))
666 (build-system cmake-build-system)
667 (arguments
668 `(#:phases
669 (modify-phases %standard-phases
670 (add-after 'unpack 'disable-asserts
671 (lambda _
672 ;; config.h recommends explicitly enabling or disabling asserts
673 ;; when building as a shared library. By default neither is set.
674 (substitute* "dlib/config.h"
675 (("^//#define DLIB_DISABLE_ASSERTS") "#define DLIB_DISABLE_ASSERTS"))
676 #t))
677 (add-after 'disable-asserts 'disable-failing-tests
678 (lambda _
679 ;; One test times out on MIPS, so we need to disable it.
680 ;; Others are flaky on some platforms.
681 (let* ((system ,(or (%current-target-system)
682 (%current-system)))
683 (disabled-tests (cond
684 ((string-prefix? "mips64" system)
685 '("object_detector" ; timeout
686 "data_io"))
687 ((string-prefix? "armhf" system)
688 '("learning_to_track"))
689 ((string-prefix? "i686" system)
690 '("optimization"))
691 (else '()))))
692 (for-each
693 (lambda (test)
694 (substitute* "dlib/test/makefile"
695 (((string-append "SRC \\+= " test "\\.cpp")) "")))
696 disabled-tests)
697 #t)))
698 (replace 'check
699 (lambda _
700 ;; No test target, so we build and run the unit tests here.
701 (let ((test-dir (string-append "../dlib-" ,version "/dlib/test")))
702 (with-directory-excursion test-dir
703 (invoke "make" "-j" (number->string (parallel-job-count)))
704 (invoke "./dtest" "--runall"))
705 #t)))
706 (add-after 'install 'delete-static-library
707 (lambda* (#:key outputs #:allow-other-keys)
708 (delete-file (string-append (assoc-ref outputs "out")
709 "/lib/libdlib.a"))
710 #t)))))
711 (native-inputs
712 `(("pkg-config" ,pkg-config)
713 ;; For tests.
714 ("libnsl" ,libnsl)))
715 (inputs
716 `(("giflib" ,giflib)
717 ("lapack" ,lapack)
718 ("libjpeg" ,libjpeg)
719 ("libpng" ,libpng)
720 ("libx11" ,libx11)
721 ("openblas" ,openblas)
722 ("zlib" ,zlib)))
723 (synopsis
724 "Toolkit for making machine learning and data analysis applications in C++")
725 (description
726 "Dlib is a modern C++ toolkit containing machine learning algorithms and
727 tools. It is used in both industry and academia in a wide range of domains
728 including robotics, embedded devices, mobile phones, and large high performance
729 computing environments.")
730 (home-page "http://dlib.net")
731 (license license:boost1.0)))
732
733 (define-public python-scikit-learn
734 (package
735 (name "python-scikit-learn")
736 (version "0.20.1")
737 (source
738 (origin
739 (method git-fetch)
740 (uri (git-reference
741 (url "https://github.com/scikit-learn/scikit-learn.git")
742 (commit version)))
743 (file-name (git-file-name name version))
744 (sha256
745 (base32
746 "0fkhwg3xn1s7ln9q1szq6kwc4jhwvjh8w4kmv9wcrqy7cq3lbv0d"))))
747 (build-system python-build-system)
748 (arguments
749 `(#:phases
750 (modify-phases %standard-phases
751 (add-after 'build 'build-ext
752 (lambda _ (invoke "python" "setup.py" "build_ext" "--inplace") #t))
753 (replace 'check
754 (lambda _
755 ;; Restrict OpenBLAS threads to prevent segfaults while testing!
756 (setenv "OPENBLAS_NUM_THREADS" "1")
757
758 ;; Some tests require write access to $HOME.
759 (setenv "HOME" "/tmp")
760
761 (invoke "pytest" "sklearn" "-m" "not network")))
762 ;; FIXME: This fails with permission denied
763 (delete 'reset-gzip-timestamps))))
764 (inputs
765 `(("openblas" ,openblas)))
766 (native-inputs
767 `(("python-pytest" ,python-pytest)
768 ("python-pandas" ,python-pandas) ;for tests
769 ("python-cython" ,python-cython)))
770 (propagated-inputs
771 `(("python-numpy" ,python-numpy)
772 ("python-scipy" ,python-scipy)))
773 (home-page "http://scikit-learn.org/")
774 (synopsis "Machine Learning in Python")
775 (description
776 "Scikit-learn provides simple and efficient tools for data mining and
777 data analysis.")
778 (license license:bsd-3)))
779
780 (define-public python2-scikit-learn
781 (package-with-python2 python-scikit-learn))
782
783 (define-public python-autograd
784 (let* ((commit "442205dfefe407beffb33550846434baa90c4de7")
785 (revision "0")
786 (version (git-version "0.0.0" revision commit)))
787 (package
788 (name "python-autograd")
789 (home-page "https://github.com/HIPS/autograd")
790 (source (origin
791 (method git-fetch)
792 (uri (git-reference
793 (url home-page)
794 (commit commit)))
795 (sha256
796 (base32
797 "189sv2xb0mwnjawa9z7mrgdglc1miaq93pnck26r28fi1jdwg0z4"))
798 (file-name (git-file-name name version))))
799 (version version)
800 (build-system python-build-system)
801 (native-inputs
802 `(("python-nose" ,python-nose)
803 ("python-pytest" ,python-pytest)))
804 (propagated-inputs
805 `(("python-future" ,python-future)
806 ("python-numpy" ,python-numpy)))
807 (arguments
808 `(#:phases (modify-phases %standard-phases
809 (replace 'check
810 (lambda _
811 (invoke "py.test" "-v"))))))
812 (synopsis "Efficiently computes derivatives of NumPy code")
813 (description "Autograd can automatically differentiate native Python and
814 NumPy code. It can handle a large subset of Python's features, including loops,
815 ifs, recursion and closures, and it can even take derivatives of derivatives
816 of derivatives. It supports reverse-mode differentiation
817 (a.k.a. backpropagation), which means it can efficiently take gradients of
818 scalar-valued functions with respect to array-valued arguments, as well as
819 forward-mode differentiation, and the two can be composed arbitrarily. The
820 main intended application of Autograd is gradient-based optimization.")
821 (license license:expat))))
822
823 (define-public python2-autograd
824 (package-with-python2 python-autograd))
825
826 (define-public lightgbm
827 (package
828 (name "lightgbm")
829 (version "2.0.12")
830 (source (origin
831 (method url-fetch)
832 (uri (string-append
833 "https://github.com/Microsoft/LightGBM/archive/v"
834 version ".tar.gz"))
835 (sha256
836 (base32
837 "132zf0yk0545mg72hyzxm102g3hpb6ixx9hnf8zd2k55gas6cjj1"))
838 (file-name (string-append name "-" version ".tar.gz"))))
839 (native-inputs
840 `(("python-pytest" ,python-pytest)
841 ("python-nose" ,python-nose)))
842 (inputs
843 `(("openmpi" ,openmpi)))
844 (propagated-inputs
845 `(("python-numpy" ,python-numpy)
846 ("python-scipy" ,python-scipy)))
847 (arguments
848 `(#:configure-flags
849 '("-DUSE_MPI=ON")
850 #:phases
851 (modify-phases %standard-phases
852 (replace 'check
853 (lambda* (#:key outputs #:allow-other-keys)
854 (with-directory-excursion ,(string-append "../LightGBM-" version)
855 (invoke "pytest" "tests/c_api_test/test_.py")))))))
856 (build-system cmake-build-system)
857 (home-page "https://github.com/Microsoft/LightGBM")
858 (synopsis "Gradient boosting framework based on decision tree algorithms")
859 (description "LightGBM is a gradient boosting framework that uses tree
860 based learning algorithms. It is designed to be distributed and efficient with
861 the following advantages:
862
863 @itemize
864 @item Faster training speed and higher efficiency
865 @item Lower memory usage
866 @item Better accuracy
867 @item Parallel and GPU learning supported (not enabled in this package)
868 @item Capable of handling large-scale data
869 @end itemize\n")
870 (license license:expat)))
871
872 (define-public vowpal-wabbit
873 ;; Language bindings not included.
874 (package
875 (name "vowpal-wabbit")
876 (version "8.5.0")
877 (source (origin
878 (method url-fetch)
879 (uri (string-append
880 "https://github.com/JohnLangford/vowpal_wabbit/archive/"
881 version ".tar.gz"))
882 (sha256
883 (base32
884 "0clp2kb7rk5sckhllxjr5a651awf4s8dgzg4659yh4hf5cqnf0gr"))
885 (file-name (string-append name "-" version ".tar.gz"))))
886 (inputs
887 `(("boost" ,boost)
888 ("zlib" ,zlib)))
889 (arguments
890 `(#:configure-flags
891 (list (string-append "--with-boost="
892 (assoc-ref %build-inputs "boost")))))
893 (build-system gnu-build-system)
894 (home-page "https://github.com/JohnLangford/vowpal_wabbit")
895 (synopsis "Fast machine learning library for online learning")
896 (description "Vowpal Wabbit is a machine learning system with techniques
897 such as online, hashing, allreduce, reductions, learning2search, active, and
898 interactive learning.")
899 (license license:bsd-3)))
900
901 (define-public python2-fastlmm
902 (package
903 (name "python2-fastlmm")
904 (version "0.2.21")
905 (source
906 (origin
907 (method url-fetch)
908 (uri (pypi-uri "fastlmm" version ".zip"))
909 (sha256
910 (base32
911 "1q8c34rpmwkfy3r4d5172pzdkpfryj561897z9r3x22gq7813x1m"))))
912 (build-system python-build-system)
913 (arguments
914 `(#:tests? #f ; some test files are missing
915 #:python ,python-2)) ; only Python 2.7 is supported
916 (propagated-inputs
917 `(("python2-numpy" ,python2-numpy)
918 ("python2-scipy" ,python2-scipy)
919 ("python2-matplotlib" ,python2-matplotlib)
920 ("python2-pandas" ,python2-pandas)
921 ("python2-scikit-learn" ,python2-scikit-learn)
922 ("python2-pysnptools" ,python2-pysnptools)))
923 (native-inputs
924 `(("unzip" ,unzip)
925 ("python2-cython" ,python2-cython)
926 ("python2-mock" ,python2-mock)
927 ("python2-nose" ,python2-nose)))
928 (home-page "http://research.microsoft.com/en-us/um/redmond/projects/mscompbio/fastlmm/")
929 (synopsis "Perform genome-wide association studies on large data sets")
930 (description
931 "FaST-LMM, which stands for Factored Spectrally Transformed Linear Mixed
932 Models, is a program for performing both single-SNP and SNP-set genome-wide
933 association studies (GWAS) on extremely large data sets.")
934 (license license:asl2.0)))
935
936 ;; There have been no proper releases yet.
937 (define-public kaldi
938 (let ((commit "2f95609f0bb085bd3a1dc5eb0a39f3edea59e606")
939 (revision "1"))
940 (package
941 (name "kaldi")
942 (version (git-version "0" revision commit))
943 (source (origin
944 (method git-fetch)
945 (uri (git-reference
946 (url "https://github.com/kaldi-asr/kaldi.git")
947 (commit commit)))
948 (file-name (git-file-name name version))
949 (sha256
950 (base32
951 "082qh3pfi7hvncylp4xsmkfahbd7gb0whdfa4rwrx7fxk9rdh3kz"))))
952 (build-system gnu-build-system)
953 (arguments
954 `(#:test-target "test"
955 #:phases
956 (modify-phases %standard-phases
957 (add-after 'unpack 'chdir
958 (lambda _ (chdir "src") #t))
959 (replace 'configure
960 (lambda* (#:key build system inputs outputs #:allow-other-keys)
961 (when (not (or (string-prefix? "x86_64" system)
962 (string-prefix? "i686" system)))
963 (substitute* "makefiles/linux_openblas.mk"
964 (("-msse -msse2") "")))
965 (substitute* "makefiles/default_rules.mk"
966 (("/bin/bash") (which "bash")))
967 (substitute* "Makefile"
968 (("ext_depend: check_portaudio")
969 "ext_depend:"))
970 (substitute* '("online/Makefile"
971 "onlinebin/Makefile"
972 "gst-plugin/Makefile")
973 (("../../tools/portaudio/install")
974 (assoc-ref inputs "portaudio")))
975
976 ;; This `configure' script doesn't support variables passed as
977 ;; arguments, nor does it support "prefix".
978 (let ((out (assoc-ref outputs "out"))
979 (openblas (assoc-ref inputs "openblas"))
980 (openfst (assoc-ref inputs "openfst")))
981 (substitute* "configure"
982 (("check_for_slow_expf;") "")
983 ;; This affects the RPATH and also serves as the installation
984 ;; directory.
985 (("KALDILIBDIR=`pwd`/lib")
986 (string-append "KALDILIBDIR=" out "/lib")))
987 (mkdir-p out) ; must exist
988 (setenv "CONFIG_SHELL" (which "bash"))
989 (setenv "OPENFST_VER" ,(package-version openfst))
990 (invoke "./configure"
991 "--use-cuda=no"
992 "--shared"
993 (string-append "--openblas-root=" openblas)
994 (string-append "--fst-root=" openfst)))))
995 (add-after 'build 'build-ext-and-gstreamer-plugin
996 (lambda _
997 (invoke "make" "-C" "online" "depend")
998 (invoke "make" "-C" "online")
999 (invoke "make" "-C" "onlinebin" "depend")
1000 (invoke "make" "-C" "onlinebin")
1001 (invoke "make" "-C" "gst-plugin" "depend")
1002 (invoke "make" "-C" "gst-plugin")
1003 #t))
1004 ;; TODO: also install the executables.
1005 (replace 'install
1006 (lambda* (#:key outputs #:allow-other-keys)
1007 (let* ((out (assoc-ref outputs "out"))
1008 (inc (string-append out "/include"))
1009 (lib (string-append out "/lib")))
1010 (mkdir-p lib)
1011 ;; The build phase installed symlinks to the actual
1012 ;; libraries. Install the actual targets.
1013 (for-each (lambda (file)
1014 (let ((target (readlink file)))
1015 (delete-file file)
1016 (install-file target lib)))
1017 (find-files lib "\\.so"))
1018 ;; Install headers
1019 (for-each (lambda (file)
1020 (let ((target-dir (string-append inc "/" (dirname file))))
1021 (install-file file target-dir)))
1022 (find-files "." "\\.h"))
1023 (install-file "gst-plugin/libgstonlinegmmdecodefaster.so"
1024 (string-append lib "/gstreamer-1.0"))
1025 #t))))))
1026 (inputs
1027 `(("alsa-lib" ,alsa-lib)
1028 ("gfortran" ,gfortran "lib")
1029 ("glib" ,glib)
1030 ("gstreamer" ,gstreamer)
1031 ("jack" ,jack-1)
1032 ("openblas" ,openblas)
1033 ("openfst" ,openfst)
1034 ("portaudio" ,portaudio)
1035 ("python" ,python)))
1036 (native-inputs
1037 `(("glib" ,glib "bin") ; glib-genmarshal
1038 ("grep" ,grep)
1039 ("sed" ,sed)
1040 ("pkg-config" ,pkg-config)
1041 ("which" ,which)))
1042 (home-page "https://kaldi-asr.org/")
1043 (synopsis "Speech recognition toolkit")
1044 (description "Kaldi is an extensible toolkit for speech recognition
1045 written in C++.")
1046 (license license:asl2.0))))
1047
1048 (define-public gst-kaldi-nnet2-online
1049 (let ((commit "617e43e73c7cc45eb9119028c02bd4178f738c4a")
1050 (revision "1"))
1051 (package
1052 (name "gst-kaldi-nnet2-online")
1053 (version (git-version "0" revision commit))
1054 (source (origin
1055 (method git-fetch)
1056 (uri (git-reference
1057 (url "https://github.com/alumae/gst-kaldi-nnet2-online.git")
1058 (commit commit)))
1059 (file-name (git-file-name name version))
1060 (sha256
1061 (base32
1062 "0xh3w67b69818s6ib02ara4lw7wamjdmh4jznvkpzrs4skbs9jx9"))))
1063 (build-system gnu-build-system)
1064 (arguments
1065 `(#:tests? #f ; there are none
1066 #:make-flags
1067 (list (string-append "SHELL="
1068 (assoc-ref %build-inputs "bash") "/bin/bash")
1069 (string-append "KALDI_ROOT="
1070 (assoc-ref %build-inputs "kaldi-src"))
1071 (string-append "KALDILIBDIR="
1072 (assoc-ref %build-inputs "kaldi") "/lib")
1073 "KALDI_FLAVOR=dynamic")
1074 #:phases
1075 (modify-phases %standard-phases
1076 (add-after 'unpack 'chdir
1077 (lambda _ (chdir "src") #t))
1078 (replace 'configure
1079 (lambda* (#:key inputs #:allow-other-keys)
1080 (let ((glib (assoc-ref inputs "glib")))
1081 (setenv "CXXFLAGS" "-std=c++11 -fPIC")
1082 (setenv "CPLUS_INCLUDE_PATH"
1083 (string-append glib "/include/glib-2.0:"
1084 glib "/lib/glib-2.0/include:"
1085 (assoc-ref inputs "gstreamer")
1086 "/include/gstreamer-1.0:"
1087 (getenv "CPLUS_INCLUDE_PATH"))))
1088 (substitute* "Makefile"
1089 (("include \\$\\(KALDI_ROOT\\)/src/kaldi.mk") "")
1090 (("\\$\\(error Cannot find") "#"))))
1091 (add-before 'build 'build-depend
1092 (lambda* (#:key make-flags #:allow-other-keys)
1093 (apply invoke "make" "depend" make-flags)))
1094 (replace 'install
1095 (lambda* (#:key outputs #:allow-other-keys)
1096 (let* ((out (assoc-ref outputs "out"))
1097 (lib (string-append out "/lib/gstreamer-1.0")))
1098 (install-file "libgstkaldinnet2onlinedecoder.so" lib)
1099 #t))))))
1100 (inputs
1101 `(("glib" ,glib)
1102 ("gstreamer" ,gstreamer)
1103 ("jansson" ,jansson)
1104 ("openfst" ,openfst)
1105 ("kaldi" ,kaldi)))
1106 (native-inputs
1107 `(("bash" ,bash)
1108 ("glib:bin" ,glib "bin") ; glib-genmarshal
1109 ("kaldi-src" ,(package-source kaldi))
1110 ("pkg-config" ,pkg-config)))
1111 (home-page "https://kaldi-asr.org/")
1112 (synopsis "Gstreamer plugin for decoding speech")
1113 (description "This package provides a GStreamer plugin that wraps
1114 Kaldi's @code{SingleUtteranceNnet2Decoder}. It requires iVector-adapted DNN
1115 acoustic models. The iVectors are adapted to the current audio stream
1116 automatically.")
1117 (license license:asl2.0))))
1118
1119 (define-public kaldi-gstreamer-server
1120 (let ((commit "1735ba49c5dc0ebfc184e45105fc600cd9f1f508")
1121 (revision "1"))
1122 (package
1123 (name "kaldi-gstreamer-server")
1124 (version (git-version "0" revision commit))
1125 (source (origin
1126 (method git-fetch)
1127 (uri (git-reference
1128 (url "https://github.com/alumae/kaldi-gstreamer-server.git")
1129 (commit commit)))
1130 (file-name (git-file-name name version))
1131 (sha256
1132 (base32
1133 "0j701m7lbwmzqxsfanj882v7881hrbmpqybbczbxqpcbg8q34w0k"))))
1134 (build-system gnu-build-system)
1135 (arguments
1136 `(#:tests? #f ; there are no tests that can be run automatically
1137 #:modules ((guix build utils)
1138 (guix build gnu-build-system)
1139 (srfi srfi-26))
1140 #:phases
1141 (modify-phases %standard-phases
1142 (delete 'configure)
1143 (replace 'build
1144 (lambda* (#:key outputs #:allow-other-keys)
1145 ;; Disable hash randomization to ensure the generated .pycs
1146 ;; are reproducible.
1147 (setenv "PYTHONHASHSEED" "0")
1148 (with-directory-excursion "kaldigstserver"
1149 (for-each (lambda (file)
1150 (apply invoke
1151 `("python"
1152 "-m" "compileall"
1153 "-f" ; force rebuild
1154 ,file)))
1155 (find-files "." "\\.py$")))
1156 #t))
1157 (replace 'install
1158 (lambda* (#:key inputs outputs #:allow-other-keys)
1159 (let* ((out (assoc-ref outputs "out"))
1160 (bin (string-append out "/bin"))
1161 (share (string-append out "/share/kaldi-gstreamer-server/")))
1162 ;; Install Python files
1163 (with-directory-excursion "kaldigstserver"
1164 (for-each (cut install-file <> share)
1165 (find-files "." ".*")))
1166
1167 ;; Install sample configuration files
1168 (for-each (cut install-file <> share)
1169 (find-files "." "\\.yaml"))
1170
1171 ;; Install executables
1172 (mkdir-p bin)
1173 (let* ((server (string-append bin "/kaldi-gst-server"))
1174 (client (string-append bin "/kaldi-gst-client"))
1175 (worker (string-append bin "/kaldi-gst-worker"))
1176 (PYTHONPATH (getenv "PYTHONPATH"))
1177 (GST_PLUGIN_PATH (string-append
1178 (assoc-ref inputs "gst-kaldi-nnet2-online")
1179 "/lib/gstreamer-1.0:${GST_PLUGIN_PATH}"))
1180 (wrap (lambda (wrapper what)
1181 (with-output-to-file wrapper
1182 (lambda _
1183 (format #t
1184 "#!~a
1185 export PYTHONPATH=~a
1186 export GST_PLUGIN_PATH=~a
1187 exec ~a ~a/~a \"$@\"~%"
1188 (which "bash") PYTHONPATH GST_PLUGIN_PATH
1189 (which "python") share what)))
1190 (chmod wrapper #o555))))
1191 (for-each wrap
1192 (list server client worker)
1193 (list "master_server.py"
1194 "client.py"
1195 "worker.py")))
1196 #t))))))
1197 (inputs
1198 `(("gst-kaldi-nnet2-online" ,gst-kaldi-nnet2-online)
1199 ("python2" ,python-2)
1200 ("python2-futures" ,python2-futures)
1201 ("python2-pygobject" ,python2-pygobject)
1202 ("python2-pyyaml" ,python2-pyyaml)
1203 ("python2-tornado" ,python2-tornado)
1204 ("python2-ws4py" ,python2-ws4py-for-kaldi-gstreamer-server)))
1205 (home-page "https://github.com/alumae/kaldi-gstreamer-server")
1206 (synopsis "Real-time full-duplex speech recognition server")
1207 (description "This is a real-time full-duplex speech recognition server,
1208 based on the Kaldi toolkit and the GStreamer framework and implemented in
1209 Python.")
1210 (license license:bsd-2))))