anchor.diff:      patches = [
         ./patches/build_fixes_46.patch
         ./patches/widevine.patch
  -      (if versionOlder version "50.0.0.0"
  -       then ./patches/nix_plugin_paths_46.patch
  -       else ./patches/nix_plugin_paths_50.patch)
  +      (if versionOlder version "50.0.0.0" then
  +         ./patches/nix_plugin_paths_46.patch
  +       else
  +         ./patches/nix_plugin_paths_50.patch)
       ];
   
       postPatch = ''
  
positive.code:   mkGypFlags =
      let
        sanitize = value:
          if value == true then "1"
          else if value == false then "0"
          else "${value}";
        toFlag = key: value: "-D${key}=${sanitize value}";
      in attrs: concatStringsSep " " (attrValues (mapAttrs toFlag attrs));
  
    gypFlagsUseSystemLibs = {
      use_system_bzip2 = true;
      use_system_flac = true;
      use_system_libevent = true;
      use_system_libexpat = true;
      use_system_libjpeg = true;
      use_system_libpng = versionOlder upstream-info.version "51.0.0.0";
      use_system_libwebp = true;
      use_system_libxml = true;
      use_system_opus = true;
      use_system_snappy = true;
      use_system_speex = true;
      use_system_stlport = true;
      use_system_xdg_utils = true;
      use_system_yasm = true;
      use_system_zlib = false;
      use_system_protobuf = false; # needs newer protobuf
  
      use_system_harfbuzz = false;
      use_system_icu = false; # Doesn't support ICU 52 yet.
      use_system_libusb = false; # http://crbug.com/266149
      use_system_skia = false;
      use_system_sqlite = false; # http://crbug.com/22208
      use_system_v8 = false;
    };
  
    defaultDependencies = [
      bzip2 flac speex opus
      libevent expat libjpeg snappy
      libpng libxml2 libxslt libcap
      xdg-utils yasm libwebp
      libusb
    ];
  
    # build paths and release info
    packageName = extraAttrs.packageName or extraAttrs.name;
  
negative.code:         --exclude='*/tools/gyp'
      '';
  
      buildInputs = [
        bison
        gperf
        perl
        pkgconfig
        python
        pythonPackages.gyp
        pythonPackages.ply
        pythonPackages.jinja2
        which
  
        alsa-lib
        atk
        bzip2
        cairo
        dbus
        dbus-glib
        expat
        flac
        freetype
        glib
        gtk_2
        kerberos
        libcap
        libevent
        libffi
        libjpeg
        libpng
        libusb
        libwebp
        libxml2
        libxslt
        mesa
        nspr
        nss
        opus
        pango
        pciutils
        protobuf-cpp
        snappy
        speechd
        speex
        systemd_lib
        util-linux_full
        xdg-utils
        xorg.compositeproto
        xorg.inputproto
        xorg.libX11
        xorg.libXcomposite
        xorg.libXcursor
        xorg.libXdamage
        xorg.libXext
        xorg.libXfixes
        xorg.libXi
        xorg.libXrandr
        xorg.libXrender
        xorg.libXScrnSaver
        xorg.libXtst
        xorg.renderproto
        xorg.xextproto
        fontconfig
        xorg.xproto
        xorg.fixesproto
        xorg.damageproto
        yasm
      ] ++ optional gnomeKeyringSupport libgnome-keyring
        ++ optionals gnomeSupport [ gconf libgcrypt ]
        ++ optional enableSELinux libselinux
  