2009-10-19 15:47:04 +01: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 18:40:15 +01:00
|
|
|
url = "http://archive.apache.org/dist/xmlbeans/binaries/xmlbeans-2.2.0.zip";
|
2009-10-19 15:47:04 +01:00
|
|
|
sha256 = "1pb08d9j81d0wz5wj31idz198iwhqb7mch872n08jh1354rjlqwk";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
2014-01-09 12:01:38 +00:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "rhino-${version}";
|
2009-10-19 15:47:04 +01:00
|
|
|
|
2014-01-09 12:01:38 +00:00
|
|
|
src = fetchurl {
|
2016-05-09 14:49:44 +01:00
|
|
|
url = "mirror://mozilla/js/rhino1_7R2.zip";
|
2014-01-09 12:01:38 +00:00
|
|
|
sha256 = "1p32hkghi6bkc3cf2dcqyaw5cjj7403mykcp0fy8f5bsnv0pszv7";
|
|
|
|
};
|
2009-10-19 15:47:04 +01:00
|
|
|
|
2014-01-09 12:01:38 +00:00
|
|
|
patches = [ ./gcj-type-mismatch.patch ];
|
2009-10-19 15:47:04 +01:00
|
|
|
|
2014-01-09 12:01:38 +00:00
|
|
|
preConfigure =
|
|
|
|
''
|
|
|
|
find -name \*.jar -or -name \*.class -exec rm -v {} \;
|
2009-10-19 15:47:04 +01:00
|
|
|
|
2014-01-09 12:01:38 +00: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 15:47:04 +01:00
|
|
|
|
2014-01-09 12:01:38 +00:00
|
|
|
buildInputs = [ unzip ant javac jvm ];
|
2009-10-19 15:47:04 +01:00
|
|
|
|
2014-01-09 12:01:38 +00:00
|
|
|
buildPhase = "ant ${options} jar";
|
|
|
|
doCheck = false;
|
2009-10-19 15:47:04 +01:00
|
|
|
|
2014-01-09 12:01:38 +00:00
|
|
|
# FIXME: Install javadoc as well.
|
|
|
|
installPhase =
|
|
|
|
''
|
|
|
|
mkdir -p "$out/share/java"
|
|
|
|
cp -v *.jar "$out/share/java"
|
|
|
|
'';
|
2009-10-19 15:47:04 +01:00
|
|
|
|
2015-05-27 20:56:04 +01:00
|
|
|
meta = with stdenv.lib; {
|
2014-08-24 15:21:08 +01:00
|
|
|
description = "An implementation of JavaScript written in Java";
|
2009-10-19 15:47:04 +01:00
|
|
|
|
2014-01-09 12:01:38 +00: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 15:47:04 +01:00
|
|
|
|
2014-01-09 12:01:38 +00:00
|
|
|
homepage = http://www.mozilla.org/rhino/;
|
2009-10-19 15:47:04 +01:00
|
|
|
|
2015-05-27 20:56:04 +01:00
|
|
|
license = with licenses; [ mpl11 /* or */ gpl2Plus ];
|
2016-08-02 18:50:55 +01:00
|
|
|
platforms = platforms.linux;
|
2014-01-09 12:01:38 +00:00
|
|
|
};
|
|
|
|
}
|