You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

374 lines
15 KiB

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 Ricardo Wurmus <>
;;; 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 music)
#:use-module (guix utils)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix build-system gnu)
#:use-module (guix build-system cmake)
#:use-module (gnu packages)
#:use-module (gnu packages audio)
#:use-module (gnu packages base) ;libbdf
#:use-module (gnu packages boost)
#:use-module (gnu packages bison)
#:use-module (gnu packages code)
#:use-module (gnu packages check)
#:use-module (gnu packages compression)
#:use-module (gnu packages docbook)
#:use-module (gnu packages flex)
#:use-module (gnu packages fonts)
#:use-module (gnu packages fontutils)
#:use-module (gnu packages gcc)
#:use-module (gnu packages gettext)
#:use-module (gnu packages ghostscript)
#:use-module (gnu packages gnome)
#:use-module (gnu packages gtk)
#:use-module (gnu packages guile)
#:use-module (gnu packages image)
#:use-module (gnu packages imagemagick)
#:use-module (gnu packages java)
#:use-module (gnu packages linux) ; for alsa-utils
#:use-module (gnu packages man)
#:use-module (gnu packages mp3)
#:use-module (gnu packages netpbm)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
#:use-module (gnu packages qt)
#:use-module (gnu packages rsync)
#:use-module (gnu packages texinfo)
#:use-module (gnu packages texlive)
#:use-module (gnu packages web)
#:use-module (gnu packages xml)
#:use-module (gnu packages xiph)
#:use-module (gnu packages zip))
(define-public lilypond
(name "lilypond")
(version "2.18.2")
(source (origin
(method url-fetch)
(uri (string-append
(version-major+minor version) "/"
name "-" version ".tar.gz"))
(build-system gnu-build-system)
`(;; Tests fail with this error:
;; Undefined subroutine &main::get_index called at
;; ./lilypond-2.18.2/Documentation/lilypond-texi2html.init line 2127.
#:tests? #f
#:out-of-source? #t
'configure 'prepare-configuration
(lambda _
(substitute* "configure"
(("SHELL=/bin/sh") "SHELL=sh"))
(setenv "out" "")
`(("guile" ,guile-1.8)
("font-dejavu" ,font-dejavu)
("fontconfig" ,fontconfig)
("freetype" ,freetype)
("ghostscript" ,ghostscript)
("pango" ,pango)
("python" ,python-2)))
`(("bison" ,bison)
("perl" ,perl)
("flex" ,flex)
("fontforge" ,fontforge)
("dblatex" ,dblatex)
("gettext" ,gnu-gettext)
("imagemagick" ,imagemagick)
("netpbm" ,netpbm) ;for pngtopnm
("texlive" ,texlive) ;metafont and metapost
("texinfo" ,texinfo)
("texi2html" ,texi2html)
("rsync" ,rsync)
("pkg-config" ,pkg-config)
("zip" ,zip)))
(home-page "")
(synopsis "Music typesetting")
"GNU LilyPond is a music typesetter, which produces high-quality sheet
music. Music is input in a text file containing control sequences which are
interpreted by LilyPond to produce the final document. It is extendable with
(license license:gpl3+)))
(define-public solfege
(name "solfege")
(version "3.22.2")
(source (origin
(method url-fetch)
(uri (string-append
version ".tar.xz"))
(build-system gnu-build-system)
`(#:tests? #f ; xmllint attempts to download DTD
#:test-target "test"
'unpack 'fix-configuration
(lambda* (#:key inputs #:allow-other-keys)
(substitute* "default.config"
(string-append "csound="
(assoc-ref inputs "csound")
(string-append (assoc-ref inputs "aplay")
(string-append (assoc-ref inputs "timidity")
(string-append (assoc-ref inputs "mpg123")
(string-append (assoc-ref inputs "ogg123")
'build 'patch-python-shebangs
(lambda _
;; Two python scripts begin with a Unicode BOM, so patch-shebang
;; has no effect.
(substitute* '("solfege/"
(("#!/usr/bin/python") (string-append "#!" (which "python")))))
'build 'add-sitedirs
;; .pth files are not automatically interpreted unless the
;; directories containing them are added as "sites". The directories
;; are then added to those in the PYTHONPATH. This is required for
;; the operation of pygtk and pygobject.
(lambda _
(substitute* ""
(("import os")
"import os, site
for path in [path for path in sys.path if 'site-packages' in path]: site.addsitedir(path)")))
'build 'adjust-config-file-prefix
(lambda* (#:key outputs #:allow-other-keys)
(substitute* ""
(("prefix = os.path.*$")
(string-append "prefix = " (assoc-ref outputs "out")))))
'install 'wrap-program
(lambda* (#:key inputs outputs #:allow-other-keys)
;; Make sure 'solfege' runs with the correct PYTHONPATH. We
;; also need to modify GDK_PIXBUF_MODULE_FILE for SVG support.
(let* ((out (assoc-ref outputs "out"))
(path (getenv "PYTHONPATH"))
(rsvg (assoc-ref inputs "librsvg"))
(pixbuf (find-files rsvg "^loaders\\.cache$")))
(wrap-program (string-append out "/bin/solfege")
`("PYTHONPATH" ":" prefix (,path))
`("GDK_PIXBUF_MODULE_FILE" ":" prefix ,pixbuf))))
`(("python" ,python-2)
("pygtk" ,python2-pygtk)
("gettext" ,gnu-gettext)
("gtk" ,gtk+)
;; TODO: Lilypond is optional. Produces errors at build time:
;; Drawing systems...Error: /undefinedresult in --glyphshow--
;; Fontconfig is needed to fix one of the errors, but other similar
;; errors remain.
;;("lilypond" ,lilypond)
("librsvg" ,librsvg) ; needed at runtime for icons
("libpng" ,libpng) ; needed at runtime for icons
;; players needed at runtime
("aplay" ,alsa-utils)
("csound" ,csound) ; optional, needed for some exercises
("mpg123" ,mpg123)
("ogg123" ,vorbis-tools)
("timidity" ,timidity++)))
`(("pkg-config" ,pkg-config)
("txt2man" ,txt2man)
("libxml2" ,libxml2) ; for tests
("ghostscript" ,ghostscript)
;;("fontconfig" ,fontconfig) ; only needed with lilypond
;;("freetype" ,freetype) ; only needed with lilypond
("texinfo" ,texinfo)))
(home-page "")
(synopsis "Ear training")
"GNU Solfege is a program for practicing musical ear-training. With it,
you can practice your recognition of various musical intervals and chords. It
features a statistics overview so you can monitor your progress across several
sessions. Solfege is also designed to be extensible so you can easily write
your own lessons.")
(license license:gpl3+)))
(define-public powertabeditor
(name "powertabeditor")
(version "2.0.0-alpha7")
(source (origin
(method url-fetch)
(uri (string-append
version ".tar.gz"))
(file-name (string-append name "-" version ".tar.gz"))
(modules '((guix build utils)))
;; Remove bundled sources for external libraries
(delete-file-recursively "external")
(substitute* "CMakeLists.txt"
(("include_directories\\(\\$\\{PROJECT_SOURCE_DIR\\}/external/.*") "")
;; TODO: tests cannot be built:
;; test/test_main.cpp:28:12: error: ‘Session’ is not a member of ‘Catch’
(("add_subdirectory\\(test\\)") "")
(("add_subdirectory\\(external\\)") ""))
(substitute* "test/CMakeLists.txt"
(("include_directories\\(\\$\\{PROJECT_SOURCE_DIR\\}/external/.*") ""))
;; Add install target
(substitute* "source/CMakeLists.txt"
"install(TARGETS powertabeditor "
"install(FILES data/tunings.json DESTINATION "
(build-system cmake-build-system)
`(#:tests? #f ; no "check" target
#:modules ((guix build cmake-build-system)
(guix build utils)
(ice-9 match))
;; CMake appears to lose the RUNPATH for some reason, so it has to be
;; explicitly set with CMAKE_INSTALL_RPATH.
(list (string-append "-DCMAKE_INSTALL_RPATH="
(string-join (map (match-lambda
((name . directory)
(string-append directory "/lib")))
%build-inputs) ";")))
(modify-phases %standard-phases
'configure 'remove-third-party-libs
(lambda* (#:key inputs #:allow-other-keys)
;; Link with required static libraries, because we're not
;; using the bundled version of withershins.
(substitute* '("source/CMakeLists.txt"
(("target_link_libraries\\((powertabeditor)" _ target)
(string-append "target_link_libraries(" target " "
(assoc-ref inputs "binutils")
"/lib/libbfd.a "
(assoc-ref inputs "gcc")
"/lib/libiberty.a "
`(("boost" ,boost)
("alsa-lib" ,alsa-lib)
("qt" ,qt)
("withershins" ,withershins)
("gcc" ,gcc-4.8 "lib") ;for libiberty.a (for withershins)
("binutils" ,binutils) ;for -lbfd and -liberty (for withershins)
("timidity" ,timidity++)
("pugixml" ,pugixml)
("rtmidi" ,rtmidi)
("rapidjson" ,rapidjson)
("zlib" ,zlib)))
`(("catch" ,catch-framework)
("pkg-config" ,pkg-config)))
(home-page "")
(synopsis "Guitar tablature editor")
"Power Tab Editor 2.0 is the successor to the famous original Power Tab
Editor. It is compatible with Power Tab Editor 1.7 and Guitar Pro.")
(license license:gpl3+)))
(define-public tuxguitar
(name "tuxguitar")
(version "1.2")
(source (origin
(method url-fetch)
(uri (string-append
version "/tuxguitar-src-" version ".tar.gz"))
(build-system gnu-build-system)
`(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
(assoc-ref %outputs "out") "/lib")
(string-append "PREFIX="
(assoc-ref %outputs "out"))
(string-append "SWT_PATH="
(assoc-ref %build-inputs "swt")
#:tests? #f ;no "check" target
#:parallel-build? #f ;not supported
'build 'enter-dir-set-path-and-pass-ldflags
(lambda* (#:key inputs #:allow-other-keys)
(chdir "TuxGuitar")
(substitute* "GNUmakefile"
(string-append "PROPERTIES?= -Dswt.library.path="
(assoc-ref inputs "swt") "/lib"))
(("\\$\\(GCJ\\) -o") "$(GCJ) $(LDFLAGS) -o"))
(alist-delete 'configure %standard-phases))))
`(("swt" ,swt)))
`(("gcj" ,gcj-4.8)
("pkg-config" ,pkg-config)))
(home-page "")
(synopsis "Multitrack tablature editor and player")
"TuxGuitar is a guitar tablature editor with player support through midi.
It can display scores and multitrack tabs. TuxGuitar provides various
additional features, including autoscrolling while playing, note duration
management, bend/slide/vibrato/hammer-on/pull-off effects, support for
tuplets, time signature management, tempo management, gp3/gp4/gp5 import and
(license license:lgpl2.1+)))