1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
4 ;;; This file is part of GNU Guix.
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19 (define-module (gnu packages music)
20 #:use-module (guix utils)
21 #:use-module (guix packages)
22 #:use-module (guix download)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages audio)
27 #:use-module (gnu packages bison)
28 #:use-module (gnu packages docbook)
29 #:use-module (gnu packages flex)
30 #:use-module (gnu packages fonts)
31 #:use-module (gnu packages fontutils)
32 #:use-module (gnu packages gcc)
33 #:use-module (gnu packages gettext)
34 #:use-module (gnu packages ghostscript)
35 #:use-module (gnu packages gnome)
36 #:use-module (gnu packages gtk)
37 #:use-module (gnu packages guile)
38 #:use-module (gnu packages image)
39 #:use-module (gnu packages imagemagick)
40 #:use-module (gnu packages java)
41 #:use-module (gnu packages linux) ; for alsa-utils
42 #:use-module (gnu packages man)
43 #:use-module (gnu packages mp3)
44 #:use-module (gnu packages netpbm)
45 #:use-module (gnu packages perl)
46 #:use-module (gnu packages pkg-config)
47 #:use-module (gnu packages python)
48 #:use-module (gnu packages rsync)
49 #:use-module (gnu packages texinfo)
50 #:use-module (gnu packages texlive)
51 #:use-module (gnu packages xml)
52 #:use-module (gnu packages xiph)
53 #:use-module (gnu packages zip))
55 (define-public lilypond
62 "http://download.linuxaudio.org/lilypond/sources/v"
63 (version-major+minor version) "/"
64 name "-" version ".tar.gz"))
67 "01xs9x2wjj7w9appaaqdhk15r1xvvdbz9qwahzhppfmhclvp779j"))))
68 (build-system gnu-build-system)
70 `(;; Tests fail with this error:
71 ;; Undefined subroutine &main::get_index called at
72 ;; ./lilypond-2.18.2/Documentation/lilypond-texi2html.init line 2127.
77 'configure 'prepare-configuration
79 (substitute* "configure"
80 (("SHELL=/bin/sh") "SHELL=sh"))
85 `(("guile" ,guile-1.8)
86 ("font-dejavu" ,font-dejavu)
87 ("fontconfig" ,fontconfig)
88 ("freetype" ,freetype)
89 ("ghostscript" ,ghostscript)
91 ("python" ,python-2)))
96 ("fontforge" ,fontforge)
98 ("gettext" ,gnu-gettext)
99 ("imagemagick" ,imagemagick)
100 ("netpbm" ,netpbm) ;for pngtopnm
101 ("texlive" ,texlive) ;metafont and metapost
103 ("texi2html" ,texi2html)
105 ("pkg-config" ,pkg-config)
107 (home-page "http://www.lilypond.org/")
108 (synopsis "Music typesetting")
110 "GNU LilyPond is a music typesetter, which produces high-quality sheet
111 music. Music is input in a text file containing control sequences which are
112 interpreted by LilyPond to produce the final document. It is extendable with
114 (license license:gpl3+)))
116 (define-public solfege
123 "mirror://gnu/solfege/solfege-"
127 "1w25rxdbj907nsx285k9nm480pvy12w3yknfh4n1dfv17cwy072i"))))
128 (build-system gnu-build-system)
130 `(#:tests? #f ; xmllint attempts to download DTD
134 'unpack 'fix-configuration
135 (lambda* (#:key inputs #:allow-other-keys)
136 (substitute* "default.config"
138 (string-append "csound="
139 (assoc-ref inputs "csound")
142 (string-append (assoc-ref inputs "aplay")
144 (("/usr/bin/timidity")
145 (string-append (assoc-ref inputs "timidity")
148 (string-append (assoc-ref inputs "mpg123")
151 (string-append (assoc-ref inputs "ogg123")
154 'build 'patch-python-shebangs
156 ;; Two python scripts begin with a Unicode BOM, so patch-shebang
158 (substitute* '("solfege/parsetree.py"
159 "solfege/presetup.py")
160 (("#!/usr/bin/python") (string-append "#!" (which "python")))))
163 ;; .pth files are not automatically interpreted unless the
164 ;; directories containing them are added as "sites". The directories
165 ;; are then added to those in the PYTHONPATH. This is required for
166 ;; the operation of pygtk and pygobject.
168 (substitute* "run-solfege.py"
171 for path in [path for path in sys.path if 'site-packages' in path]: site.addsitedir(path)")))
173 'build 'adjust-config-file-prefix
174 (lambda* (#:key outputs #:allow-other-keys)
175 (substitute* "run-solfege.py"
176 (("prefix = os.path.*$")
177 (string-append "prefix = " (assoc-ref outputs "out")))))
179 'install 'wrap-program
180 (lambda* (#:key inputs outputs #:allow-other-keys)
181 ;; Make sure 'solfege' runs with the correct PYTHONPATH. We
182 ;; also need to modify GDK_PIXBUF_MODULE_FILE for SVG support.
183 (let* ((out (assoc-ref outputs "out"))
184 (path (getenv "PYTHONPATH"))
185 (rsvg (assoc-ref inputs "librsvg"))
186 (pixbuf (find-files rsvg "^loaders\\.cache$")))
187 (wrap-program (string-append out "/bin/solfege")
188 `("PYTHONPATH" ":" prefix (,path))
189 `("GDK_PIXBUF_MODULE_FILE" ":" prefix ,pixbuf))))
190 %standard-phases)))))))
192 `(("python" ,python-2)
193 ("pygtk" ,python2-pygtk)
194 ("gettext" ,gnu-gettext)
196 ;; TODO: Lilypond is optional. Produces errors at build time:
197 ;; Drawing systems...Error: /undefinedresult in --glyphshow--
198 ;; Fontconfig is needed to fix one of the errors, but other similar
200 ;;("lilypond" ,lilypond)
201 ("librsvg" ,librsvg) ; needed at runtime for icons
202 ("libpng" ,libpng) ; needed at runtime for icons
203 ;; players needed at runtime
204 ("aplay" ,alsa-utils)
205 ("csound" ,csound) ; optional, needed for some exercises
207 ("ogg123" ,vorbis-tools)
208 ("timidity" ,timidity++)))
210 `(("pkg-config" ,pkg-config)
212 ("libxml2" ,libxml2) ; for tests
213 ("ghostscript" ,ghostscript)
214 ;;("fontconfig" ,fontconfig) ; only needed with lilypond
215 ;;("freetype" ,freetype) ; only needed with lilypond
216 ("texinfo" ,texinfo)))
217 (home-page "https://www.gnu.org/software/solfege/")
218 (synopsis "Ear training")
220 "GNU Solfege is a program for practicing musical ear-training. With it,
221 you can practice your recognition of various musical intervals and chords. It
222 features a statistics overview so you can monitor your progress across several
223 sessions. Solfege is also designed to be extensible so you can easily write
225 (license license:gpl3+)))
227 (define-public tuxguitar
234 "mirror://sourceforge/tuxguitar/TuxGuitar/TuxGuitar-"
235 version "/tuxguitar-src-" version ".tar.gz"))
238 "1g1yf2gd06fzdhqb8kb8dmdcmr602s9y24f01kyl4940wimgr944"))))
239 (build-system gnu-build-system)
241 `(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
242 (assoc-ref %outputs "out") "/lib")
243 (string-append "PREFIX="
244 (assoc-ref %outputs "out"))
245 (string-append "SWT_PATH="
246 (assoc-ref %build-inputs "swt")
247 "/share/java/swt.jar"))
248 #:tests? #f ;no "check" target
249 #:parallel-build? #f ;not supported
252 'build 'enter-dir-set-path-and-pass-ldflags
253 (lambda* (#:key inputs #:allow-other-keys)
255 (substitute* "GNUmakefile"
257 (string-append "PROPERTIES?= -Dswt.library.path="
258 (assoc-ref inputs "swt") "/lib"))
259 (("\\$\\(GCJ\\) -o") "$(GCJ) $(LDFLAGS) -o"))
261 (alist-delete 'configure %standard-phases))))
266 ("pkg-config" ,pkg-config)))
267 (home-page "http://tuxguitar.com.ar")
268 (synopsis "Multitrack tablature editor and player")
270 "TuxGuitar is a guitar tablature editor with player support through midi.
271 It can display scores and multitrack tabs. TuxGuitar provides various
272 additional features, including autoscrolling while playing, note duration
273 management, bend/slide/vibrato/hammer-on/pull-off effects, support for
274 tuplets, time signature management, tempo management, gp3/gp4/gp5 import and
276 (license license:lgpl2.1+)))