anchor.diff: -{ stdenv, fetchurl, fetchpatch, meson, ninja
  -, pkgconfig, gettext, gobject-introspection
  -, bison, flex, python3, glib, makeWrapper
  -, libcap,libunwind, darwin
  +{ stdenv
  +, fetchurl
  +, fetchpatch
  +, meson
  +, ninja
  +, pkgconfig
  +, gettext
  +, gobject-introspection
  +, bison
  +, flex
  +, python3
  +, glib
  +, makeWrapper
  +, libcap
  +, libunwind
  +, darwin
   , elfutils # for libdw
   , bash-completion
  -, docbook_xsl, docbook_xml_dtd_412
  +, docbook_xsl
  +, docbook_xml_dtd_43
   , gtk-doc
   , lib
   , CoreServices
  
positive.code:     done
    '';
  
    preConfigure=
      # These files are not executable upstream, so we need to
      # make them executable for `patchShebangs` to pick them up.
      # Can be removed when this is merged and available:
      #     https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/141
      ''
        chmod +x gst/parse/get_flex_version.py
      '' +
      ''
        patchShebangs .
      '';
  
    preFixup = ''
      moveToOutput "share/bash-completion" "$dev"
    '';
  
    setupHook = ./setup-hook.sh;
  }
  
negative.code: 
  stdenv.mkDerivation rec {
    pname = "gstreamer";
    version = "1.16.1";
  
    outputs = [ "out" "dev" "devdoc" ];
    outputBin = "dev";
  
    src = fetchurl {
      url = "${meta.homepage}/src/${pname}/${pname}-${version}.tar.xz";
      sha256 = "0z9pyhf6zm1r0spw6zym80bvbyx6h8xg9h6535csbnn48ws1q882";
    };
  
    patches = [
      ./fix_pkgconfig_includedir.patch
    ];
  
    nativeBuildInputs = [
      meson
      ninja
      pkgconfig
      gettext
      bison
      flex
      python3
      makeWrapper
      gobject-introspection
      bash-completion
  
      # documentation
      gtk-doc
      docbook_xsl
      docbook_xml_dtd_43
    ];
  
    buildInputs = lib.optionals stdenv.isLinux [
      libcap
      libunwind
      elfutils
    ] ++ lib.optionals stdenv.isDarwin [
      CoreServices
    ];
  
    propagatedBuildInputs = [
      glib
    ];
  
    mesonFlags = [
      "-Ddbghelp=disabled" # not needed as we already provide libunwind and libdw, and dbghelp is a fallback to those
      "-Dexamples=disabled" # requires many dependencies and probably not useful for our users
    ] ++ lib.optionals stdenv.isDarwin [
      # darwin.libunwind doesn't have pkgconfig definitions so meson doesn't detect it.
      "-Dlibunwind=disabled"
      "-Dlibdw=disabled"
    ];
  
    postPatch = ''
      patchShebangs \
        gst/parse/get_flex_version.py \
        gst/parse/gen_grammar.py.in \
        gst/parse/gen_lex.py.in \
        libs/gst/helpers/ptp_helper_post_install.sh
    '';
  
    postInstall = ''
      for prog in "$dev/bin/"*; do
  