2018-07-21 02:44:44 +02:00
|
|
|
{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, glib, systemd, boost, darwin
|
2013-01-18 12:01:14 +01:00
|
|
|
, alsaSupport ? true, alsaLib
|
2017-02-16 01:17:31 +01:00
|
|
|
, avahiSupport ? true, avahi, dbus
|
2013-01-18 12:01:14 +01:00
|
|
|
, 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
|
|
|
|
, 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 17:07:46 +02:00
|
|
|
, aacSupport ? true, faad2
|
2017-08-09 12:27:03 +02:00
|
|
|
, lameSupport ? true, lame
|
2015-05-27 21:42:15 +02:00
|
|
|
, pulseaudioSupport ? true, libpulseaudio
|
2015-06-27 09:17:52 +02:00
|
|
|
, jackSupport ? true, libjack2
|
2014-12-22 07:49:34 +01:00
|
|
|
, gmeSupport ? true, game-music-emu
|
2014-10-19 18:34:03 +02:00
|
|
|
, icuSupport ? true, icu
|
2015-12-04 17:09:10 +01:00
|
|
|
, clientSupport ? true, mpd_clientlib
|
2015-04-17 17:37:35 +02:00
|
|
|
, opusSupport ? true, libopus
|
2016-05-12 22:35:13 +02:00
|
|
|
, soundcloudSupport ? true, yajl
|
2018-07-21 22:32:20 +02:00
|
|
|
, nfsSupport ? true, libnfs
|
2018-08-06 10:07:20 +02:00
|
|
|
, smbSupport ? true, samba
|
2014-06-01 17:07:46 +02:00
|
|
|
}:
|
2013-01-18 12:01:14 +01:00
|
|
|
|
2017-02-16 01:17:31 +01:00
|
|
|
assert avahiSupport -> avahi != null && dbus != null;
|
|
|
|
|
2010-04-18 21:26:30 +02:00
|
|
|
let
|
2015-06-01 21:29:47 +02:00
|
|
|
opt = stdenv.lib.optional;
|
|
|
|
mkFlag = c: f: if c then "--enable-${f}" else "--disable-${f}";
|
2017-01-06 11:37:42 +01:00
|
|
|
major = "0.20";
|
2018-12-01 02:21:27 +01:00
|
|
|
minor = "23";
|
2015-06-01 21:29:47 +02:00
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2017-06-09 06:04:23 +02:00
|
|
|
name = "mpd-${version}";
|
|
|
|
version = "${major}${if minor == "" then "" else "." + minor}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "MusicPlayerDaemon";
|
|
|
|
repo = "MPD";
|
|
|
|
rev = "v${version}";
|
2018-12-01 02:21:27 +01:00
|
|
|
sha256 = "1z1pdgiddimnmck0ardrpxkvgk1wn9zxri5wfv5ppasbb7kfm350";
|
2010-04-18 21:26:30 +02:00
|
|
|
};
|
2012-10-25 03:15:48 +02:00
|
|
|
|
2017-03-23 22:57:51 +01:00
|
|
|
patches = [ ./x86.patch ];
|
|
|
|
|
2017-06-09 06:04:23 +02:00
|
|
|
buildInputs = [ glib boost ]
|
2016-09-13 18:02:20 +02:00
|
|
|
++ opt stdenv.isDarwin darwin.apple_sdk.frameworks.CoreAudioKit
|
2013-10-08 11:05:19 +02:00
|
|
|
++ opt stdenv.isLinux systemd
|
|
|
|
++ opt (stdenv.isLinux && alsaSupport) alsaLib
|
2017-02-16 01:17:31 +01:00
|
|
|
++ opt avahiSupport avahi
|
|
|
|
++ opt avahiSupport dbus
|
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 bzip2Support bzip2
|
|
|
|
++ opt audiofileSupport audiofile
|
|
|
|
++ opt ffmpegSupport ffmpeg
|
|
|
|
++ opt fluidsynthSupport fluidsynth
|
|
|
|
++ opt samplerateSupport libsamplerate
|
|
|
|
++ opt mmsSupport libmms
|
|
|
|
++ opt mpg123Support mpg123
|
|
|
|
++ opt aacSupport faad2
|
2017-08-09 12:27:03 +02:00
|
|
|
++ opt lameSupport lame
|
2014-06-01 17:07:46 +02:00
|
|
|
++ opt zipSupport zziplib
|
2015-07-19 16:13:01 +02:00
|
|
|
++ opt (!stdenv.isDarwin && pulseaudioSupport) libpulseaudio
|
|
|
|
++ opt (!stdenv.isDarwin && jackSupport) libjack2
|
2014-12-22 07:49:34 +01:00
|
|
|
++ opt gmeSupport game-music-emu
|
2015-04-17 17:37:35 +02:00
|
|
|
++ opt icuSupport icu
|
|
|
|
++ opt clientSupport mpd_clientlib
|
2016-05-12 22:35:13 +02:00
|
|
|
++ opt opusSupport libopus
|
2018-07-21 22:32:20 +02:00
|
|
|
++ opt soundcloudSupport yajl
|
2018-07-21 23:19:34 +02:00
|
|
|
++ opt (!stdenv.isDarwin && nfsSupport) libnfs
|
2018-08-06 10:07:20 +02:00
|
|
|
++ opt (!stdenv.isDarwin && smbSupport) samba;
|
2013-01-18 12:01:14 +01:00
|
|
|
|
2017-06-09 06:04:23 +02:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkgconfig ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2013-07-04 07:07:37 +02:00
|
|
|
configureFlags =
|
2015-06-01 21:29:47 +02: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")
|
2017-08-09 12:27:03 +02:00
|
|
|
(mkFlag lameSupport "lame-encoder")
|
2015-07-19 16:13:01 +02:00
|
|
|
(mkFlag (!stdenv.isDarwin && pulseaudioSupport) "pulse")
|
|
|
|
(mkFlag (!stdenv.isDarwin && jackSupport) "jack")
|
2015-06-01 21:29:47 +02:00
|
|
|
(mkFlag stdenv.isDarwin "osx")
|
|
|
|
(mkFlag icuSupport "icu")
|
|
|
|
(mkFlag gmeSupport "gme")
|
|
|
|
(mkFlag clientSupport "libmpdclient")
|
|
|
|
(mkFlag opusSupport "opus")
|
2016-05-12 22:35:13 +02:00
|
|
|
(mkFlag soundcloudSupport "soundcloud")
|
2018-07-21 23:19:34 +02:00
|
|
|
(mkFlag (!stdenv.isDarwin && nfsSupport) "libnfs")
|
|
|
|
(mkFlag (!stdenv.isDarwin && smbSupport) "smbclient")
|
2015-06-01 21:29:47 +02:00
|
|
|
"--enable-debug"
|
2017-02-16 01:17:31 +01:00
|
|
|
"--with-zeroconf=avahi"
|
2014-06-16 22:03:37 +02:00
|
|
|
]
|
2013-10-08 11:05:19 +02:00
|
|
|
++ opt stdenv.isLinux
|
2013-07-04 07:07:37 +02:00
|
|
|
"--with-systemdsystemunitdir=$(out)/etc/systemd/system";
|
2012-10-25 03:15:48 +02:00
|
|
|
|
|
|
|
NIX_LDFLAGS = ''
|
|
|
|
${if shoutSupport then "-lshout" else ""}
|
|
|
|
'';
|
|
|
|
|
2015-06-01 21:29:47 +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;
|
2017-02-02 15:23:56 +01:00
|
|
|
maintainers = with maintainers; [ astsmtl fuuzetsu ehmry fpletz ];
|
2013-07-04 07:07:37 +02:00
|
|
|
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.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|