anchor.diff:      comment = "Java Decompiler JD-GUI";
       desktopName = "JD-GUI";
       genericName = "Java Decompiler";
  -    mimeType = "application/x-java-archive;application/x-java";
  +    mimeType = "application/java;application/java-vm;application/java-archive";
       categories = "Development;Debugger;";
  +    extraEntries="StartupWMClass=org-jd-gui-App";
     };
   
  -in stdenv.mkDerivation {
  -  inherit name version src;
  +in stdenv.mkDerivation rec {
  +  inherit pname version src;
  +  name = "${pname}-${version}";
   
  -  nativeBuildInputs = [ gradle_2_5 perl makeWrapper ];
  +  nativeBuildInputs = [ jdk ];
  +
  +  patchPhase = "patchShebangs gradlew";
   
     buildPhase = ''
       export GRADLE_USER_HOME=$(mktemp -d)
  -    gradle --offline --no-daemon --info --init-script ${gradleInit} jar
  +    cp -r ${deps}/wrapper $GRADLE_USER_HOME
  +    chmod u+w $GRADLE_USER_HOME/wrapper/dists/gradle*/*/*.lck
  +    ./gradlew --offline --no-daemon --info --init-script ${gradleInit} jar
     '';
   
     installPhase = let
  
positive.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
      '';
  
      outputHashAlgo = "sha256";
      outputHashMode = "recursive";
      outputHash = "1apmqiphnav79m4rdii58h7f4qslpfig4qybyyl2fr7zk92gv3l9";
    };
  
    # Point to our local deps repo
  
negative.code: { stdenv, fetchFromGitHub, jre, jdk, makeDesktopItem, perl, writeText, runtimeShell }:
  
  let
    pname = "jd-gui";
    version = "1.6.5";
  
    src = fetchFromGitHub {
      owner = "java-decompiler";
      repo = pname;
      rev = "v${version}";
      sha256 = "0yn2xcwznig941pw2f3wi8ixz1wprxcn9wl0g2ggdzx51rfwgzzi";
    };
  
    deps = stdenv.mkDerivation {
      name = "${pname}-deps";
      inherit src;
  
      nativeBuildInputs = [ jdk perl ];
  
      patchPhase = "patchShebangs gradlew";
  
      buildPhase = ''
        export GRADLE_USER_HOME=$(mktemp -d);
        ./gradlew --no-daemon jar
      '';
  
      # Mavenize dependency paths
  