anchor.diff:    outputs = [ "out" "dev" ];
   
     nativeBuildInputs = [ pkg-config meson ninja makeWrapper perlPackages.perl perlPackages.XMLParser m4 ]
  -    ++ lib.optionals stdenv.isLinux [ glib ];
  +    ++ lib.optionals stdenv.isLinux [ glib ]
  +    # gstreamer plugin discovery requires wrapping
  +    ++ lib.optional bluetoothSupport wrapGAppsHook;
   
     propagatedBuildInputs =
       lib.optionals stdenv.isLinux [ libcap ];
  
positive.code:     "-Dasyncns=${if !libOnly then "enabled" else "disabled"}"
      "-Davahi=${if zeroconfSupport then "enabled" else "disabled"}"
      "-Dbluez5=${if !libOnly then "enabled" else "disabled"}"
      "-Dbluez5-gstreamer=disabled"
      "-Ddatabase=simple"
      "-Ddoxygen=false"
      "-Delogind=disabled"
  
negative.code:       ++ lib.optional useSystemd systemd
        ++ lib.optionals stdenv.isLinux [ alsa-lib udev ]
        ++ lib.optional airtunesSupport openssl
        # aptX and LDAC codecs are in gst-plugins-bad so far, rtpldacpay is in -good
        ++ lib.optionals bluetoothSupport ([ bluez5 sbc ]
          ++ (builtins.attrValues { inherit (gst_all_1) gst-plugins-bad gst-plugins-good gst-plugins-base gstreamer; }))
        ++ lib.optional remoteControlSupport lirc
        ++ lib.optional zeroconfSupport  avahi
    );
  