2014-10-19 20:34:03 +04:00
|
|
|
{ stdenv, fetchurl, pkgconfig, glib, systemd, boost
|
2013-01-18 15:01:14 +04:00
|
|
|
, alsaSupport ? true, alsaLib
|
|
|
|
, flacSupport ? true, flac
|
|
|
|
, vorbisSupport ? true, libvorbis
|
|
|
|
, madSupport ? true, libmad
|
|
|
|
, id3tagSupport ? true, libid3tag
|
|
|
|
, mikmodSupport ? true, libmikmod
|
2012-10-25 05:15:48 +04:00
|
|
|
, shoutSupport ? true, libshout
|
2013-01-18 15:01:14 +04:00
|
|
|
, sqliteSupport ? true, sqlite
|
|
|
|
, curlSupport ? true, curl
|
|
|
|
, audiofileSupport ? true, audiofile
|
|
|
|
, bzip2Support ? true, bzip2
|
|
|
|
, ffmpegSupport ? true, ffmpeg
|
|
|
|
, fluidsynthSupport ? true, fluidsynth
|
|
|
|
, zipSupport ? true, zziplib
|
|
|
|
, samplerateSupport ? true, libsamplerate
|
|
|
|
, mmsSupport ? true, libmms
|
|
|
|
, mpg123Support ? true, mpg123
|
2014-06-01 19:07:46 +04:00
|
|
|
, aacSupport ? true, faad2
|
2015-05-27 22:42:15 +03:00
|
|
|
, pulseaudioSupport ? true, libpulseaudio
|
2015-06-27 10:17:52 +03:00
|
|
|
, jackSupport ? true, libjack2
|
2014-12-22 09:49:34 +03:00
|
|
|
, gmeSupport ? true, game-music-emu
|
2014-10-19 20:34:03 +04:00
|
|
|
, icuSupport ? true, icu
|
2015-04-17 18:37:35 +03:00
|
|
|
, clientSupport ? false, mpd_clientlib
|
|
|
|
, opusSupport ? true, libopus
|
2014-06-01 19:07:46 +04:00
|
|
|
}:
|
2013-01-18 15:01:14 +04:00
|
|
|
|
2010-04-18 23:26:30 +04:00
|
|
|
let
|
2015-06-01 22:29:47 +03:00
|
|
|
opt = stdenv.lib.optional;
|
|
|
|
mkFlag = c: f: if c then "--enable-${f}" else "--disable-${f}";
|
2014-10-19 20:34:03 +04:00
|
|
|
major = "0.19";
|
2015-02-09 14:49:12 +03:00
|
|
|
minor = "9";
|
2015-06-01 22:29:47 +03:00
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2014-10-19 20:34:03 +04:00
|
|
|
name = "mpd-${major}.${minor}";
|
2010-04-18 23:26:30 +04:00
|
|
|
src = fetchurl {
|
2015-04-17 18:37:35 +03:00
|
|
|
url = "http://www.musicpd.org/download/mpd/${major}/${name}.tar.xz";
|
|
|
|
sha256 = "0vzj365s4j0pw5w37lfhx3dmpkdp85driravsvx8rlrw0lii91a7";
|
2010-04-18 23:26:30 +04:00
|
|
|
};
|
2012-10-25 05:15:48 +04:00
|
|
|
|
2014-10-19 20:34:03 +04:00
|
|
|
buildInputs = [ pkgconfig glib boost ]
|
2013-10-08 13:05:19 +04:00
|
|
|
++ opt stdenv.isLinux systemd
|
|
|
|
++ opt (stdenv.isLinux && alsaSupport) alsaLib
|
2010-04-18 23:26:30 +04:00
|
|
|
++ opt flacSupport flac
|
|
|
|
++ opt vorbisSupport libvorbis
|
2013-07-04 09:07:37 +04:00
|
|
|
# using libmad to decode mp3 files on darwin is causing a segfault -- there
|
|
|
|
# is probably a solution, but I'm disabling it for now
|
|
|
|
++ opt (!stdenv.isDarwin && madSupport) libmad
|
2010-04-18 23:26:30 +04:00
|
|
|
++ opt id3tagSupport libid3tag
|
|
|
|
++ opt mikmodSupport libmikmod
|
2013-01-18 15:01:14 +04:00
|
|
|
++ opt shoutSupport libshout
|
|
|
|
++ opt sqliteSupport sqlite
|
|
|
|
++ opt curlSupport curl
|
|
|
|
++ opt bzip2Support bzip2
|
|
|
|
++ opt audiofileSupport audiofile
|
|
|
|
++ opt ffmpegSupport ffmpeg
|
|
|
|
++ opt fluidsynthSupport fluidsynth
|
|
|
|
++ opt samplerateSupport libsamplerate
|
|
|
|
++ opt mmsSupport libmms
|
|
|
|
++ opt mpg123Support mpg123
|
|
|
|
++ opt aacSupport faad2
|
2014-06-01 19:07:46 +04:00
|
|
|
++ opt zipSupport zziplib
|
2015-05-27 22:42:15 +03:00
|
|
|
++ opt pulseaudioSupport libpulseaudio
|
2015-06-27 10:17:52 +03:00
|
|
|
++ opt jackSupport libjack2
|
2014-12-22 09:49:34 +03:00
|
|
|
++ opt gmeSupport game-music-emu
|
2015-04-17 18:37:35 +03:00
|
|
|
++ opt icuSupport icu
|
|
|
|
++ opt clientSupport mpd_clientlib
|
|
|
|
++ opt opusSupport libopus;
|
2013-01-18 15:01:14 +04:00
|
|
|
|
2013-07-04 09:07:37 +04:00
|
|
|
configureFlags =
|
2015-06-01 22:29:47 +03:00
|
|
|
[ (mkFlag (!stdenv.isDarwin && alsaSupport) "alsa")
|
|
|
|
(mkFlag flacSupport "flac")
|
|
|
|
(mkFlag vorbisSupport "vorbis")
|
|
|
|
(mkFlag vorbisSupport "vorbis-encoder")
|
|
|
|
(mkFlag (!stdenv.isDarwin && madSupport) "mad")
|
|
|
|
(mkFlag mikmodSupport "mikmod")
|
|
|
|
(mkFlag id3tagSupport "id3")
|
|
|
|
(mkFlag shoutSupport "shout")
|
|
|
|
(mkFlag sqliteSupport "sqlite")
|
|
|
|
(mkFlag curlSupport "curl")
|
|
|
|
(mkFlag audiofileSupport "audiofile")
|
|
|
|
(mkFlag bzip2Support "bzip2")
|
|
|
|
(mkFlag ffmpegSupport "ffmpeg")
|
|
|
|
(mkFlag fluidsynthSupport "fluidsynth")
|
|
|
|
(mkFlag zipSupport "zzip")
|
|
|
|
(mkFlag samplerateSupport "lsr")
|
|
|
|
(mkFlag mmsSupport "mms")
|
|
|
|
(mkFlag mpg123Support "mpg123")
|
|
|
|
(mkFlag aacSupport "aac")
|
|
|
|
(mkFlag pulseaudioSupport "pulse")
|
|
|
|
(mkFlag jackSupport "jack")
|
|
|
|
(mkFlag stdenv.isDarwin "osx")
|
|
|
|
(mkFlag icuSupport "icu")
|
|
|
|
(mkFlag gmeSupport "gme")
|
|
|
|
(mkFlag clientSupport "libmpdclient")
|
|
|
|
(mkFlag opusSupport "opus")
|
|
|
|
"--enable-debug"
|
2014-06-17 00:03:37 +04:00
|
|
|
]
|
2013-10-08 13:05:19 +04:00
|
|
|
++ opt stdenv.isLinux
|
2013-07-04 09:07:37 +04:00
|
|
|
"--with-systemdsystemunitdir=$(out)/etc/systemd/system";
|
2012-10-25 05:15:48 +04:00
|
|
|
|
|
|
|
NIX_LDFLAGS = ''
|
|
|
|
${if shoutSupport then "-lshout" else ""}
|
|
|
|
'';
|
|
|
|
|
2015-06-01 22:29:47 +03:00
|
|
|
meta = with stdenv.lib; {
|
2010-04-18 23:26:30 +04:00
|
|
|
description = "A flexible, powerful daemon for playing music";
|
2013-07-04 09:07:37 +04:00
|
|
|
homepage = http://mpd.wikia.com/wiki/Music_Player_Daemon_Wiki;
|
|
|
|
license = licenses.gpl2;
|
2015-04-17 18:37:35 +03:00
|
|
|
maintainers = with maintainers; [ astsmtl fuuzetsu emery ];
|
2013-07-04 09:07:37 +04:00
|
|
|
platforms = platforms.unix;
|
|
|
|
|
2010-04-18 23:26:30 +04:00
|
|
|
longDescription = ''
|
|
|
|
Music Player Daemon (MPD) is a flexible, powerful daemon for playing
|
|
|
|
music. Through plugins and libraries it can play a variety of sound
|
|
|
|
files while being controlled by its network protocol.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|