about summary refs log tree commit diff
path: root/pkgs/tools/misc/procyon/default.nix
blob: 984459f2a4f60cc9a506f2bd84b047b2e009b34a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ lib, stdenv, fetchurl, runtimeShell, jre_headless }:

stdenv.mkDerivation rec {
  pname = "procyon";
  version = "0.6.0";

  src = fetchurl {
    url = "https://github.com/mstrobel/procyon/releases/download/v${version}/procyon-decompiler-${version}.jar";
    sha256 = "sha256-gh2pYBL8aSRPoeopjJBFXuTgIUNLx5bTuVRqskYBt3k=";
  };

  dontUnpack = true;

  installPhase = ''
    mkdir -p $out/bin $out/share/procyon
    cp $src $out/share/procyon/procyon-decompiler.jar

    cat << EOF > $out/bin/procyon
    #!${runtimeShell}
    exec ${jre_headless}/bin/java -jar $out/share/procyon/procyon-decompiler.jar "\$@"
    EOF
    chmod +x $out/bin/procyon
  '';

  meta = with lib; {
    description = "Procyon is a suite of Java metaprogramming tools including a Java decompiler";
    sourceProvenance = with sourceTypes; [ binaryBytecode ];
    homepage = "https://github.com/mstrobel/procyon/";
    license = licenses.asl20;
    maintainers = [ ];
    mainProgram = "procyon";
  };
}