2013-01-18 12:01:14 +01:00
|
|
|
{ stdenv, fetchurl, pkgconfig, glib, systemd
|
|
|
|
, alsaSupport ? true, alsaLib
|
|
|
|
, flacSupport ? true, flac
|
|
|
|
, vorbisSupport ? true, libvorbis
|
|
|
|
, madSupport ? true, libmad
|
|
|
|
, id3tagSupport ? true, libid3tag
|
|
|
|
, mikmodSupport ? true, libmikmod
|
2012-10-25 03:15:48 +02:00
|
|
|
, shoutSupport ? true, libshout
|
2013-01-18 12:01:14 +01:00
|
|
|
, sqliteSupport ? true, sqlite
|
|
|
|
, curlSupport ? true, curl
|
|
|
|
, soupSupport ? true, libsoup
|
|
|
|
, audiofileSupport ? true, audiofile
|
|
|
|
, bzip2Support ? true, bzip2
|
|
|
|
, ffadoSupport ? true, ffado
|
|
|
|
, ffmpegSupport ? true, ffmpeg
|
|
|
|
, fluidsynthSupport ? true, fluidsynth
|
|
|
|
, zipSupport ? true, zziplib
|
|
|
|
, samplerateSupport ? true, libsamplerate
|
|
|
|
, mmsSupport ? true, libmms
|
|
|
|
, mpg123Support ? true, mpg123
|
2013-07-04 07:07:37 +02:00
|
|
|
, aacSupport ? true, faad2 }:
|
2013-01-18 12:01:14 +01:00
|
|
|
|
2010-04-18 21:26:30 +02:00
|
|
|
let
|
2013-01-18 12:01:14 +01:00
|
|
|
|
2010-04-18 21:26:30 +02:00
|
|
|
opt = stdenv.lib.optional;
|
2013-01-18 12:01:14 +01:00
|
|
|
|
|
|
|
mkFlag = c: f: if c then "--enable-${f}" else "--disable-${f}";
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2013-07-04 07:07:37 +02:00
|
|
|
name = "mpd-0.17.4";
|
2010-04-18 21:26:30 +02:00
|
|
|
src = fetchurl {
|
2013-07-04 07:07:37 +02:00
|
|
|
url = "http://www.musicpd.org/download/mpd/stable/${name}.tar.gz";
|
|
|
|
sha256 = "06diyprg65xx0c0bgxdwlgrc5bhwy6cf39rabwnv9ikhimh94ir3";
|
2010-04-18 21:26:30 +02:00
|
|
|
};
|
2012-10-25 03:15:48 +02:00
|
|
|
|
2013-07-04 07:07:37 +02:00
|
|
|
buildInputs = [ pkgconfig glib ]
|
|
|
|
++ opt (!stdenv.isDarwin) systemd
|
|
|
|
++ opt (!stdenv.isDarwin && alsaSupport) alsaLib
|
2010-04-18 21:26:30 +02:00
|
|
|
++ opt flacSupport flac
|
|
|
|
++ opt vorbisSupport libvorbis
|
2013-07-04 07:07:37 +02: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 21:26:30 +02:00
|
|
|
++ opt id3tagSupport libid3tag
|
|
|
|
++ opt mikmodSupport libmikmod
|
2013-01-18 12:01:14 +01:00
|
|
|
++ opt shoutSupport libshout
|
|
|
|
++ opt sqliteSupport sqlite
|
|
|
|
++ opt curlSupport curl
|
|
|
|
++ opt soupSupport libsoup
|
|
|
|
++ opt bzip2Support bzip2
|
|
|
|
++ opt audiofileSupport audiofile
|
2013-07-04 07:07:37 +02:00
|
|
|
++ opt (!stdenv.isDarwin && ffadoSupport) ffado
|
2013-01-18 12:01:14 +01:00
|
|
|
++ opt ffmpegSupport ffmpeg
|
|
|
|
++ opt fluidsynthSupport fluidsynth
|
|
|
|
++ opt samplerateSupport libsamplerate
|
|
|
|
++ opt mmsSupport libmms
|
|
|
|
++ opt mpg123Support mpg123
|
|
|
|
++ opt aacSupport faad2
|
|
|
|
++ opt zipSupport zziplib;
|
|
|
|
|
2013-07-04 07:07:37 +02:00
|
|
|
configureFlags =
|
|
|
|
[ (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 soupSupport "soup")
|
|
|
|
(mkFlag audiofileSupport "audiofile")
|
|
|
|
(mkFlag bzip2Support "bzip2")
|
|
|
|
(mkFlag (!stdenv.isDarwin && ffadoSupport) "ffado")
|
|
|
|
(mkFlag ffmpegSupport "ffmpeg")
|
|
|
|
(mkFlag fluidsynthSupport "fluidsynth")
|
|
|
|
(mkFlag zipSupport "zzip")
|
|
|
|
(mkFlag samplerateSupport "lsr")
|
|
|
|
(mkFlag mmsSupport "mms")
|
|
|
|
(mkFlag mpg123Support "mpg123")
|
|
|
|
(mkFlag aacSupport "aac")
|
|
|
|
"--enable-debugging" ]
|
|
|
|
++ opt (!stdenv.isDarwin)
|
|
|
|
"--with-systemdsystemunitdir=$(out)/etc/systemd/system";
|
2012-10-25 03:15:48 +02:00
|
|
|
|
|
|
|
NIX_LDFLAGS = ''
|
|
|
|
${if shoutSupport then "-lshout" else ""}
|
|
|
|
'';
|
|
|
|
|
2013-07-04 07:07:37 +02:00
|
|
|
meta = with stdenv.lib; {
|
2010-04-18 21:26:30 +02:00
|
|
|
description = "A flexible, powerful daemon for playing music";
|
2013-07-04 07:07:37 +02:00
|
|
|
homepage = http://mpd.wikia.com/wiki/Music_Player_Daemon_Wiki;
|
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = with maintainers; [ astsmtl ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
|
2010-04-18 21:26:30 +02: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.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|