anchor.diff:      libtool
     ];
   
  -  propagatedBuildInputs = [
  -    optLibcap
  -  ];
  -
     buildInputs = [
  -    json_c
  +    glib
  +    libasyncns
  +    libcap
  +    json-c
       libsndfile
  -    check
  -    database
  -    optOss
  -    optCoreaudio
  -    optAlsaLib
  -    optEsound
  -    optGlib
  -    optGtk3
  -    optGconf
  -    optAvahi
  -    optLibjack2
  -    optLibasyncns
  -    optLirc
  -    optDbus
  -    optUdev
  -    optOpenssl
  -    optFftw
  -    optSpeexdsp
  -    optSoxr
  -    optSystemd
  -    optWebrtc-audio-processing
  -  ] ++ optionals hasXlibs (with xorg; [
  -    libX11
  -    libxcb
  -    libICE
  -    libSM
  -    libXtst
  -    xextproto
  -    libXi
  -  ]) ++ optionals (optBluez != null) [
  -    optBluez
  -    optSbc
  +    fftw_double
  +    tdb
  +    speexdsp
  +  ] ++ optionals (!libOnly) [
  +    dbus_lib
  +    alsa-lib
  +    gtk3
  +    gconf
  +    avahi
  +    jack2_lib
  +    lirc
  +    openssl
  +    soxr
  +    systemd_lib
  +    webrtc-audio-processing
  +    xorg.libX11
  +    xorg.libxcb
  +    xorg.libICE
  +    xorg.libSM
  +    xorg.libXtst
  +    xorg.xextproto
  +    xorg.libXi
  +    bluez
  +    sbc
     ];
   
     patches = [
  
positive.code:     '';
  
    configureFlags = [
      (otFlag "localstatedir" true "/var")
      (otFlag "sysconfdir" true "/etc")
      (enFlag "atomic-arm-memory-barrier" false null)
      (enFlag "neon-opt" false null)
      (enFlag "x11" hasXlibs null)
      (wtFlag "caps" hasCaps optLibcap)
      (enFlag "tests" true null)
      "--disable-samplerate" # Deprecated
      (wtFlag "database" true databaseName)
      (enFlag "oss-output" hasOss null)
      (enFlag "oss-wrapper" true null) # Does not use OSS
      (enFlag "coreaudio-output" (optCoreaudio != null) null)
      (enFlag "alsa" (optAlsaLib != null) null)
      (enFlag "esound" (optEsound != null) null)
      (enFlag "solaris" false null)
      (enFlag "waveout" false null) # Windows Only
      (enFlag "glib2" (optGlib != null) null)
      (enFlag "gtk3" (optGtk3 != null) null)
      (enFlag "gconf" (optGconf != null) null)
      (enFlag "avahi" (optAvahi != null) null)
      (enFlag "jack" (optLibjack2 != null) null)
      (enFlag "asyncns" (optLibasyncns != null) null)
      (enFlag "tcpwrap" false null)
      (enFlag "lirc" (optLirc != null) null)
      (enFlag "dbus" (optDbus != null) null)
      (enFlag "bluez4" false null)
      (enFlag "bluez5" (optBluez != null) null)
      (enFlag "bluez5-ofono-headset" (optBluez != null) null)
      (enFlag "bluez5-native-headset" (optBluez != null) null)
      (enFlag "udev" (optUdev != null) null)
      (enFlag "hal-compat" false null)
      (enFlag "ipv6" true null)
      (enFlag "openssl" (optOpenssl != null) null)
      (wtFlag "fftw" (optFftw != null) null)
      (wtFlag "speex" (optSpeexdsp != null) null)
      (wtFlag "soxr" (optSoxr != null) null)
      (enFlag "xen" false null)
      (enFlag "gcov" false null)
      (enFlag "systemd-daemon" (optSystemd != null) null)
      (enFlag "systemd-login" (optSystemd != null) null)
      (enFlag "systemd-journal" (optSystemd != null) null)
      (enFlag "manpages" true null)
      (enFlag "webrtc-aec" hasWebrtc null)
      (enFlag "adrian-aec" true null)
      (wtFlag "system-user" true "pulse")
      (wtFlag "system-group" true "pulse")
      (wtFlag "access-group" true "audio")
      (wtFlag "systemduserunitdir" true "\${out}/lib/systemd/user")
      (wtFlag "bash-completion-dir" true
        "\${out}/share/bash-completions/completions")
    ];
  
    installFlags = [
  
negative.code: , resampleMethod ? "speex-float-1"
  }:
  
  let
    inherit (stdenv.lib)
      optionals
      optionalString;
    inherit (builtins.getAttr resampleMethod (import ./resample-methods.nix))
      resampleMethodString;
  
    libOnly = prefix == "lib";
  in
  
  assert resampleMethodString != null;
  
  stdenv.mkDerivation rec {
    name = "${prefix}pulseaudio-${version}";
  