anchor.diff:      meson
       ninja
       pkgconfig
  -    valgrind
     ];
   
     buildInputs = [
  -    SDL2
       alsaLib
  -    bluez
       dbus
  -    ffmpeg_3
       glib
  -    gst_all_1.gst-plugins-base
  -    gst_all_1.gstreamer
       libjack2
       libpulseaudio
       libsndfile
  -    libva
  -    sbc
       udev
       vulkan-headers
       vulkan-loader
  -    xorg.libX11
  -  ];
  +    valgrind
  +    systemd
  +  ] ++ lib.optionals gstreamerSupport [ gst_all_1.gst-plugins-base gst_all_1.gstreamer ]
  +  ++ lib.optional ffmpegSupport ffmpeg
  +  ++ lib.optionals bluezSupport [ bluez sbc ];
   
     mesonFlags = [
       "-Ddocs=true"
       "-Dman=false" # we don't have xmltoman
  -    "-Dgstreamer=true"
  +    "-Dexamples=true" # only needed for `pipewire-media-session`
       "-Dudevrulesdir=lib/udev/rules.d"
       "-Dinstalled_tests=true"
       "-Dlibpulse-path=${placeholder "pulse"}/lib"
       "-Dlibjack-path=${placeholder "jack"}/lib"
  -  ] ++ stdenv.lib.optional nativeHspSupport "-Dbluez5-backend-native=true"
  -  ++ stdenv.lib.optional ofonoSupport "-Dbluez5-backend-ofono=true";
  +    "-Dgstreamer=${mesonBool gstreamerSupport}"
  +    "-Dffmpeg=${mesonBool ffmpegSupport}"
  +    "-Dbluez5=${mesonBool bluezSupport}"
  +    "-Dbluez5-backend-native=${mesonBool nativeHspSupport}"
  +    "-Dbluez5-backend-ofono=${mesonBool ofonoSupport}"
  +    "-Dbluez5-backend-hsphfpd=${mesonBool hsphfpdSupport}"
  +  ];
   
     FONTCONFIG_FILE = fontsConf; # Fontconfig error: Cannot load default config file
   
  
positive.code:     owner = "pipewire";
      repo = "pipewire";
      rev = version;
      sha256 = "1wbir3napjxcpjy2m70im0l2x1ylg541rwq6hhvm8z0n5khxgfy7";
    };
  
    patches = [
  
negative.code: { stdenv
  , lib
  , fetchFromGitLab
  , meson
  , ninja
  , systemd
  , pkgconfig
  , doxygen
  , graphviz
  , valgrind
  , glib
  , dbus
  , alsaLib
  , libjack2
  , udev
  , libva
  , libsndfile
  , vulkan-headers
  , vulkan-loader
  , libpulseaudio
  , makeFontsConf
  , callPackage
  , nixosTests
  , gstreamerSupport ? true, gst_all_1 ? null
  , ffmpegSupport ? true, ffmpeg ? null
  , bluezSupport ? true, bluez ? null, sbc ? null
  , nativeHspSupport ? true
  , ofonoSupport ? true
  , hsphfpdSupport ? false
  }:
  
  let
    fontsConf = makeFontsConf {
      fontDirectories = [];
    };
  
    mesonBool = b: if b then "true" else "false";
  in
  stdenv.mkDerivation rec {
    pname = "pipewire";
    version = "0.3.12";
  
    outputs = [
      "out"
  