1{ stdenv, fetchurl, jre }:
2
3let version = "0_101"; in
4stdenv.mkDerivation rec {
5 name = "cfr-${version}";
6
7 src = fetchurl {
8 sha256 = "0zwl3whypdm2qrw3hwaqjnifkb4wcdn8fx9scrjkli54bhr6dqch";
9 url = "http://www.benf.org/other/cfr/cfr_${version}.jar";
10 };
11
12 meta = with stdenv.lib; {
13 inherit version;
14 description = "Another java decompiler";
15 longDescription = ''
16 CFR will decompile modern Java features - Java 8 lambdas (pre and post
17 Java beta 103 changes), Java 7 String switches etc, but is written
18 entirely in Java 6.
19 '';
20 homepage = http://www.benf.org/other/cfr/;
21 license = licenses.mit;
22 platforms = with platforms; all;
23 maintainers = with maintainers; [ nckx ];
24 };
25
26 buildInputs = [ jre ];
27
28 phases = [ "installPhase" ];
29
30 installPhase = ''
31 jar=$out/share/cfr/cfr_${version}.jar
32
33 install -Dm644 ${src} $jar
34
35 cat << EOF > cfr
36 #!${stdenv.shell}
37 exec ${jre}/bin/java -jar $jar "\''${@}"
38 EOF
39 install -Dm755 cfr $out/bin/cfr
40 '';
41}