diff options
Diffstat (limited to 'pkgs/servers/mpd')
-rw-r--r-- | pkgs/servers/mpd/default.nix | 16 | ||||
-rw-r--r-- | pkgs/servers/mpd/x86.patch | 12 |
2 files changed, 24 insertions, 4 deletions
diff --git a/pkgs/servers/mpd/default.nix b/pkgs/servers/mpd/default.nix index c07ca6a834207..1883764e24ffc 100644 --- a/pkgs/servers/mpd/default.nix +++ b/pkgs/servers/mpd/default.nix @@ -1,5 +1,6 @@ -{ stdenv, fetchurl, pkgconfig, glib, systemd, boost, darwin +{ stdenv, fetchurl, fetchpatch, pkgconfig, glib, systemd, boost, darwin , alsaSupport ? true, alsaLib +, avahiSupport ? true, avahi, dbus , flacSupport ? true, flac , vorbisSupport ? true, libvorbis , madSupport ? true, libmad @@ -26,23 +27,29 @@ , soundcloudSupport ? true, yajl }: +assert avahiSupport -> avahi != null && dbus != null; + let opt = stdenv.lib.optional; mkFlag = c: f: if c then "--enable-${f}" else "--disable-${f}"; major = "0.20"; - minor = ""; + minor = "6"; in stdenv.mkDerivation rec { name = "mpd-${major}${if minor == "" then "" else "." + minor}"; src = fetchurl { url = "http://www.musicpd.org/download/mpd/${major}/${name}.tar.xz"; - sha256 = "068nxsfkp2ppcjh3fmcbapkiwnjpvkii73bfydpw4bf2yphdvsa8"; + sha256 = "0isbpa79m7zf09w3s1ry638cw96rxasy1ch66zl01k75i48mw1gl"; }; + patches = [ ./x86.patch ]; + buildInputs = [ pkgconfig glib boost ] ++ opt stdenv.isDarwin darwin.apple_sdk.frameworks.CoreAudioKit ++ opt stdenv.isLinux systemd ++ opt (stdenv.isLinux && alsaSupport) alsaLib + ++ opt avahiSupport avahi + ++ opt avahiSupport dbus ++ opt flacSupport flac ++ opt vorbisSupport libvorbis # using libmad to decode mp3 files on darwin is causing a segfault -- there @@ -99,6 +106,7 @@ in stdenv.mkDerivation rec { (mkFlag opusSupport "opus") (mkFlag soundcloudSupport "soundcloud") "--enable-debug" + "--with-zeroconf=avahi" ] ++ opt stdenv.isLinux "--with-systemdsystemunitdir=$(out)/etc/systemd/system"; @@ -111,7 +119,7 @@ in stdenv.mkDerivation rec { description = "A flexible, powerful daemon for playing music"; homepage = http://mpd.wikia.com/wiki/Music_Player_Daemon_Wiki; license = licenses.gpl2; - maintainers = with maintainers; [ astsmtl fuuzetsu ehmry ]; + maintainers = with maintainers; [ astsmtl fuuzetsu ehmry fpletz ]; platforms = platforms.unix; longDescription = '' diff --git a/pkgs/servers/mpd/x86.patch b/pkgs/servers/mpd/x86.patch new file mode 100644 index 0000000000000..3e4c036418d25 --- /dev/null +++ b/pkgs/servers/mpd/x86.patch @@ -0,0 +1,12 @@ +--- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx ++++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx +@@ -20,8 +20,8 @@ + /* necessary because libavutil/common.h uses UINT64_C */ + #define __STDC_CONSTANT_MACROS + +-#include "lib/ffmpeg/Time.hxx" + #include "config.h" ++#include "lib/ffmpeg/Time.hxx" + #include "FfmpegDecoderPlugin.hxx" + #include "lib/ffmpeg/Domain.hxx" + #include "lib/ffmpeg/Error.hxx" |