2009-10-19 16:47:04 +02:00
|
|
|
{ fetchurl, stdenv, unzip, ant, javac, jvm }:
|
|
|
|
|
|
|
|
let
|
|
|
|
version = "1.7R2";
|
|
|
|
options = "-Dbuild.compiler=gcj"; # FIXME: We assume GCJ here.
|
|
|
|
|
|
|
|
xbeans = fetchurl {
|
2012-08-25 19:40:15 +02:00
|
|
|
url = "http://archive.apache.org/dist/xmlbeans/binaries/xmlbeans-2.2.0.zip";
|
2009-10-19 16:47:04 +02:00
|
|
|
sha256 = "1pb08d9j81d0wz5wj31idz198iwhqb7mch872n08jh1354rjlqwk";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
2014-01-09 13:01:38 +01:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "rhino-${version}";
|
2009-10-19 16:47:04 +02:00
|
|
|
|
2014-01-09 13:01:38 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino1_7R2.zip";
|
|
|
|
sha256 = "1p32hkghi6bkc3cf2dcqyaw5cjj7403mykcp0fy8f5bsnv0pszv7";
|
|
|
|
};
|
2009-10-19 16:47:04 +02:00
|
|
|
|
2014-01-09 13:01:38 +01:00
|
|
|
patches = [ ./gcj-type-mismatch.patch ];
|
2009-10-19 16:47:04 +02:00
|
|
|
|
2014-01-09 13:01:38 +01:00
|
|
|
preConfigure =
|
|
|
|
''
|
|
|
|
find -name \*.jar -or -name \*.class -exec rm -v {} \;
|
2009-10-19 16:47:04 +02:00
|
|
|
|
2014-01-09 13:01:38 +01:00
|
|
|
# The build process tries to download it by itself.
|
|
|
|
mkdir -p "build/tmp-xbean"
|
|
|
|
ln -sv "${xbeans}" "build/tmp-xbean/xbean.zip"
|
|
|
|
'';
|
2009-10-19 16:47:04 +02:00
|
|
|
|
2014-01-09 13:01:38 +01:00
|
|
|
buildInputs = [ unzip ant javac jvm ];
|
2009-10-19 16:47:04 +02:00
|
|
|
|
2014-01-09 13:01:38 +01:00
|
|
|
buildPhase = "ant ${options} jar";
|
|
|
|
doCheck = false;
|
2009-10-19 16:47:04 +02:00
|
|
|
|
2014-01-09 13:01:38 +01:00
|
|
|
# FIXME: Install javadoc as well.
|
|
|
|
installPhase =
|
|
|
|
''
|
|
|
|
mkdir -p "$out/share/java"
|
|
|
|
cp -v *.jar "$out/share/java"
|
|
|
|
'';
|
2009-10-19 16:47:04 +02:00
|
|
|
|
2014-01-09 13:01:38 +01:00
|
|
|
meta = {
|
2014-08-24 16:21:08 +02:00
|
|
|
description = "An implementation of JavaScript written in Java";
|
2009-10-19 16:47:04 +02:00
|
|
|
|
2014-01-09 13:01:38 +01:00
|
|
|
longDescription =
|
|
|
|
'' Rhino is an open-source implementation of JavaScript written
|
|
|
|
entirely in Java. It is typically embedded into Java applications
|
|
|
|
to provide scripting to end users.
|
|
|
|
'';
|
2009-10-19 16:47:04 +02:00
|
|
|
|
2014-01-09 13:01:38 +01:00
|
|
|
homepage = http://www.mozilla.org/rhino/;
|
2009-10-19 16:47:04 +02:00
|
|
|
|
2014-01-24 16:27:36 +01:00
|
|
|
license = [ "MPLv1.1" /* or */ "GPLv2+" ];
|
2014-01-09 13:01:38 +01:00
|
|
|
};
|
|
|
|
}
|