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