gnu: ftgl: Propagate "freetype".
[jackhill/guix/guix.git] / gnu / packages / music.scm
CommitLineData
1b6826d3
RW
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
3;;;
4;;; This file is part of GNU Guix.
5;;;
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.
10;;;
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.
15;;;
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/>.
18
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)
8b9ec354 25 #:use-module (guix build-system cmake)
1b6826d3 26 #:use-module (gnu packages)
c267cc15 27 #:use-module (gnu packages audio)
8b9ec354
RW
28 #:use-module (gnu packages base) ;libbdf
29 #:use-module (gnu packages boost)
1b6826d3 30 #:use-module (gnu packages bison)
8b9ec354
RW
31 #:use-module (gnu packages code)
32 #:use-module (gnu packages check)
33 #:use-module (gnu packages compression)
1b6826d3
RW
34 #:use-module (gnu packages docbook)
35 #:use-module (gnu packages flex)
36 #:use-module (gnu packages fonts)
37 #:use-module (gnu packages fontutils)
6260d1a8 38 #:use-module (gnu packages gcc)
1b6826d3
RW
39 #:use-module (gnu packages gettext)
40 #:use-module (gnu packages ghostscript)
c267cc15 41 #:use-module (gnu packages gnome)
1b6826d3
RW
42 #:use-module (gnu packages gtk)
43 #:use-module (gnu packages guile)
c267cc15 44 #:use-module (gnu packages image)
1b6826d3 45 #:use-module (gnu packages imagemagick)
6260d1a8 46 #:use-module (gnu packages java)
c267cc15
RW
47 #:use-module (gnu packages linux) ; for alsa-utils
48 #:use-module (gnu packages man)
49 #:use-module (gnu packages mp3)
1b6826d3
RW
50 #:use-module (gnu packages netpbm)
51 #:use-module (gnu packages perl)
52 #:use-module (gnu packages pkg-config)
53 #:use-module (gnu packages python)
8b9ec354 54 #:use-module (gnu packages qt)
1b6826d3
RW
55 #:use-module (gnu packages rsync)
56 #:use-module (gnu packages texinfo)
57 #:use-module (gnu packages texlive)
8b9ec354 58 #:use-module (gnu packages web)
c267cc15
RW
59 #:use-module (gnu packages xml)
60 #:use-module (gnu packages xiph)
1b6826d3
RW
61 #:use-module (gnu packages zip))
62
63(define-public lilypond
64 (package
65 (name "lilypond")
66 (version "2.18.2")
67 (source (origin
68 (method url-fetch)
69 (uri (string-append
70 "http://download.linuxaudio.org/lilypond/sources/v"
71 (version-major+minor version) "/"
72 name "-" version ".tar.gz"))
73 (sha256
74 (base32
75 "01xs9x2wjj7w9appaaqdhk15r1xvvdbz9qwahzhppfmhclvp779j"))))
76 (build-system gnu-build-system)
77 (arguments
78 `(;; Tests fail with this error:
79 ;; Undefined subroutine &main::get_index called at
80 ;; ./lilypond-2.18.2/Documentation/lilypond-texi2html.init line 2127.
81 #:tests? #f
82 #:out-of-source? #t
83 #:phases
84 (alist-cons-before
85 'configure 'prepare-configuration
86 (lambda _
87 (substitute* "configure"
88 (("SHELL=/bin/sh") "SHELL=sh"))
89 (setenv "out" "")
90 #t)
91 %standard-phases)))
92 (inputs
93 `(("guile" ,guile-1.8)
94 ("font-dejavu" ,font-dejavu)
95 ("fontconfig" ,fontconfig)
96 ("freetype" ,freetype)
97 ("ghostscript" ,ghostscript)
98 ("pango" ,pango)
99 ("python" ,python-2)))
100 (native-inputs
101 `(("bison" ,bison)
102 ("perl" ,perl)
103 ("flex" ,flex)
104 ("fontforge" ,fontforge)
105 ("dblatex" ,dblatex)
106 ("gettext" ,gnu-gettext)
107 ("imagemagick" ,imagemagick)
108 ("netpbm" ,netpbm) ;for pngtopnm
109 ("texlive" ,texlive) ;metafont and metapost
110 ("texinfo" ,texinfo)
111 ("texi2html" ,texi2html)
112 ("rsync" ,rsync)
113 ("pkg-config" ,pkg-config)
114 ("zip" ,zip)))
115 (home-page "http://www.lilypond.org/")
116 (synopsis "Music typesetting")
117 (description
118 "GNU LilyPond is a music typesetter, which produces high-quality sheet
119music. Music is input in a text file containing control sequences which are
120interpreted by LilyPond to produce the final document. It is extendable with
121Guile.")
122 (license license:gpl3+)))
c267cc15
RW
123
124(define-public solfege
125 (package
126 (name "solfege")
127 (version "3.22.2")
128 (source (origin
129 (method url-fetch)
130 (uri (string-append
131 "mirror://gnu/solfege/solfege-"
132 version ".tar.xz"))
133 (sha256
134 (base32
135 "1w25rxdbj907nsx285k9nm480pvy12w3yknfh4n1dfv17cwy072i"))))
136 (build-system gnu-build-system)
137 (arguments
138 `(#:tests? #f ; xmllint attempts to download DTD
139 #:test-target "test"
140 #:phases
141 (alist-cons-after
142 'unpack 'fix-configuration
143 (lambda* (#:key inputs #:allow-other-keys)
144 (substitute* "default.config"
145 (("csound=csound")
146 (string-append "csound="
147 (assoc-ref inputs "csound")
148 "/bin/csound"))
149 (("/usr/bin/aplay")
150 (string-append (assoc-ref inputs "aplay")
151 "/bin/aplay"))
152 (("/usr/bin/timidity")
153 (string-append (assoc-ref inputs "timidity")
154 "/bin/timidity"))
155 (("/usr/bin/mpg123")
156 (string-append (assoc-ref inputs "mpg123")
157 "/bin/mpg123"))
158 (("/usr/bin/ogg123")
159 (string-append (assoc-ref inputs "ogg123")
160 "/bin/ogg123"))))
161 (alist-cons-before
162 'build 'patch-python-shebangs
163 (lambda _
164 ;; Two python scripts begin with a Unicode BOM, so patch-shebang
165 ;; has no effect.
166 (substitute* '("solfege/parsetree.py"
167 "solfege/presetup.py")
168 (("#!/usr/bin/python") (string-append "#!" (which "python")))))
169 (alist-cons-before
170 'build 'add-sitedirs
171 ;; .pth files are not automatically interpreted unless the
172 ;; directories containing them are added as "sites". The directories
173 ;; are then added to those in the PYTHONPATH. This is required for
174 ;; the operation of pygtk and pygobject.
175 (lambda _
176 (substitute* "run-solfege.py"
177 (("import os")
178 "import os, site
179for path in [path for path in sys.path if 'site-packages' in path]: site.addsitedir(path)")))
180 (alist-cons-before
181 'build 'adjust-config-file-prefix
182 (lambda* (#:key outputs #:allow-other-keys)
183 (substitute* "run-solfege.py"
184 (("prefix = os.path.*$")
185 (string-append "prefix = " (assoc-ref outputs "out")))))
186 (alist-cons-after
187 'install 'wrap-program
188 (lambda* (#:key inputs outputs #:allow-other-keys)
189 ;; Make sure 'solfege' runs with the correct PYTHONPATH. We
190 ;; also need to modify GDK_PIXBUF_MODULE_FILE for SVG support.
191 (let* ((out (assoc-ref outputs "out"))
192 (path (getenv "PYTHONPATH"))
193 (rsvg (assoc-ref inputs "librsvg"))
194 (pixbuf (find-files rsvg "^loaders\\.cache$")))
195 (wrap-program (string-append out "/bin/solfege")
196 `("PYTHONPATH" ":" prefix (,path))
197 `("GDK_PIXBUF_MODULE_FILE" ":" prefix ,pixbuf))))
198 %standard-phases)))))))
199 (inputs
200 `(("python" ,python-2)
201 ("pygtk" ,python2-pygtk)
202 ("gettext" ,gnu-gettext)
203 ("gtk" ,gtk+)
204 ;; TODO: Lilypond is optional. Produces errors at build time:
205 ;; Drawing systems...Error: /undefinedresult in --glyphshow--
206 ;; Fontconfig is needed to fix one of the errors, but other similar
207 ;; errors remain.
208 ;;("lilypond" ,lilypond)
209 ("librsvg" ,librsvg) ; needed at runtime for icons
210 ("libpng" ,libpng) ; needed at runtime for icons
211 ;; players needed at runtime
212 ("aplay" ,alsa-utils)
213 ("csound" ,csound) ; optional, needed for some exercises
214 ("mpg123" ,mpg123)
215 ("ogg123" ,vorbis-tools)
216 ("timidity" ,timidity++)))
217 (native-inputs
218 `(("pkg-config" ,pkg-config)
219 ("txt2man" ,txt2man)
220 ("libxml2" ,libxml2) ; for tests
221 ("ghostscript" ,ghostscript)
222 ;;("fontconfig" ,fontconfig) ; only needed with lilypond
223 ;;("freetype" ,freetype) ; only needed with lilypond
224 ("texinfo" ,texinfo)))
225 (home-page "https://www.gnu.org/software/solfege/")
226 (synopsis "Ear training")
227 (description
228 "GNU Solfege is a program for practicing musical ear-training. With it,
229you can practice your recognition of various musical intervals and chords. It
230features a statistics overview so you can monitor your progress across several
231sessions. Solfege is also designed to be extensible so you can easily write
232your own lessons.")
233 (license license:gpl3+)))
6260d1a8 234
8b9ec354
RW
235(define-public powertabeditor
236 (package
237 (name "powertabeditor")
238 (version "2.0.0-alpha7")
239 (source (origin
240 (method url-fetch)
241 (uri (string-append
242 "https://github.com/powertab/powertabeditor/archive/"
243 version ".tar.gz"))
244 (file-name (string-append name "-" version ".tar.gz"))
245 (sha256
246 (base32
247 "1yp6ck2r72c2pfq31z1kpw1j639rndrifj85l3cbj2kdf8rdzhkk"))
248 (modules '((guix build utils)))
249 (snippet
250 '(begin
251 ;; Remove bundled sources for external libraries
252 (delete-file-recursively "external")
253 (substitute* "CMakeLists.txt"
254 (("include_directories\\(\\$\\{PROJECT_SOURCE_DIR\\}/external/.*") "")
255 ;; TODO: tests cannot be built:
256 ;; test/test_main.cpp:28:12: error: ‘Session’ is not a member of ‘Catch’
257 (("add_subdirectory\\(test\\)") "")
258 (("add_subdirectory\\(external\\)") ""))
259 (substitute* "test/CMakeLists.txt"
260 (("include_directories\\(\\$\\{PROJECT_SOURCE_DIR\\}/external/.*") ""))
261
262 ;; Add install target
263 (substitute* "source/CMakeLists.txt"
264 (("qt5_use_modules")
265 (string-append
266 "install(TARGETS powertabeditor "
267 "RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)\n"
268 "install(FILES data/tunings.json DESTINATION "
269 "${CMAKE_INSTALL_PREFIX}/share/powertabeditor/)\n"
270 "qt5_use_modules")))
271 #t))))
272 (build-system cmake-build-system)
273 (arguments
274 `(#:tests? #f ; no "check" target
275 #:modules ((guix build cmake-build-system)
276 (guix build utils)
277 (ice-9 match))
278 #:configure-flags
279 ;; CMake appears to lose the RUNPATH for some reason, so it has to be
280 ;; explicitly set with CMAKE_INSTALL_RPATH.
281 (list (string-append "-DCMAKE_INSTALL_RPATH="
282 (string-join (map (match-lambda
283 ((name . directory)
284 (string-append directory "/lib")))
285 %build-inputs) ";")))
286 #:phases
287 (modify-phases %standard-phases
288 (add-before
289 'configure 'remove-third-party-libs
290 (lambda* (#:key inputs #:allow-other-keys)
291 ;; Link with required static libraries, because we're not
292 ;; using the bundled version of withershins.
293 (substitute* '("source/CMakeLists.txt"
294 "test/CMakeLists.txt")
295 (("target_link_libraries\\((powertabeditor)" _ target)
296 (string-append "target_link_libraries(" target " "
297 (assoc-ref inputs "binutils")
298 "/lib/libbfd.a "
299 (assoc-ref inputs "gcc")
300 "/lib/libiberty.a "
301 "dl")))
302 #t)))))
303 (inputs
304 `(("boost" ,boost)
305 ("alsa-lib" ,alsa-lib)
306 ("qt" ,qt)
307 ("withershins" ,withershins)
308 ("gcc" ,gcc-4.8 "lib") ;for libiberty.a (for withershins)
309 ("binutils" ,binutils) ;for -lbfd and -liberty (for withershins)
310 ("timidity" ,timidity++)
311 ("pugixml" ,pugixml)
312 ("rtmidi" ,rtmidi)
313 ("rapidjson" ,rapidjson)
314 ("zlib" ,zlib)))
315 (native-inputs
316 `(("catch" ,catch-framework)
317 ("pkg-config" ,pkg-config)))
318 (home-page "http://powertabs.net")
319 (synopsis "Guitar tablature editor")
320 (description
321 "Power Tab Editor 2.0 is the successor to the famous original Power Tab
322Editor. It is compatible with Power Tab Editor 1.7 and Guitar Pro.")
323 (license license:gpl3+)))
324
6260d1a8
RW
325(define-public tuxguitar
326 (package
327 (name "tuxguitar")
328 (version "1.2")
329 (source (origin
330 (method url-fetch)
331 (uri (string-append
332 "mirror://sourceforge/tuxguitar/TuxGuitar/TuxGuitar-"
333 version "/tuxguitar-src-" version ".tar.gz"))
334 (sha256
335 (base32
336 "1g1yf2gd06fzdhqb8kb8dmdcmr602s9y24f01kyl4940wimgr944"))))
337 (build-system gnu-build-system)
338 (arguments
339 `(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
340 (assoc-ref %outputs "out") "/lib")
341 (string-append "PREFIX="
342 (assoc-ref %outputs "out"))
343 (string-append "SWT_PATH="
344 (assoc-ref %build-inputs "swt")
345 "/share/java/swt.jar"))
346 #:tests? #f ;no "check" target
347 #:parallel-build? #f ;not supported
348 #:phases
349 (alist-cons-before
350 'build 'enter-dir-set-path-and-pass-ldflags
351 (lambda* (#:key inputs #:allow-other-keys)
352 (chdir "TuxGuitar")
353 (substitute* "GNUmakefile"
354 (("PROPERTIES\\?=")
355 (string-append "PROPERTIES?= -Dswt.library.path="
356 (assoc-ref inputs "swt") "/lib"))
357 (("\\$\\(GCJ\\) -o") "$(GCJ) $(LDFLAGS) -o"))
358 #t)
359 (alist-delete 'configure %standard-phases))))
360 (inputs
361 `(("swt" ,swt)))
362 (native-inputs
363 `(("gcj" ,gcj-4.8)
364 ("pkg-config" ,pkg-config)))
365 (home-page "http://tuxguitar.com.ar")
366 (synopsis "Multitrack tablature editor and player")
367 (description
368 "TuxGuitar is a guitar tablature editor with player support through midi.
369It can display scores and multitrack tabs. TuxGuitar provides various
370additional features, including autoscrolling while playing, note duration
371management, bend/slide/vibrato/hammer-on/pull-off effects, support for
372tuplets, time signature management, tempo management, gp3/gp4/gp5 import and
373export.")
374 (license license:lgpl2.1+)))