anchor.diff:      glib gtk3 libappindicator-gtk3 libnotify
       gst_all_1.gstreamer gst_all_1.gst-plugins-base dbus-glib udev
       libgudev
  -  ] ++ (if useFfmpeg then [ ffmpeg ] else [ libav_12 ])
  +  ] ++ (if useFfmpeg then [ ffmpeg ] else [ patched_libav_12 ])
     ++ lib.optional useFdk fdk_aac;
   
     dontUseCmakeConfigure = true;
  
positive.code: #
  # Only tested on Linux
  
  { stdenv, lib, fetchFromGitHub,
    python2, pkgconfig, yasm, harfbuzz, zlib,
    autoconf, automake, cmake, libtool, m4, jansson,
    libass, libiconv, libsamplerate, fribidi, libxml2, bzip2,
  
negative.code: }:
  
  stdenv.mkDerivation rec {
    version = "1.1.0";
    name = "handbrake-${version}";
  
    src = fetchurl {
      url = ''https://download2.handbrake.fr/${version}/HandBrake-${version}-source.tar.bz2'';
      sha256 = "1nj0ihflisxcfkmsk7fm3b5cn7cpnpg66dk2lkp2ip6qidppqbm0";
    };
  
    patched_libav_12 = libav_12.overrideAttrs (super: {
      # 2018-04-26: HandBrake compilation (1.1.0) requires a patch of LibAV (12.3) from HandBrake team. This patch not went LibAV upstream.
      patches = (super.patches or []) ++ [(
        fetchurl {
          url = ''https://raw.githubusercontent.com/HandBrake/HandBrake/9e1f245708a157231c427c0ef9b91729d59a30e1/contrib/ffmpeg/A21-mp4-sdtp.patch'';
          sha256 = "14grzyvb1qbb90k31ibabnwmwnrc48ml6h2z0rjamdv83q45jq4g";
        })
      ];
    });
  
    nativeBuildInputs = [
      cmake python2 pkgconfig yasm autoconf automake libtool m4
  