gnu: ncmpc: Fix manual install.
[jackhill/guix/guix.git] / gnu / packages / mpd.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2015 David Thompson <dthompson2@worcester.edu>
3 ;;; Copyright © 2014 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2014 Cyrill Schenkel <cyrill.schenkel@gmail.com>
5 ;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
6 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
7 ;;; Copyright © 2016, 2018, 2019 Leo Famulari <leo@famulari.name>
8 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;;
10 ;;; This file is part of GNU Guix.
11 ;;;
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
16 ;;;
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
21 ;;;
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25 (define-module (gnu packages mpd)
26 #:use-module (gnu packages)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (guix packages)
29 #:use-module (guix download)
30 #:use-module (guix utils)
31 #:use-module (guix build-system gnu)
32 #:use-module (guix build-system meson)
33 #:use-module (guix build-system python)
34 #:use-module (gnu packages avahi)
35 #:use-module (gnu packages boost)
36 #:use-module (gnu packages gcc)
37 #:use-module (gnu packages gettext)
38 #:use-module (gnu packages gnome)
39 #:use-module (gnu packages gtk)
40 #:use-module (gnu packages icu4c)
41 #:use-module (gnu packages readline)
42 #:use-module (gnu packages check)
43 #:use-module (gnu packages compression)
44 #:use-module (gnu packages curl)
45 #:use-module (gnu packages documentation)
46 #:use-module (gnu packages glib)
47 #:use-module (gnu packages linux)
48 #:use-module (gnu packages mp3)
49 #:use-module (gnu packages ncurses)
50 #:use-module (gnu packages pcre)
51 #:use-module (gnu packages pkg-config)
52 #:use-module (gnu packages python)
53 #:use-module (gnu packages pulseaudio)
54 #:use-module (gnu packages sphinx)
55 #:use-module (gnu packages sqlite)
56 #:use-module (gnu packages video)
57 #:use-module (gnu packages xiph))
58
59 (define-public libmpdclient
60 (package
61 (name "libmpdclient")
62 (version "2.16")
63 (source (origin
64 (method url-fetch)
65 (uri
66 (string-append "https://musicpd.org/download/libmpdclient/"
67 (car (string-split version #\.))
68 "/libmpdclient-" version ".tar.xz"))
69 (sha256
70 (base32
71 "0r24cl3i9nvs6a47mvwaxk1kb5wmnhkhrw1q5cq9010fgjvdlszs"))))
72 (build-system meson-build-system)
73 (native-inputs
74 `(("pkg-config" ,pkg-config)
75
76 ;; For building HTML documentation.
77 ("doxygen" ,doxygen)
78
79 ;; For tests.
80 ("check" ,check)))
81 (arguments
82 `(#:configure-flags
83 (list "-Ddocumentation=true"
84 "-Dtest=true")))
85 (synopsis "Music Player Daemon client library")
86 (description "A stable, documented, asynchronous API library for
87 interfacing MPD in the C, C++ & Objective C languages.")
88 (home-page "https://www.musicpd.org/libs/libmpdclient/")
89 (license license:bsd-3)))
90
91 (define-public mpd
92 (package
93 (name "mpd")
94 (version "0.21.14")
95 (source (origin
96 (method url-fetch)
97 (uri
98 (string-append "https://musicpd.org/download/mpd/"
99 (version-major+minor version)
100 "/mpd-" version ".tar.xz"))
101 (sha256
102 (base32
103 "0iknnm9xvwfgk8h82hjwrmbijpk9l0dgap0794c2nyg8i66qlb0y"))))
104 (build-system meson-build-system)
105 (arguments
106 `(#:configure-flags '("-Ddocumentation=true") ; the default is 'false'...
107 #:phases
108 (modify-phases %standard-phases
109 (add-before 'configure 'expand-C++-include-path
110 ;; Make <gcc>/include/c++/ext/string_conversions.h find <stdlib.h>.
111 (lambda* (#:key inputs #:allow-other-keys)
112 (let* ((path "CPLUS_INCLUDE_PATH")
113 (gcc (assoc-ref inputs "gcc"))
114 (c++ (string-append gcc "/include/c++")))
115 (setenv path (string-append c++ ":" (getenv path)))
116 #t))))))
117 (inputs `(("ao" ,ao)
118 ("alsa-lib" ,alsa-lib)
119 ("avahi" ,avahi)
120 ("boost" ,boost)
121 ("curl" ,curl)
122 ("ffmpeg" ,ffmpeg)
123 ("flac" ,flac)
124 ("glib" ,glib)
125 ("icu4c" ,icu4c)
126 ;; The LAME decoder comes from FFmpeg, but is added here so that
127 ;; configure picks up the LAME encoder.
128 ("lame" ,lame)
129 ("libid3tag" ,libid3tag)
130 ("libmpdclient" ,libmpdclient)
131 ("libsamplerate" ,libsamplerate)
132 ("libsndfile" ,libsndfile)
133 ("libvorbis" ,libvorbis)
134 ("opus" ,opus)
135 ("pulseaudio" ,pulseaudio)
136 ("sqlite" ,sqlite)
137 ("zlib" ,zlib)))
138 ;; MPD > 0.21 requires > GCC 6
139 (native-inputs `(("gcc" ,gcc-8)
140 ("gcc-lib" ,gcc-8 "lib")
141 ("pkg-config" ,pkg-config)
142 ("python-sphinx" ,python-sphinx)))
143 ;; Missing optional inputs:
144 ;; libyajl
145 ;; libcdio_paranoia
146 ;; libmms
147 ;; libadplug
148 ;; libaudiofile
149 ;; faad2
150 ;; fluidsynth
151 ;; libgme
152 ;; libshout
153 ;; libmpg123
154 ;; libmodplug
155 ;; libmpcdec
156 ;; libsidplay2
157 ;; libwavpack
158 ;; libwildmidi
159 ;; libtwolame
160 ;; libroar
161 ;; libjack
162 ;; OpenAL
163 (synopsis "Music Player Daemon")
164 (description "Music Player Daemon (MPD) is a flexible, powerful,
165 server-side application for playing music. Through plugins and libraries it
166 can play a variety of sound files while being controlled by its network
167 protocol.")
168 (home-page "https://www.musicpd.org/")
169 (license license:gpl2)))
170
171 (define-public mpd-mpc
172 (package
173 (name "mpd-mpc")
174 (version "0.32")
175 (source (origin
176 (method url-fetch)
177 (uri
178 (string-append "https://www.musicpd.org/download/mpc/"
179 (car (string-split version #\.))
180 "/mpc-" version ".tar.xz"))
181 (sha256
182 (base32
183 "1irilgz64pny7b8zygy5i74nfmlhgsawz0djx9mrj6g0gidxjqbr"))))
184 (build-system meson-build-system)
185 (inputs `(("libmpdclient" ,libmpdclient)))
186 (native-inputs
187 `(("pkg-config" ,pkg-config)
188 ("python-sphinx" ,python-sphinx)))
189 (synopsis "Music Player Daemon client")
190 (description "MPC is a minimalist command line interface to MPD, the music
191 player daemon.")
192 (home-page "https://www.musicpd.org/clients/mpc/")
193 (license license:gpl2)))
194
195 (define-public ncmpc
196 (package
197 (name "ncmpc")
198 (version "0.35")
199 (source (origin
200 (method url-fetch)
201 (uri
202 (string-append "http://musicpd.org/download/ncmpc/"
203 (version-major version)
204 "/ncmpc-" version ".tar.xz"))
205 (sha256
206 (base32
207 "0hfjvm1p0z7x6gfn5xhl5c0jsmidvz0qfl04pq45x4chh9iiwkxx"))))
208 (build-system meson-build-system)
209 (arguments
210 `(#:phases
211 (modify-phases %standard-phases
212 (add-before 'configure 'expand-C++-include-path
213 ;; Make <gcc>/include/c++/ext/string_conversions.h find <stdlib.h>.
214 (lambda* (#:key inputs #:allow-other-keys)
215 (let* ((path "CPLUS_INCLUDE_PATH")
216 (gcc (assoc-ref inputs "gcc"))
217 (c++ (string-append gcc "/include/c++")))
218 (setenv path (string-append c++ ":" (getenv path)))
219 #t))))))
220 (inputs `(("gcc" ,gcc-8) ; for its C++14 support
221 ("boost" ,boost)
222 ("pcre" ,pcre)
223 ("libmpdclient" ,libmpdclient)
224 ("ncurses" ,ncurses)))
225 (native-inputs `(("gettext" ,gettext-minimal) ; for xgettext
226 ("pkg-config" ,pkg-config)
227 ("python-sphinx" ,python-sphinx)))
228 (synopsis "Curses Music Player Daemon client")
229 (description "ncmpc is a fully featured MPD client, which runs in a
230 terminal using ncurses.")
231 (home-page "https://www.musicpd.org/clients/ncmpc/")
232 (license license:gpl2)))
233
234 (define-public ncmpcpp
235 (package
236 (name "ncmpcpp")
237 (version "0.8.2")
238 (source (origin
239 (method url-fetch)
240 (uri
241 (string-append "https://ncmpcpp.rybczak.net/stable/ncmpcpp-"
242 version ".tar.bz2"))
243 (sha256
244 (base32
245 "0m0mjb049sl62vx13h9waavysa30mk0rphacksnvf94n13la62v5"))))
246 (build-system gnu-build-system)
247 (inputs `(("libmpdclient" ,libmpdclient)
248 ("boost" ,boost)
249 ("readline" ,readline)
250 ("ncurses" ,ncurses)
251 ("taglib" ,taglib)
252 ("icu4c" ,icu4c)
253 ("curl" ,curl)))
254 (native-inputs
255 `(("pkg-config" ,pkg-config)))
256 (arguments
257 '(#:configure-flags
258 '("BOOST_LIB_SUFFIX=" "--with-taglib")))
259 (synopsis "Featureful ncurses based MPD client inspired by ncmpc")
260 (description "Ncmpcpp is an mpd client with a UI very similar to ncmpc,
261 but it provides new useful features such as support for regular expressions
262 for library searches, extended song format, items filtering, the ability to
263 sort playlists, and a local file system browser.")
264 (home-page "https://ncmpcpp.rybczak.net/")
265 (license license:gpl2+)))
266
267 (define-public mpdscribble
268 (package
269 (name "mpdscribble")
270 (version "0.22")
271 (source (origin
272 (method url-fetch)
273 (uri (string-append "http://www.musicpd.org/download/mpdscribble/"
274 version "/mpdscribble-" version ".tar.gz"))
275 (sha256
276 (base32
277 "0f0ybx380x2z2g1qvdndpvcrhkrgsfqckhz3ryydq2w3pl12v27z"))))
278 (build-system gnu-build-system)
279 (inputs `(("libmpdclient" ,libmpdclient)
280 ("curl" ,curl)
281 ("glib" ,glib)))
282 (native-inputs `(("pkg-config" ,pkg-config)))
283 (synopsis "MPD client for track scrobbling")
284 (description "mpdscribble is a Music Player Daemon client which submits
285 information about tracks being played to a scrobbler, such as Libre.FM.")
286 (home-page "https://www.musicpd.org/clients/mpdscribble/")
287 (license license:gpl2+)))
288
289 (define-public python-mpd2
290 (package
291 (name "python-mpd2")
292 (version "0.5.5")
293 (source (origin
294 (method url-fetch)
295 (uri (pypi-uri "python-mpd2" version))
296 (sha256
297 (base32
298 "0laypd7h1j14b4vrmiayqlzdsh2j5hc3zv4l0fqvbrbw9y6763ii"))))
299 (build-system python-build-system)
300 (arguments
301 '(#:phases
302 (modify-phases %standard-phases
303 (replace 'check
304 (lambda _ (invoke "python" "mpd_test.py"))))))
305 (native-inputs `(("python-mock" ,python-mock)))
306 (home-page "https://github.com/Mic92/python-mpd2")
307 (synopsis "Python MPD client library")
308 (description "Python-mpd2 is a Python library which provides a client
309 interface for the Music Player Daemon.")
310 (license license:lgpl3+)))
311
312 (define-public python2-mpd2
313 (package-with-python2 python-mpd2))
314
315 (define-public sonata
316 (package
317 (name "sonata")
318 (version "1.7b1")
319 (source (origin
320 (method url-fetch)
321 (uri
322 (string-append "https://github.com/multani/sonata/archive/v"
323 version ".tar.gz"))
324 (file-name (string-append name "-" version ".tar.gz"))
325 (sha256
326 (base32
327 "07gq2nxqwxs0qyxjbay7k5j25zd386bn7wdr2dl1gk53diwnn7s0"))))
328 (build-system python-build-system)
329 (arguments
330 `(#:modules ((guix build gnu-build-system)
331 (guix build python-build-system)
332 ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
333 (guix build utils))
334 #:imported-modules (,@%gnu-build-system-modules
335 (guix build python-build-system)
336 (guix build glib-or-gtk-build-system))
337 #:phases
338 (modify-phases %standard-phases
339 (add-after 'install 'glib-or-gtk-wrap
340 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))
341 (add-after 'install 'wrap-sonata
342 (lambda* (#:key outputs #:allow-other-keys)
343 (let ((out (assoc-ref outputs "out"))
344 (gi-typelib-path (getenv "GI_TYPELIB_PATH")))
345 (wrap-program (string-append out "/bin/sonata")
346 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))))
347 #t)))))
348 (native-inputs
349 `(("gettext" ,gettext-minimal)))
350 (inputs
351 `(("python-mpd2" ,python-mpd2)
352 ("gtk+" ,gtk+)
353 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
354 ("gobject-introspection" ,gobject-introspection)
355 ("adwaita-icon-theme" ,adwaita-icon-theme)
356 ("python-pygobject" ,python-pygobject)))
357 (synopsis "Elegant client for the Music Player Daemon")
358 (description "Sonata is an elegant graphical client for the Music Player
359 Daemon (MPD). It supports playlists, multiple profiles (connecting to different
360 MPD servers, search and multimedia key support.")
361 (home-page "https://www.nongnu.org/sonata/")
362 (license license:gpl3+)))