2009-09-22 16:40:54 +02:00
|
|
|
{ stdenv, fetchurl, unzip, ant, gcj }:
|
|
|
|
|
|
|
|
let
|
2012-08-25 19:39:19 +02:00
|
|
|
version = "3.7.2";
|
|
|
|
date = "201202080800";
|
2010-03-01 17:40:02 +01:00
|
|
|
isGCJ = stdenv.lib.strings.substring 0 3 gcj.name == "gcj";
|
|
|
|
javaExec = if isGCJ then "gij" else "java";
|
|
|
|
javaFlags = if isGCJ then "--cp" else "-cp";
|
2009-09-22 16:40:54 +02:00
|
|
|
in
|
|
|
|
|
2014-01-03 16:15:46 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "ecj-${version}";
|
2009-09-22 16:40:54 +02:00
|
|
|
|
2014-01-03 16:15:46 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "http://eclipse.ialto.org/eclipse/downloads/drops/R-${version}-${date}/ecjsrc-${version}.jar";
|
|
|
|
sha256 = "0swyysbyfmv068x8q1c5jqpwk5zb4xahg17aypx5rwb660f8fpbm";
|
|
|
|
};
|
2009-09-22 16:40:54 +02:00
|
|
|
|
2014-01-03 16:15:46 +01:00
|
|
|
buildInputs = [ unzip ant gcj ];
|
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
mkdir "${name}"
|
|
|
|
cd "${name}"
|
|
|
|
unzip "$src"
|
|
|
|
'';
|
2009-09-22 16:40:54 +02:00
|
|
|
|
2014-01-03 16:15:46 +01:00
|
|
|
# Use whatever compiler Ant knows.
|
|
|
|
buildPhase = "ant build";
|
2009-09-22 16:40:54 +02:00
|
|
|
|
2014-01-03 16:15:46 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -pv "$out/lib/java"
|
|
|
|
cp -v *.jar "$out/lib/java"
|
2009-09-22 16:40:54 +02:00
|
|
|
|
2014-01-03 16:15:46 +01:00
|
|
|
mkdir -pv "$out/bin"
|
|
|
|
cat > "$out/bin/ecj" <<EOF
|
2009-09-22 16:40:54 +02:00
|
|
|
#! /bin/sh
|
2010-03-01 17:40:02 +01:00
|
|
|
exec "$(type -P ${javaExec})" ${javaFlags} "$out/lib/java/ecj.jar" org.eclipse.jdt.internal.compiler.batch.Main \$@
|
2009-09-22 16:40:54 +02:00
|
|
|
EOF
|
|
|
|
|
2014-01-03 16:15:46 +01:00
|
|
|
chmod u+x "$out/bin/ecj"
|
|
|
|
'';
|
2009-09-22 16:40:54 +02:00
|
|
|
|
2014-01-03 16:15:46 +01:00
|
|
|
meta = {
|
|
|
|
description = "The Eclipse Compiler for Java (ECJ)";
|
2009-09-22 16:40:54 +02:00
|
|
|
|
2014-01-03 16:15:46 +01:00
|
|
|
longDescription = ''
|
|
|
|
ECJ is an incremental Java compiler. Implemented as an Eclipse
|
|
|
|
builder, it is based on technology evolved from VisualAge for Java
|
|
|
|
compiler. In particular, it allows users to run and debug code which
|
|
|
|
still contains unresolved errors.
|
|
|
|
'';
|
2009-09-22 16:40:54 +02:00
|
|
|
|
2014-01-03 16:15:46 +01:00
|
|
|
homepage = http://www.eclipse.org/jdt/core/index.php;
|
2009-09-22 16:40:54 +02:00
|
|
|
|
2014-01-03 16:15:46 +01:00
|
|
|
# http://www.eclipse.org/legal/epl-v10.html (free software, copyleft)
|
|
|
|
license = "EPLv1.0";
|
|
|
|
};
|
|
|
|
}
|