anchor.diff:    version = "0.16.6";
   
     src = fetchurl {
  -    url = "http://www.gajim.org/downloads/0.16/gajim-${version}.tar.bz2";
  -    sha256 = "1p3qwzy07f0wkika9yigyiq167l2k6wn12flqa7x55z4ihbysmqk";
  +    name = "${name}.tar.bz2";
  +    url = "https://dev.gajim.org/gajim/gajim/repository/archive.tar.bz2?"
  +        + "ref=${name}";
  +    sha256 = "1s0h4xll9490vh7ygmi4zsd1fa107f3s9ykhpq0snb04fllwhjq7";
     };
   
  -  patches = [
  -    (fetchurl {
  -      name = "gajim-icon-index.patch";
  -      url = "https://dev.gajim.org/gajim/gajim/commit/7d20ed2b98a3070add188efab7308a5a06d9f4a2.diff";
  -      sha256 = "0w54hr5dq9y36val55kmh8d6cid7h4fs2nghx09714jylz2nyxxv";
  -    })
  -  ];
  +  patches = let
  +    # An attribute set of revisions to apply from the upstream repository.
  +    cherries = {
  +      misc-test-fixes = {
  +        rev = "1f0d7387fd020df5dfc9a6349005ec7dedb7c008";
  +        sha256 = "0nazpzyg50kl0k8z4dkn033933iz60g1i6nzhib1nmzhwwbnacc5";
  +      };
  +      jingle-fix = {
  +        rev = "491d32a2ec13ed3a482e151e0b403eda7b4151b8";
  +        sha256 = "1pfg1ysr0p6rcwmd8ikjs38av3c4gcxn8pxr6cnnj27n85gvi30g";
  +      };
  +      fix-connection-mock = {
  +        rev = "46a19733d208fbd2404cbaeedd8c203d0b6557a4";
  +        sha256 = "0l3s577pksnz16r4mqa1zmz4y165amsx2mclrm4vzlszy35rmy2b";
  +      };
  +    };
  +  in mapAttrsToList (name: { rev, sha256 }: fetchurl {
  +    name = "gajim-${name}.patch";
  +    url = "https://dev.gajim.org/gajim/gajim/commit/${rev}.diff";
  +    inherit sha256;
  +  }) cherries;
   
     postPatch = ''
       sed -i -e '0,/^[^#]/ {
  
positive.code:     done
    '';
  
    enableParallelBuilding = true;
  
    meta = {
  
negative.code: { stdenv, fetchurl, autoreconfHook, python, intltool, pkgconfig, libX11
  , ldns, pythonPackages
  
  # Test requirements
  , xvfb_run, dnsutils
  
  , enableJingle ? true, farstream ? null, gst_plugins_bad ? null
  ,                      libnice ? null
  