anchor.diff:      ++ opt clientSupport mpd_clientlib
       ++ opt opusSupport libopus
       ++ opt soundcloudSupport yajl;
  +
  +  nativeBuildInputs = [ autoreconfHook pkgconfig ];
  +
  +  enableParallelBuilding = true;
   
     configureFlags =
       [ (mkFlag (!stdenv.isDarwin && alsaSupport) "alsa")
  
positive.code: { stdenv, fetchurl, fetchpatch, pkgconfig, glib, systemd, boost, darwin
  , alsaSupport ? true, alsaLib
  , avahiSupport ? true, avahi, dbus
  , flacSupport ? true, flac
  
negative.code:   opt = stdenv.lib.optional;
    mkFlag = c: f: if c then "--enable-${f}" else "--disable-${f}";
    major = "0.20";
    minor = "9";
  
  in stdenv.mkDerivation rec {
    name = "mpd-${version}";
    version = "${major}${if minor == "" then "" else "." + minor}";
  
    src = fetchFromGitHub {
      owner  = "MusicPlayerDaemon";
      repo   = "MPD";
      rev    = "v${version}";
      sha256 = "17ly30syrlw5274washifr0nddll3g1zb4rr4f9sfnlxz9wz73p1";
    };
  
    patches = [ ./x86.patch ];
  
    buildInputs = [ glib boost ]
      ++ opt stdenv.isDarwin darwin.apple_sdk.frameworks.CoreAudioKit
      ++ opt stdenv.isLinux systemd
      ++ opt (stdenv.isLinux && alsaSupport) alsaLib
  