anchor.diff:      ++ 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
  
positive.code:       (mkFlag opusSupport "opus")
        (mkFlag soundcloudSupport "soundcloud")
        "--enable-debug"
      ]
      ++ opt stdenv.isLinux
        "--with-systemdsystemunitdir=$(out)/etc/systemd/system";
  
negative.code: , 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}";
  