Merge branch 'master' into core-updates
[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 Leo Famulari <leo@famulari.name>
8 ;;; Copyright © 2018 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 databases)
55 #:use-module (gnu packages video)
56 #:use-module (gnu packages xiph))
57
58 (define-public libmpdclient
59 (package
60 (name "libmpdclient")
61 (version "2.16")
62 (source (origin
63 (method url-fetch)
64 (uri
65 (string-append "https://musicpd.org/download/libmpdclient/"
66 (car (string-split version #\.))
67 "/libmpdclient-" version ".tar.xz"))
68 (sha256
69 (base32
70 "0r24cl3i9nvs6a47mvwaxk1kb5wmnhkhrw1q5cq9010fgjvdlszs"))))
71 (build-system meson-build-system)
72 (native-inputs
73 `(("pkg-config" ,pkg-config)
74
75 ;; For building HTML documentation.
76 ("doxygen" ,doxygen)
77
78 ;; For tests.
79 ("check" ,check)))
80 (arguments
81 `(#:configure-flags
82 (list "-Ddocumentation=true"
83 "-Dtest=true")))
84 (synopsis "Music Player Daemon client library")
85 (description "A stable, documented, asynchronous API library for
86 interfacing MPD in the C, C++ & Objective C languages.")
87 (home-page "https://www.musicpd.org/libs/libmpdclient/")
88 (license license:bsd-3)))
89
90 (define-public mpd
91 (package
92 (name "mpd")
93 (version "0.20.21")
94 (source (origin
95 (method url-fetch)
96 (uri
97 (string-append "https://musicpd.org/download/mpd/"
98 (version-major+minor version)
99 "/mpd-" version ".tar.xz"))
100 (sha256
101 (base32
102 "1p2qrhdb1gzfv3y5dvvbc9s2wwmhg3azvzf8r02hzhk5q96pc8l3"))))
103 (build-system gnu-build-system)
104 (arguments
105 `(#:phases
106 (modify-phases %standard-phases
107 (add-after 'install 'install-service-files
108 (lambda* (#:key outputs #:allow-other-keys)
109 (let* ((out (assoc-ref outputs "out"))
110 (systemd (string-append out "/etc/systemd/system"))
111 (systemd-user (string-append out "/etc/systemd/user")))
112 (install-file "systemd/system/mpd.service" systemd)
113 (install-file "systemd/user/mpd.service" systemd-user)
114 #t))))))
115 (inputs `(("ao" ,ao)
116 ("alsa-lib" ,alsa-lib)
117 ("avahi" ,avahi)
118 ("boost" ,boost)
119 ("curl" ,curl)
120 ("ffmpeg" ,ffmpeg)
121 ("flac" ,flac)
122 ("glib" ,glib)
123 ("icu4c" ,icu4c)
124 ;; The LAME decoder comes from FFmpeg, but is added here so that
125 ;; configure picks up the LAME encoder.
126 ("lame" ,lame)
127 ("libid3tag" ,libid3tag)
128 ("libmpdclient" ,libmpdclient)
129 ("libsamplerate" ,libsamplerate)
130 ("libsndfile" ,libsndfile)
131 ("libvorbis" ,libvorbis)
132 ("opus" ,opus)
133 ("pulseaudio" ,pulseaudio)
134 ("sqlite" ,sqlite)
135 ("zlib" ,zlib)))
136 (native-inputs `(("pkg-config" ,pkg-config)))
137 ;; Missing optional inputs:
138 ;; libyajl
139 ;; libcdio_paranoia
140 ;; libmms
141 ;; libadplug
142 ;; libaudiofile
143 ;; faad2
144 ;; fluidsynth
145 ;; libgme
146 ;; libshout
147 ;; libmpg123
148 ;; libmodplug
149 ;; libmpcdec
150 ;; libsidplay2
151 ;; libwavpack
152 ;; libwildmidi
153 ;; libtwolame
154 ;; libroar
155 ;; libjack
156 ;; OpenAL
157 (synopsis "Music Player Daemon")
158 (description "Music Player Daemon (MPD) is a flexible, powerful,
159 server-side application for playing music. Through plugins and libraries it
160 can play a variety of sound files while being controlled by its network
161 protocol.")
162 (home-page "https://www.musicpd.org/")
163 (license license:gpl2)))
164
165 (define-public mpd-mpc
166 (package
167 (name "mpd-mpc")
168 (version "0.30")
169 (source (origin
170 (method url-fetch)
171 (uri
172 (string-append "https://www.musicpd.org/download/mpc/"
173 (car (string-split version #\.))
174 "/mpc-" version ".tar.xz"))
175 (sha256
176 (base32
177 "1kkzhrypkp0v6xv4d6db415pd0h6jqki29kfpsnfkvrhhh55pz35"))))
178 (build-system meson-build-system)
179 (inputs `(("libmpdclient" ,libmpdclient)))
180 (native-inputs `(("pkg-config" ,pkg-config)))
181 (synopsis "Music Player Daemon client")
182 (description "MPC is a minimalist command line interface to MPD, the music
183 player daemon.")
184 (home-page "https://www.musicpd.org/clients/mpc/")
185 (license license:gpl2)))
186
187 (define-public ncmpc
188 (package
189 (name "ncmpc")
190 (version "0.32")
191 (source (origin
192 (method url-fetch)
193 (uri
194 (string-append "http://musicpd.org/download/ncmpc/"
195 (car (string-split version #\.))
196 "/ncmpc-" version ".tar.xz"))
197 (sha256
198 (base32
199 "1b01q1pcaw5yyhvmlffc3h0r3w8qy7rhn55a7xj4qkcfqvs8ap08"))))
200 (build-system meson-build-system)
201 (arguments
202 `(#:configure-flags
203 ;; Otherwise, they are installed incorrectly, in
204 ;; '$out/share/man/man/man1'.
205 (list (string-append "-Dmandir=" (assoc-ref %outputs "out")
206 "/share"))
207 #:phases
208 (modify-phases %standard-phases
209 (add-before 'configure 'expand-C++-include-path
210 ;; Make <gcc>/include/c++/ext/string_conversions.h find <stdlib.h>.
211 (lambda* (#:key inputs #:allow-other-keys)
212 (let* ((path "CPLUS_INCLUDE_PATH")
213 (gcc (assoc-ref inputs "gcc"))
214 (c++ (string-append gcc "/include/c++")))
215 (setenv path (string-append c++ ":" (getenv path)))
216 #t))))))
217 (inputs `(("gcc", gcc-8) ; for its C++14 support
218 ("boost" ,boost)
219 ("pcre" ,pcre)
220 ("libmpdclient" ,libmpdclient)
221 ("ncurses" ,ncurses)))
222 (native-inputs `(("gettext" ,gettext-minimal) ; for xgettext
223 ("pkg-config" ,pkg-config)
224 ("python-sphinx" ,python-sphinx)))
225 (synopsis "Curses Music Player Daemon client")
226 (description "ncmpc is a fully featured MPD client, which runs in a
227 terminal using ncurses.")
228 (home-page "https://www.musicpd.org/clients/ncmpc/")
229 (license license:gpl2)))
230
231 (define-public ncmpcpp
232 (package
233 (name "ncmpcpp")
234 (version "0.8.2")
235 (source (origin
236 (method url-fetch)
237 (uri
238 (string-append "https://ncmpcpp.rybczak.net/stable/ncmpcpp-"
239 version ".tar.bz2"))
240 (sha256
241 (base32
242 "0m0mjb049sl62vx13h9waavysa30mk0rphacksnvf94n13la62v5"))))
243 (build-system gnu-build-system)
244 (inputs `(("libmpdclient" ,libmpdclient)
245 ("boost" ,boost)
246 ("readline" ,readline)
247 ("ncurses" ,ncurses)
248 ("taglib" ,taglib)
249 ("icu4c" ,icu4c)
250 ("curl" ,curl)))
251 (native-inputs
252 `(("pkg-config" ,pkg-config)))
253 (arguments
254 '(#:configure-flags
255 '("BOOST_LIB_SUFFIX=" "--with-taglib")))
256 (synopsis "Featureful ncurses based MPD client inspired by ncmpc")
257 (description "Ncmpcpp is an mpd client with a UI very similar to ncmpc,
258 but it provides new useful features such as support for regular expressions
259 for library searches, extended song format, items filtering, the ability to
260 sort playlists, and a local file system browser.")
261 (home-page "https://ncmpcpp.rybczak.net/")
262 (license license:gpl2+)))
263
264 (define-public mpdscribble
265 (package
266 (name "mpdscribble")
267 (version "0.22")
268 (source (origin
269 (method url-fetch)
270 (uri (string-append "http://www.musicpd.org/download/mpdscribble/"
271 version "/mpdscribble-" version ".tar.gz"))
272 (sha256
273 (base32
274 "0f0ybx380x2z2g1qvdndpvcrhkrgsfqckhz3ryydq2w3pl12v27z"))))
275 (build-system gnu-build-system)
276 (inputs `(("libmpdclient" ,libmpdclient)
277 ("curl" ,curl)
278 ("glib" ,glib)))
279 (native-inputs `(("pkg-config" ,pkg-config)))
280 (synopsis "MPD client for track scrobbling")
281 (description "mpdscribble is a Music Player Daemon client which submits
282 information about tracks being played to a scrobbler, such as Libre.FM.")
283 (home-page "https://www.musicpd.org/clients/mpdscribble/")
284 (license license:gpl2+)))
285
286 (define-public python-mpd2
287 (package
288 (name "python-mpd2")
289 (version "0.5.5")
290 (source (origin
291 (method url-fetch)
292 (uri (pypi-uri "python-mpd2" version))
293 (sha256
294 (base32
295 "0laypd7h1j14b4vrmiayqlzdsh2j5hc3zv4l0fqvbrbw9y6763ii"))))
296 (build-system python-build-system)
297 (arguments
298 '(#:phases
299 (modify-phases %standard-phases
300 (replace 'check
301 (lambda _ (invoke "python" "mpd_test.py"))))))
302 (native-inputs `(("python-mock" ,python-mock)))
303 (home-page "https://github.com/Mic92/python-mpd2")
304 (synopsis "Python MPD client library")
305 (description "Python-mpd2 is a Python library which provides a client
306 interface for the Music Player Daemon.")
307 (license license:lgpl3+)))
308
309 (define-public python2-mpd2
310 (package-with-python2 python-mpd2))
311
312 (define-public sonata
313 (package
314 (name "sonata")
315 (version "1.7b1")
316 (source (origin
317 (method url-fetch)
318 (uri
319 (string-append "https://github.com/multani/sonata/archive/v"
320 version ".tar.gz"))
321 (file-name (string-append name "-" version ".tar.gz"))
322 (sha256
323 (base32
324 "07gq2nxqwxs0qyxjbay7k5j25zd386bn7wdr2dl1gk53diwnn7s0"))))
325 (build-system python-build-system)
326 (arguments
327 `(#:modules ((guix build gnu-build-system)
328 (guix build python-build-system)
329 ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
330 (guix build utils))
331 #:imported-modules (,@%gnu-build-system-modules
332 (guix build python-build-system)
333 (guix build glib-or-gtk-build-system))
334 #:phases
335 (modify-phases %standard-phases
336 (add-after 'install 'glib-or-gtk-wrap
337 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))
338 (add-after 'install 'wrap-sonata
339 (lambda* (#:key outputs #:allow-other-keys)
340 (let ((out (assoc-ref outputs "out"))
341 (gi-typelib-path (getenv "GI_TYPELIB_PATH")))
342 (wrap-program (string-append out "/bin/sonata")
343 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))))
344 #t)))))
345 (native-inputs
346 `(("gettext" ,gettext-minimal)))
347 (inputs
348 `(("python-mpd2" ,python-mpd2)
349 ("gtk+" ,gtk+)
350 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
351 ("gobject-introspection" ,gobject-introspection)
352 ("adwaita-icon-theme" ,adwaita-icon-theme)
353 ("python-pygobject" ,python-pygobject)))
354 (synopsis "Elegant client for the Music Player Daemon")
355 (description "Sonata is an elegant graphical client for the Music Player
356 Daemon (MPD). It supports playlists, multiple profiles (connecting to different
357 MPD servers, search and multimedia key support.")
358 (home-page "https://www.nongnu.org/sonata/")
359 (license license:gpl3+)))