| 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2016 David Thompson <davet@gnu.org> |
| 3 | ;;; Copyright © 2016, 2019, 2020 Marius Bakke <mbakke@fastmail.com> |
| 4 | ;;; Copyright © 2017 Leo Famulari <leo@famulari.name> |
| 5 | ;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr> |
| 6 | ;;; Copyright © 2016 Kei Kebreau <kkebreau@posteo.net> |
| 7 | ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net> |
| 8 | ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr> |
| 9 | ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il> |
| 10 | ;;; |
| 11 | ;;; This file is part of GNU Guix. |
| 12 | ;;; |
| 13 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
| 14 | ;;; under the terms of the GNU General Public License as published by |
| 15 | ;;; the Free Software Foundation; either version 3 of the License, or (at |
| 16 | ;;; your option) any later version. |
| 17 | ;;; |
| 18 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
| 19 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 21 | ;;; GNU General Public License for more details. |
| 22 | ;;; |
| 23 | ;;; You should have received a copy of the GNU General Public License |
| 24 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
| 25 | |
| 26 | (define-module (gnu packages speech) |
| 27 | #:use-module ((guix licenses) #:prefix license:) |
| 28 | #:use-module (guix packages) |
| 29 | #:use-module (guix download) |
| 30 | #:use-module (guix git-download) |
| 31 | #:use-module (guix utils) |
| 32 | #:use-module (guix build-system gnu) |
| 33 | #:use-module (gnu packages) |
| 34 | #:use-module (gnu packages audio) |
| 35 | #:use-module (gnu packages autotools) |
| 36 | #:use-module (gnu packages base) ;for 'which' |
| 37 | #:use-module (gnu packages bison) |
| 38 | #:use-module (gnu packages compression) |
| 39 | #:use-module (gnu packages documentation) |
| 40 | #:use-module (gnu packages emacs) |
| 41 | #:use-module (gnu packages gcc) |
| 42 | #:use-module (gnu packages glib) |
| 43 | #:use-module (gnu packages gstreamer) |
| 44 | #:use-module (gnu packages linux) |
| 45 | #:use-module (gnu packages ncurses) |
| 46 | #:use-module (gnu packages perl) |
| 47 | #:use-module (gnu packages pkg-config) |
| 48 | #:use-module (gnu packages pulseaudio) |
| 49 | #:use-module (gnu packages python) |
| 50 | #:use-module (gnu packages swig) |
| 51 | #:use-module (gnu packages texinfo) |
| 52 | #:use-module (gnu packages textutils)) |
| 53 | |
| 54 | (define-public flite |
| 55 | (package |
| 56 | (name "flite") |
| 57 | (version "2.1") |
| 58 | (source |
| 59 | (origin |
| 60 | (method url-fetch) |
| 61 | (uri |
| 62 | (string-append "http://www.festvox.org/" name "/packed/" name |
| 63 | "-" version "/" name "-" version "-release.tar.bz2")) |
| 64 | (sha256 |
| 65 | (base32 "119b7l7pjb1l5raqq24p8rmhdqni49vjh2mgdryrfr575rm3yg67")))) |
| 66 | (build-system gnu-build-system) |
| 67 | (arguments |
| 68 | ;; XXX: |
| 69 | ;; There numerous issues with the testsuite. |
| 70 | ;; Enable all of them once they are fixed in upstream. |
| 71 | `(#:tests? #f |
| 72 | #:configure-flags |
| 73 | (list |
| 74 | "--enable-shared" |
| 75 | (string-append "LDFLAGS=-Wl,-rpath=" |
| 76 | (assoc-ref %outputs "out") |
| 77 | "/lib")) |
| 78 | #:phases |
| 79 | (modify-phases %standard-phases |
| 80 | (add-after 'unpack 'patch-rpath |
| 81 | (lambda _ |
| 82 | (substitute* "main/Makefile" |
| 83 | (("flite_LIBS_flags \\+= -Wl,-rpath [^ ]*") |
| 84 | "flite_LIBS_flags +=")) |
| 85 | #t)) |
| 86 | (delete 'check) |
| 87 | ;; Modifying testsuite/Makefile is not done in favor of |
| 88 | ;; overriding 'check. |
| 89 | ;; The path not taken would be: |
| 90 | ;; test:\n\t$(foreach x,$(subst tris1,,$(subst dcoffset_wave,,$(subst flite_test,,$(subst by_word,,$(subst bin2ascii,,$(subst lpc_resynth,,$(subst rfc,,$(subst compare_wave,,$(subst record_in_noise,,$(subst combine_waves,,$(patsubst play_%,,$(subst record_wave,,$(subst lex_lookup,,$(patsubst lpc_test%,,$(patsubst asciiS2U%,,$(patsubst asciiU2S%,,$(ALL))))))))))))))))),echo TEST $x && ./$x data.one && ) true |
| 91 | (add-after 'install 'check |
| 92 | (lambda _ |
| 93 | (invoke "make" "-C" "testsuite") |
| 94 | (with-directory-excursion "testsuite" |
| 95 | (invoke "./token_test") |
| 96 | (invoke "./hrg_test") |
| 97 | (invoke "./regex_test") |
| 98 | (invoke "./nums_test") |
| 99 | (invoke "./lex_test") |
| 100 | (invoke "./utt_test") |
| 101 | (invoke "./multi_thread")) |
| 102 | #t)) |
| 103 | (add-after 'install 'remove-static-libs |
| 104 | (lambda* (#:key outputs #:allow-other-keys) |
| 105 | (let* ((out (assoc-ref outputs "out"))) |
| 106 | (for-each delete-file |
| 107 | (find-files out "\\.a$")) |
| 108 | #t)))))) |
| 109 | (native-inputs |
| 110 | `(("perl" ,perl))) |
| 111 | (inputs |
| 112 | `(("alsa" ,alsa-lib))) |
| 113 | (synopsis "Speech synthesis system") |
| 114 | (description "Flite (festival-lite) is a small, fast run-time text to speech |
| 115 | synthesis engine developed at CMU and primarily designed for small embedded |
| 116 | machines and/or large servers. It is designed as an alternative text to speech |
| 117 | synthesis engine to Festival for voices built using the FestVox suite of voice |
| 118 | building tools.") |
| 119 | (home-page "http://www.festvox.org/flite/index.html") |
| 120 | (license (license:non-copyleft "file:///COPYING")))) |
| 121 | |
| 122 | (define-public espeak |
| 123 | (package |
| 124 | (name "espeak") |
| 125 | (version "1.48.04") |
| 126 | (source (origin |
| 127 | (method url-fetch) |
| 128 | (uri (string-append "mirror://sourceforge/espeak/espeak/" |
| 129 | "espeak-" (version-major+minor version) |
| 130 | "/espeak-" version "-source.zip")) |
| 131 | (sha256 |
| 132 | (base32 |
| 133 | "0n86gwh9pw0jqqpdz7mxggllfr8k0r7pc67ayy7w5z6z79kig6mz")) |
| 134 | (modules '((guix build utils))) |
| 135 | (snippet |
| 136 | ;; remove prebuilt binaries |
| 137 | '(begin |
| 138 | (delete-file-recursively "linux_32bit") |
| 139 | #t)))) |
| 140 | (build-system gnu-build-system) |
| 141 | (arguments |
| 142 | `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")) |
| 143 | (string-append "DATADIR=" |
| 144 | (assoc-ref %outputs "out") |
| 145 | "/share/espeak-data") |
| 146 | (string-append "LDFLAGS=-Wl,-rpath=" |
| 147 | (assoc-ref %outputs "out") |
| 148 | "/lib") |
| 149 | ;; The package fails to build with newer C++ standards. |
| 150 | "CXXFLAGS=-std=c++98" |
| 151 | "AUDIO=pulseaudio") |
| 152 | #:tests? #f ; no check target |
| 153 | #:phases |
| 154 | (modify-phases %standard-phases |
| 155 | (replace 'configure |
| 156 | (lambda _ |
| 157 | (chdir "src") |
| 158 | ;; We use version 19 of the PortAudio library, so we must copy the |
| 159 | ;; corresponding file to be sure that espeak compiles correctly. |
| 160 | (copy-file "portaudio19.h" "portaudio.h") |
| 161 | (substitute* "Makefile" |
| 162 | (("/bin/ln") "ln")) |
| 163 | #t))))) |
| 164 | (inputs |
| 165 | `(("portaudio" ,portaudio) |
| 166 | ("pulseaudio" ,pulseaudio))) |
| 167 | (native-inputs `(("unzip" ,unzip))) |
| 168 | (home-page "http://espeak.sourceforge.net/") |
| 169 | (synopsis "Software speech synthesizer") |
| 170 | (description "eSpeak is a software speech synthesizer for English and |
| 171 | other languages. eSpeak uses a \"formant synthesis\" method. This allows many |
| 172 | languages to be provided in a small size. The speech is clear, and can be used |
| 173 | at high speeds, but is not as natural or smooth as larger synthesizers which are |
| 174 | based on human speech recordings.") |
| 175 | (license license:gpl3+))) |
| 176 | |
| 177 | (define-public espeak-ng |
| 178 | (package |
| 179 | (name "espeak-ng") |
| 180 | (version "1.50") |
| 181 | (home-page "https://github.com/espeak-ng/espeak-ng") |
| 182 | ;; Note: eSpeak NG publishes release tarballs, but the 1.50 tarball is |
| 183 | ;; broken: <https://github.com/espeak-ng/espeak-ng/issues/683>. |
| 184 | ;; Download the raw repository to work around it; remove 'native-inputs' |
| 185 | ;; below when switching back to the release tarball. |
| 186 | (source (origin |
| 187 | (method git-fetch) |
| 188 | (uri (git-reference (url home-page) (commit version))) |
| 189 | (file-name (git-file-name name version)) |
| 190 | (sha256 |
| 191 | (base32 "0jkqhf2h94vbqq7mg7mmm23bq372fa7mdk941my18c3vkldcir1b")))) |
| 192 | (build-system gnu-build-system) |
| 193 | (arguments |
| 194 | `(#:configure-flags '("--disable-static") |
| 195 | ;; Building in parallel triggers a race condition in 1.49.2. |
| 196 | #:parallel-build? #f |
| 197 | ;; XXX: Some tests require an audio device. |
| 198 | #:tests? #f)) |
| 199 | (native-inputs |
| 200 | `(("autoconf" ,autoconf) |
| 201 | ("automake" ,automake) |
| 202 | ("libtool" ,libtool) |
| 203 | ("which" ,which))) |
| 204 | (inputs |
| 205 | `(("libcap" ,libcap) |
| 206 | ("pcaudiolib" ,pcaudiolib))) |
| 207 | (synopsis "Software speech synthesizer") |
| 208 | (description |
| 209 | "eSpeak NG is a software speech synthesizer for more than 100 languages. |
| 210 | It is based on the eSpeak engine and supports spectral and Klatt formant |
| 211 | synthesis, and the ability to use MBROLA voices.") |
| 212 | (license license:gpl3+))) |
| 213 | |
| 214 | (define-public mitlm |
| 215 | (package |
| 216 | (name "mitlm") |
| 217 | (version "0.4.2") |
| 218 | (source (origin |
| 219 | (method url-fetch) |
| 220 | (uri (string-append "https://github.com/mitlm/mitlm/releases/" |
| 221 | "download/v" version "/" |
| 222 | name "-" version ".tar.xz")) |
| 223 | (sha256 |
| 224 | (base32 |
| 225 | "09fv4fcpmw9g1j0zml0k5kk1lgjw2spr8gn51llbkaaph6v8d62a")))) |
| 226 | (build-system gnu-build-system) |
| 227 | (native-inputs |
| 228 | `(("gfortran" ,gfortran))) |
| 229 | (synopsis "The MIT Language Modeling toolkit") |
| 230 | (description "The MIT Language Modeling (MITLM) toolkit is a set of |
| 231 | tools designed for the efficient estimation of statistical n-gram language |
| 232 | models involving iterative parameter estimation. It achieves much of its |
| 233 | efficiency through the use of a compact vector representation of n-grams.") |
| 234 | (home-page "https://github.com/mitlm/mitlm") |
| 235 | (license license:expat))) |
| 236 | |
| 237 | (define-public speech-dispatcher |
| 238 | (package |
| 239 | (name "speech-dispatcher") |
| 240 | (version "0.9.1") |
| 241 | (source (origin |
| 242 | (method url-fetch) |
| 243 | (uri (string-append "https://github.com/brailcom/speechd/releases" |
| 244 | "/download/" version "/speech-dispatcher-" |
| 245 | version ".tar.gz")) |
| 246 | (sha256 |
| 247 | (base32 |
| 248 | "16bg52hnkrsrs7kgbzanb34b9zb6fqxwj0a9bmsxmj1skkil1h1p")))) |
| 249 | (build-system gnu-build-system) |
| 250 | (arguments |
| 251 | `(#:configure-flags '("--disable-static" |
| 252 | |
| 253 | ;; Disable support for proprietary TTS engines. |
| 254 | "--with-ibmtts=no" |
| 255 | "--with-kali=no" "--with-baratinoo=no"))) |
| 256 | (native-inputs |
| 257 | `(("intltool" ,intltool) |
| 258 | ("pkg-config" ,pkg-config))) |
| 259 | (inputs |
| 260 | `(("dotconf" ,dotconf) |
| 261 | ("espeak" ,espeak-ng) |
| 262 | ("glib" ,glib) |
| 263 | ("libltdl" ,libltdl) |
| 264 | ("libsndfile" ,libsndfile) |
| 265 | ("pulseaudio" ,pulseaudio) |
| 266 | ("python" ,python))) |
| 267 | (synopsis "Common interface to speech synthesizers") |
| 268 | (description "The Speech Dispatcher project provides a high-level |
| 269 | device independent layer for access to speech synthesis through a simple, |
| 270 | stable and well documented interface.") |
| 271 | (home-page "https://devel.freebsoft.org/speechd") |
| 272 | ;; The software is distributed under GPL2+, but includes a number |
| 273 | ;; of files covered by other licenses. Note: in practice, this |
| 274 | ;; is linked against dotconf, which is LGPL 2.1 only. |
| 275 | (license (list license:gpl2+ |
| 276 | license:fdl1.2+ ; Most files in doc/ are dual gpl2+/fdl1.2+. |
| 277 | license:lgpl2.1+ |
| 278 | (license:non-copyleft |
| 279 | ;; festival_client.{c,h} carries an expat-style license. |
| 280 | "See src/modules/festival_client.c in the distribution.") |
| 281 | license:gpl3+)))) ; doc/texinfo.tex -- with TeX exception. |
| 282 | |
| 283 | (define-public sonic |
| 284 | (package |
| 285 | (name "sonic") |
| 286 | (version "0.2.0") |
| 287 | (source (origin |
| 288 | (method git-fetch) |
| 289 | (uri (git-reference |
| 290 | (url "https://github.com/waywardgeek/sonic") |
| 291 | (commit (string-append "release-" version)))) |
| 292 | (file-name (git-file-name name version)) |
| 293 | (sha256 |
| 294 | (base32 |
| 295 | "08xwnpw9cnaix1n1i7gvpq5hrfrqc2z1snjhjapfam506hrc77g4")))) |
| 296 | (build-system gnu-build-system) |
| 297 | (arguments |
| 298 | `(#:tests? #f ; no test suite |
| 299 | #:make-flags |
| 300 | (list (string-append "PREFIX=" (assoc-ref %outputs "out")) |
| 301 | (string-append "LDFLAGS=-Wl,-rpath=" |
| 302 | (assoc-ref %outputs "out") "/lib")) |
| 303 | #:phases |
| 304 | (modify-phases %standard-phases |
| 305 | (add-after 'unpack 'respect-LDFLAGS |
| 306 | (lambda _ |
| 307 | (substitute* "Makefile" |
| 308 | ((" -o sonic " match) |
| 309 | (string-append " $(LDFLAGS)" match))) |
| 310 | #t)) |
| 311 | (delete 'configure)))) ; no ./configure script |
| 312 | (synopsis "Speed up or slow down speech") |
| 313 | (description "Sonic implements a simple algorithm for speeding up or slowing |
| 314 | down speech. However, it's optimized for speed ups of over 2X, unlike previous |
| 315 | algorithms for changing speech rate. Sonic is a C library designed to be easily |
| 316 | integrated into streaming voice applications such as text-to-speech (TTS) back |
| 317 | ends. |
| 318 | |
| 319 | The primary motivation behind Sonic is to enable the blind and visually impaired |
| 320 | to improve their productivity with speech engines, like eSpeak. Sonic can also |
| 321 | be used by the sighted.") |
| 322 | (home-page "https://github.com/waywardgeek/sonic") |
| 323 | (license license:asl2.0))) |
| 324 | |
| 325 | (define-public festival |
| 326 | (package |
| 327 | (name "festival") |
| 328 | (version "2.5.0") |
| 329 | (source (origin |
| 330 | (method url-fetch) |
| 331 | (uri (string-append "http://festvox.org/packed/festival/" |
| 332 | (version-major+minor version) |
| 333 | "/festival-" version "-release.tar.gz")) |
| 334 | (sha256 |
| 335 | (base32 |
| 336 | "1d5415nckiv19adxisxfm1l1xxfyw88g87ckkmcr0lhjdd10g42c")))) |
| 337 | (build-system gnu-build-system) |
| 338 | (arguments |
| 339 | `(#:tests? #f ; there is no test target |
| 340 | #:make-flags |
| 341 | (list (string-append "RM=" |
| 342 | (assoc-ref %build-inputs "coreutils") |
| 343 | "/bin/rm") |
| 344 | (string-append "ECHO_N=" |
| 345 | (assoc-ref %build-inputs "coreutils") |
| 346 | "/bin/printf \"%s\"")) |
| 347 | #:parallel-build? #f ; not supported |
| 348 | #:modules ((guix build gnu-build-system) |
| 349 | (guix build utils) |
| 350 | (guix build emacs-utils)) |
| 351 | #:imported-modules (,@%gnu-build-system-modules |
| 352 | (guix build emacs-utils)) |
| 353 | #:phases |
| 354 | (modify-phases %standard-phases |
| 355 | (add-after 'unpack 'unpack-and-patch-speech-tools |
| 356 | (lambda* (#:key inputs #:allow-other-keys) |
| 357 | (invoke "tar" "-C" ".." |
| 358 | "-xf" (assoc-ref inputs "speech-tools")) |
| 359 | (with-directory-excursion "../speech_tools" |
| 360 | (substitute* '("config/rules/modules.mak" |
| 361 | "config/rules/test_make_rules.mak" |
| 362 | "config/make_system.mak") |
| 363 | (("/bin/sh") (which "sh")))) |
| 364 | #t)) |
| 365 | (add-after 'unpack 'patch-/bin/sh |
| 366 | (lambda _ |
| 367 | (substitute* '("config/test_make_rules" |
| 368 | "config/make_system.mak") |
| 369 | (("/bin/sh") (which "sh"))) |
| 370 | #t)) |
| 371 | (add-before 'build 'build-speech-tools |
| 372 | (lambda* (#:key configure-flags make-flags #:allow-other-keys) |
| 373 | (with-directory-excursion "../speech_tools" |
| 374 | (apply invoke "sh" "configure" |
| 375 | (string-append "CONFIG_SHELL=" (which "sh")) |
| 376 | (string-append "SHELL=" (which "sh")) |
| 377 | configure-flags) |
| 378 | (apply invoke "make" make-flags)))) |
| 379 | (add-after 'build 'build-documentation |
| 380 | (lambda _ |
| 381 | (with-directory-excursion "doc" |
| 382 | (invoke "make" "festival.info")))) |
| 383 | (add-after 'unpack 'set-installation-directories |
| 384 | (lambda* (#:key outputs #:allow-other-keys) |
| 385 | (let ((out (assoc-ref outputs "out"))) |
| 386 | (substitute* "config/project.mak" |
| 387 | (("^FTLIBDIR.*") |
| 388 | (string-append "FTLIBDIR=" out "/share/festival/lib"))) |
| 389 | (substitute* "config/systems/default.mak" |
| 390 | (("^INSTALL_PREFIX.*") |
| 391 | (string-append "INSTALL_PREFIX=" out))) |
| 392 | #t))) |
| 393 | (add-after 'install 'actually-install |
| 394 | (lambda* (#:key inputs outputs #:allow-other-keys) |
| 395 | (let ((out (assoc-ref outputs "out"))) |
| 396 | ;; Install Speech Tools first |
| 397 | (with-directory-excursion "../speech_tools" |
| 398 | ;; Target directories |
| 399 | (for-each (lambda (dir) |
| 400 | (mkdir-p (string-append out dir))) |
| 401 | '("/bin" |
| 402 | "/lib" |
| 403 | "/include/speech_tools/" |
| 404 | "/include/speech_tools/instantiate" |
| 405 | "/include/speech_tools/ling_class" |
| 406 | "/include/speech_tools/rxp" |
| 407 | "/include/speech_tools/sigpr" |
| 408 | "/include/speech_tools/unix")) |
| 409 | ;; Install binaries |
| 410 | (for-each (lambda (file) |
| 411 | (install-file file (string-append out "/bin"))) |
| 412 | (find-files "bin" ".*")) |
| 413 | (for-each (lambda (file) |
| 414 | (delete-file (string-append out "/bin/" file))) |
| 415 | '("est_gdb" "est_examples" "est_program")) |
| 416 | ;; Install libraries |
| 417 | (for-each (lambda (file) |
| 418 | (install-file file (string-append out "/lib"))) |
| 419 | (find-files "lib" "lib.*\\.so.*")) |
| 420 | |
| 421 | ;; Install headers |
| 422 | (for-each |
| 423 | (lambda (dir) |
| 424 | (for-each |
| 425 | (lambda (header) |
| 426 | (install-file header |
| 427 | (string-append out "/include/speech_tools/" dir))) |
| 428 | (find-files (string-append "include/" dir) |
| 429 | "\\.h$"))) |
| 430 | '("." "instantiate" "ling_class" "rxp" "sigpr" "unix"))) |
| 431 | |
| 432 | ;; Unpack files that will be installed together with the |
| 433 | ;; Festival libraries. |
| 434 | (invoke "tar" "--strip-components=1" |
| 435 | "-xvf" (assoc-ref inputs "festvox-cmu")) |
| 436 | (invoke "tar" "--strip-components=1" |
| 437 | "-xvf" (assoc-ref inputs "festvox-poslex")) |
| 438 | (invoke "tar" "--strip-components=1" |
| 439 | "-xvf" (assoc-ref inputs "default-voice")) |
| 440 | |
| 441 | ;; Install Festival |
| 442 | (let ((bin (string-append out "/bin")) |
| 443 | (incdir (string-append out "/include/festival")) |
| 444 | (share (string-append out "/share/festival")) |
| 445 | (info (string-append out "/share/info"))) |
| 446 | (for-each (lambda (executable) |
| 447 | (install-file executable bin)) |
| 448 | '("src/main/festival" |
| 449 | "src/main/festival_client" |
| 450 | "examples/benchmark")) |
| 451 | (let ((scripts '("examples/dumpfeats" |
| 452 | "examples/durmeanstd" |
| 453 | "examples/latest" |
| 454 | "examples/make_utts" |
| 455 | "examples/powmeanstd" |
| 456 | "examples/run-festival-script" |
| 457 | "examples/saytime" |
| 458 | "examples/scfg_parse_text" |
| 459 | "examples/text2pos" |
| 460 | "examples/text2wave"))) |
| 461 | (substitute* scripts |
| 462 | (("exec /tmp/guix-build.*/bin/festival") |
| 463 | (string-append "exec " bin "/festival"))) |
| 464 | (for-each (lambda (script) |
| 465 | (install-file script bin)) |
| 466 | scripts)) |
| 467 | |
| 468 | ;; Documentation |
| 469 | (for-each (lambda (file) |
| 470 | (install-file file info)) |
| 471 | (find-files "doc/info/" "festival.info.*")) |
| 472 | |
| 473 | ;; Headers |
| 474 | (mkdir-p incdir) |
| 475 | (for-each (lambda (header) |
| 476 | (install-file header |
| 477 | (string-append incdir "/" |
| 478 | (dirname header)))) |
| 479 | (find-files "src/include" "\\.h$")) |
| 480 | |
| 481 | ;; Data |
| 482 | (mkdir-p share) |
| 483 | (for-each (lambda (file) |
| 484 | (install-file file |
| 485 | (string-append share "/" |
| 486 | (dirname file)))) |
| 487 | (find-files "lib" ".*")) |
| 488 | (for-each delete-file |
| 489 | (append (find-files share "Makefile") |
| 490 | (find-files bin "Makefile"))))) |
| 491 | #t)) |
| 492 | (add-after 'actually-install 'install-emacs-mode |
| 493 | (lambda* (#:key outputs #:allow-other-keys) |
| 494 | (let ((emacs-dir (string-append (assoc-ref outputs "out") |
| 495 | "/share/emacs/site-lisp"))) |
| 496 | (install-file "lib/festival.el" emacs-dir) |
| 497 | (emacs-generate-autoloads ,name emacs-dir) |
| 498 | #t))) |
| 499 | ;; Rebuild the very old configure script that is confused by extra |
| 500 | ;; arguments. |
| 501 | (add-before 'configure 'bootstrap |
| 502 | (lambda _ (invoke "autoreconf" "-vif")))))) |
| 503 | (inputs |
| 504 | `(("ncurses" ,ncurses))) |
| 505 | (native-inputs |
| 506 | `(("autoconf" ,autoconf) |
| 507 | ("automake" ,automake) |
| 508 | ("texinfo" ,texinfo) |
| 509 | ("emacs" ,emacs-minimal) |
| 510 | ("festvox-cmu" |
| 511 | ,(origin |
| 512 | (method url-fetch) |
| 513 | (uri (string-append "http://festvox.org/packed/festival/" |
| 514 | (version-major+minor version) |
| 515 | "/festlex_CMU.tar.gz")) |
| 516 | (sha256 |
| 517 | (base32 |
| 518 | "01vwidqhhg2zifvk1gby91mckg1z2pv2mj6lihvdaifakf8k1561")))) |
| 519 | ("festvox-poslex" |
| 520 | ,(origin |
| 521 | (method url-fetch) |
| 522 | (uri (string-append "http://festvox.org/packed/festival/" |
| 523 | (version-major+minor version) |
| 524 | "/festlex_POSLEX.tar.gz")) |
| 525 | (sha256 |
| 526 | (base32 |
| 527 | "18wywilxaqwy63lc47p5g5529mpxhslibh1bjij0snxx5mjf7ip7")))) |
| 528 | ("default-voice" |
| 529 | ,(origin |
| 530 | (method url-fetch) |
| 531 | (uri (string-append "http://festvox.org/packed/festival/" |
| 532 | (version-major+minor version) |
| 533 | "/voices/festvox_kallpc16k.tar.gz")) |
| 534 | (sha256 |
| 535 | (base32 |
| 536 | "136hmsyiwnlg2qwa508dy0imf19mzrb5r3dmb2kg8kcyxnslm740")))) |
| 537 | ("speech-tools" |
| 538 | ,(origin |
| 539 | (method url-fetch) |
| 540 | (uri (string-append "http://festvox.org/packed/festival/" |
| 541 | (version-major+minor version) |
| 542 | "/speech_tools-" version "-release.tar.gz")) |
| 543 | (sha256 |
| 544 | (base32 |
| 545 | "1k2xh13miyv48gh06rgsq2vj25xwj7z6vwq9ilsn8i7ig3nrgzg4")))))) |
| 546 | (home-page "http://www.cstr.ed.ac.uk/projects/festival/") |
| 547 | (synopsis "Speech synthesis system") |
| 548 | (description "Festival offers a general framework for building speech |
| 549 | synthesis systems as well as including examples of various modules. As a |
| 550 | whole it offers full text to speech through a number APIs: from shell level, |
| 551 | though a Scheme command interpreter, as a C++ library, from Java, and an Emacs |
| 552 | interface. Festival is multi-lingual though English is the most advanced. |
| 553 | The system is written in C++ and uses the Edinburgh Speech Tools Library for |
| 554 | low level architecture and has a Scheme (SIOD) based command interpreter for |
| 555 | control.") |
| 556 | (license (license:non-copyleft "file://COPYING")))) |
| 557 | |
| 558 | (define-public sphinxbase |
| 559 | (package |
| 560 | (name "sphinxbase") |
| 561 | (version "5prealpha") |
| 562 | (source |
| 563 | (origin |
| 564 | (method url-fetch) |
| 565 | (uri (string-append "mirror://sourceforge/cmusphinx/" |
| 566 | "sphinxbase/" version "/" |
| 567 | "sphinxbase-" version ".tar.gz")) |
| 568 | (sha256 |
| 569 | (base32 "0vr4k8pv5a8nvq9yja7kl13b5lh0f9vha8fc8znqnm8bwmcxnazp")) |
| 570 | (patches (search-patches "sphinxbase-fix-doxygen.patch")))) |
| 571 | (build-system gnu-build-system) |
| 572 | (arguments |
| 573 | `(#:parallel-tests? #f)) ;tests fail otherwise |
| 574 | (native-inputs |
| 575 | `(("bison" ,bison) |
| 576 | ("doxygen" ,doxygen) |
| 577 | ("perl" ,perl) ;for tests |
| 578 | ("python" ,python) |
| 579 | ("swig" ,swig))) |
| 580 | (inputs |
| 581 | `(("pulseaudio" ,pulseaudio))) |
| 582 | (home-page "https://cmusphinx.github.io/") |
| 583 | (synopsis "Support library required by Pocketsphinx and Sphinxtrain") |
| 584 | (description "This package contains the basic libraries shared by |
| 585 | the CMU Sphinx trainer and all the Sphinx decoders (Sphinx-II, |
| 586 | Sphinx-III, and PocketSphinx), as well as some common utilities for |
| 587 | manipulating acoustic feature and audio files.") |
| 588 | (license license:bsd-4))) |
| 589 | |
| 590 | (define-public pocketsphinx |
| 591 | (package |
| 592 | (name "pocketsphinx") |
| 593 | (version "5prealpha") |
| 594 | (source |
| 595 | (origin |
| 596 | (method url-fetch) |
| 597 | (uri (string-append "mirror://sourceforge/cmusphinx/" |
| 598 | "pocketsphinx/" version "/" |
| 599 | "pocketsphinx-" version ".tar.gz")) |
| 600 | (sha256 |
| 601 | (base32 "1n9yazzdgvpqgnfzsbl96ch9cirayh74jmpjf7svs4i7grabanzg")))) |
| 602 | (build-system gnu-build-system) |
| 603 | (native-inputs |
| 604 | `(("pkg-config" ,pkg-config) |
| 605 | ("perl" ,perl) ;for tests |
| 606 | ("python" ,python) |
| 607 | ("swig" ,swig))) |
| 608 | (inputs |
| 609 | `(("gstreamer" ,gstreamer) |
| 610 | ("libcap" ,libcap) |
| 611 | ("pulseaudio" ,pulseaudio) |
| 612 | ("sphinxbase" ,sphinxbase))) |
| 613 | (home-page "https://cmusphinx.github.io/") |
| 614 | (synopsis "Recognizer library written in C") |
| 615 | (description "PocketSphinx is one of Carnegie Mellon University's |
| 616 | large vocabulary, speaker-independent continuous speech recognition |
| 617 | engine.") |
| 618 | (license license:bsd-2))) |