Paste number 325007: praat Guix package (unfinished) 9

Paste number 325007: praat Guix package (unfinished) 9
Pasted by: Brendan
When:5 years, 11 months ago
Share:Tweet this! |
Paste contents:
Raw Source | XML | Display As
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016 Brendan Tildesley <>
;;; This file is part of GNU Guix.
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; GNU General Public License for more details.
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <>.

(define-module (gnu packages linguistics)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix build-system gnu)
  #:use-module (guix utils)
  #:use-module (guix download)
  #:use-module (gnu packages)
  #:use-module (gnu packages linux) ; for alsa-lib
  #:use-module (gnu packages gtk)
#  #:use-module (gnu packages gtk)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages version-control)
  #:use-module (gnu packages python)
  #:use-module (gnu packages pulseaudio)
  #:use-module (gnu packages image)
  #:use-module (gnu packages gcc))
;;    gcc -std=gnu99 -o sendpraat -DUNIX `pkg-config --cflags --libs gtk+-2.0` sendpraat.c
(define-public praat
    (name "praat")
    (version "6.0.19")
    (synopsis "Phonetics analysis program for linguists")
    (source (origin
              (method url-fetch)
              (uri (string-append
                    "" version ".tar.gz"))
              (file-name (string-append name "-" version ".tar.gz"))
              (modules '((guix build utils)))
              ;; Remote timestamp to make the build reproducible 
               '(substitute* "external/portaudio/pa_front.c"
                  ((" \\(built \" __DATE__  \" \" __TIME__ \"\\)") "")))))
    (build-system gnu-build-system)
     `(("pkg-config" ,pkg-config)
       ("libicns" ,libicns)
       ("gcc", gcc)))
     `(("gtk2" ,gtk+2)
       ("gtk3" ,gtk+)
       ("alsa-lib" ,alsa-lib)
       ("pulseaudio" ,pulseaudio)
       ("python" ,python-2)))           ; optional scripts
     ;; No make check. The GUI seems to have some tests in test/ though.
     `(#:tests? #f
       (modify-phases %standard-phases
         (delete 'configure)
         (add-after 'unpack 'copy-makefile
           (lambda _
             (copy-file "makefiles/makefile.defs.linux.pulse"
         ;; Temporary solution until I can see if upstream will accept this.
         (add-before 'build 'build-desktop
           (lambda _
             (let* ((out (assoc-ref %outputs "out"))
                    (app (string-append out "/usr/share/applications")))
               (mkdir-p app)
                   (string-append app "/praat.desktop")
                 (lambda (port)
                   (format port "~
                    [Desktop Entry]~@
                    Keywords=audio;sound;speech;phonetics~%" ,name ,synopsis  %output))))
             (chdir "sys")
             (display (system "pkg-config --list-all | grep gtk"))
             (system (string-append
                      "gcc -std=gnu99 -o sendpraat -DSTAND_ALONE -DUNIX"
                      (system "pkg-config --silence-errors --cflags --libs gtk+-2.0")
             (zero? (system* "icns2png" "-x" "-o" "main/" "main/Praat.icns"))

        ;; [Desktop Entry]
         ;; Version=1.0
         ;; Name=Praat Speech Analyzer
         ;; Name[en_GB]=Praat Speech Analyser
         ;; GenericName=Speech Analyzer
         ;; GenericName[en_GB]=Speech Analyser
         ;; Comment=Analyze, synthesize and manipulate speech
         ;; Comment[en_GB]=Analyse, synthesise and manipulate speech
         ;; Type=Application
         ;; Exec=praat
         ;; Icon=praat
         ;; Categories=Education;Science;
         ;; Keywords=audio;sound;speech;phonetics
         (delete 'build)
         (replace 'install
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (bin (string-append out "/bin"))
                     (lambda (source target)
                       (let ((dir (dirname target)))
                         (mkdir-p dir)
                         (copy-file source (string-append out target)))
                       (install-file* "main/Praat_128x128x32.png"
                       (install-file* "main/Praat_48x48x32.png"
                       (install-file* "main/Praat_32x32x32.png"
                       (install-file* "main/Praat_16x16x32.png"
               (display "hi")
               (system* "touch" "praat") ;
               (install-file "praat" bin)
                                        ;     (install-file "sendpraat" bin)
    (home-page "")
     "According to its authors, praat is \"doing phonetics by computer\".
Through its graphical interface, several speech analysis functionalities are
available: spectrograms, cochleograms, and pitch and formant
extraction.  Articulatory synthesis, as well as synthesis from pitch, formant,
and intensity are also available.  Other features are segmentation, labelling
using the phonetic alphabet, and computation of statistics.  Praat is
configurable and extensible through its own scripting language and has
provisions for communicating with other programs.")
    (license (list
              ;; Praat itself (no version stated => gpl2+ by gpl terms)
              ;; EEG/*, FFNet/*, LPC/* external/mp3/*
              ;; external/espeak/espeakdata_FileInMemory.*
              ;; contrib/ola/* , kar/ipaSerifRegularPS.cpp
              ;; dwsys/regularExp.h , dwsys/NUMmathlib.cpp
              ;; external/gsl/* , external/glpk/* , external/espeak/*
              license:bsd-3             ; external/flac/*
              license:expat             ; external/portaudio/*
              license:public-domain     ; num/NUMrandom.cpp
              ;; external/flac/flac_share_alloc.h , external/glpk/colamd.c

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.