anchor.diff: -{ stdenv, fetchurl, gradle_2_5, perl, makeWrapper, jre, makeDesktopItem, writeText, runtimeShell }:
  +{ stdenv, fetchFromGitHub, jre, jdk, makeDesktopItem, perl, writeText, runtimeShell }:
   
   let
  -  version = "1.4.0";
  -  name = "jd-gui-${version}";
  +  pname = "jd-gui";
  +  version = "1.6.5";
   
  -  src = fetchurl {
  -    url    = "https://github.com/java-decompiler/jd-gui/archive/v${version}.tar.gz";
  -    sha256 = "0anz7szlr5kgmsmkyv34jdynsnk8v6kvibcyz98jsd96fh725lax";
  +  src = fetchFromGitHub {
  +    owner = "java-decompiler";
  +    repo = pname;
  +    rev = "v${version}";
  +    sha256 = "0yn2xcwznig941pw2f3wi8ixz1wprxcn9wl0g2ggdzx51rfwgzzi";
     };
   
     deps = stdenv.mkDerivation {
  -    name = "${name}-deps";
  +    name = "${pname}-deps";
       inherit src;
  -    nativeBuildInputs = [ gradle_2_5 perl ];
  +
  +    nativeBuildInputs = [ jdk perl ];
  +
  +    patchPhase = "patchShebangs gradlew";
   
       buildPhase = ''
         export GRADLE_USER_HOME=$(mktemp -d);
  -      gradle --no-daemon build
  +      ./gradlew --no-daemon jar
       '';
   
       # Mavenize dependency paths
  
positive.code:     cat > $out/bin/jd-gui <<EOF
      #!${runtimeShell}
      export JAVA_HOME=${jre}
      ${jre}/bin/java -jar ${jar} $@
      EOF
      chmod +x $out/bin/jd-gui
  
      ${(desktopItem "$out/bin/jd-gui").buildCommand}
    '';
  
    dontStrip = true;
  
    meta = with stdenv.lib; {
      description = "Fast Java Decompiler with powerful GUI";
      homepage    = "http://jd.benow.ca/";
      license     = licenses.gpl3;
      platforms   = platforms.unix;
      maintainers = [ maintainers.thoughtpolice ];
  
negative.code:       find $GRADLE_USER_HOME/caches/modules-2 -type f -regex '.*\.\(jar\|pom\)' \
          | perl -pe 's#(.*/([^/]+)/([^/]+)/([^/]+)/[0-9a-f]{30,40}/([^/\s]+))$# ($x = $2) =~ tr|\.|/|; "install -Dm444 $1 \$out/$x/$3/$4/$5" #e' \
          | sh
        cp -r $GRADLE_USER_HOME/wrapper $out
      '';
  
      outputHashAlgo = "sha256";
      outputHashMode = "recursive";
      outputHash = "1s4p91iiyikrsgvpzkhw3jm5lsm0jpzp7iw7afdhhl9jm18igs70";
    };
  
    # Point to our local deps repo
  