1{ stdenv, fetchurl, makeWrapper, jre }:
2
3stdenv.mkDerivation rec {
4 name = "jruby-${version}";
5
6 version = "1.7.21";
7
8 src = fetchurl {
9 url = "http://jruby.org.s3.amazonaws.com/downloads/${version}/jruby-bin-${version}.tar.gz";
10 sha1 = "4955b69a913b22f96bd599eff2a133d8d1ed42c6";
11 };
12
13 buildInputs = [ makeWrapper ];
14
15 installPhase = ''
16 mkdir -pv $out
17 mv * $out
18 rm $out/bin/*.{bat,dll,exe,sh}
19 mv $out/COPYING $out/LICENSE* $out/docs
20
21 for i in $out/bin/*; do
22 wrapProgram $i \
23 --set JAVA_HOME ${jre}
24 done
25 '';
26
27 meta = {
28 description = "Ruby interpreter written in Java";
29 homepage = http://jruby.org/;
30 license = with stdenv.lib.licenses; [ cpl10 gpl2 lgpl21 ];
31 };
32}