3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/java/rhino/default.nix

60 lines
1.5 KiB
Nix
Raw Normal View History

{ fetchurl, stdenv, unzip, ant, javac, jvm }:
let
version = "1.7R2";
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 {
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";
};
2014-01-09 12:01:38 +00:00
patches = [ ./gcj-type-mismatch.patch ];
hardeningDisable = [ "fortify" "format" ];
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 ];
buildPhase = "ant jar";
2014-01-09 12:01:38 +00:00
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"
'';
meta = with stdenv.lib; {
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/;
license = with licenses; [ mpl11 /* or */ gpl2Plus ];
platforms = platforms.linux ++ platforms.darwin;
2014-01-09 12:01:38 +00:00
};
}