nixpkgs/pkgs/development/libraries/java/rhino/default.nix

58 lines
1.4 KiB
Nix
Raw Normal View History

{ 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";
sha256 = "1pb08d9j81d0wz5wj31idz198iwhqb7mch872n08jh1354rjlqwk";
};
in
2014-01-09 12:01:38 +00:00
stdenv.mkDerivation {
name = "rhino-${version}";
2014-01-09 12:01:38 +00:00
src = fetchurl {
url = "ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino1_7R2.zip";
sha256 = "1p32hkghi6bkc3cf2dcqyaw5cjj7403mykcp0fy8f5bsnv0pszv7";
};
2014-01-09 12:01:38 +00:00
patches = [ ./gcj-type-mismatch.patch ];
2014-01-09 12:01:38 +00:00
preConfigure =
''
find -name \*.jar -or -name \*.class -exec rm -v {} \;
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"
'';
2014-01-09 12:01:38 +00:00
buildInputs = [ unzip ant javac jvm ];
2014-01-09 12:01:38 +00:00
buildPhase = "ant ${options} jar";
doCheck = false;
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"
'';
2014-01-09 12:01:38 +00:00
meta = {
description = "An implementation of JavaScript written in Java";
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.
'';
2014-01-09 12:01:38 +00:00
homepage = http://www.mozilla.org/rhino/;
2014-01-24 15:27:36 +00:00
license = [ "MPLv1.1" /* or */ "GPLv2+" ];
2014-01-09 12:01:38 +00:00
};
}